fix(Scorer): honour _preScored for no-query when value exceeds typeBonus#2065
Merged
bbedward merged 1 commit intoAvengeMedia:masterfrom Mar 23, 2026
Merged
Conversation
Plugin items can set _preScored to signal a priority boost (e.g. recently used items). Previously _preScored was only respected when a search query was active, so no-query default lists always fell back to typeBonus+frecency scoring, making plugin-controlled ordering impossible. Change the condition from: if (query && item._preScored !== undefined) to: if (item._preScored !== undefined && (query || item._preScored > 900)) This respects _preScored in no-query mode only when the value exceeds 900 (the plugin typeBonus), which avoids changing behaviour for "all" mode items whose _preScored is set to 900-j by the controller (≤ 900). Items without _preScored set continue to use the existing typeBonus + frecency formula.
devnullvoid
added a commit
to devnullvoid/dms-emoji-launcher
that referenced
this pull request
Mar 23, 2026
Merges fix/issues-12-13-14 #12 — Heart emoji search: skin-tone variants were flooding results and pushing colored hearts past the 50-item cutoff. Fixed by only applying the SKIN_TONE_PENALTY when score > 0, so variants don't score 1 in the unfiltered default list. #13 — Unicode v17.0: added 8 new emojis (distorted face, fight cloud, orca, hairy creature, trombone, landslide, treasure chest, ballet dancer) and regenerated catalog.js. #14 — Recently used: tracks the last 20 selected emojis and surfaces them at the top of the default (no-query) list using _preScored > 900. Requires AvengeMedia/DankMaterialShell#2065 to be merged for the float-to-top behaviour; tracking and persistence work independently of that fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_preScoredwas only respected by the Scorer when an active search query existed. In no-query (default) mode all plugin items fell back totypeBonus + frecencyscoring (900 for plugins), making plugin-controlled ordering of the default list impossible._preScoredin no-query mode when the value exceeds 900 (the plugin typeBonus). Values ≤ 900 continue to use the existing formula, so items whose_preScoredis set to900 - jby the controller in "all" mode are unaffected.Change
Motivation
This unblocks plugins that want to surface priority items (e.g. recently-used) at the top of their default no-query list. Without this fix a plugin can sort its
getItems("")return value correctly but DMS will re-score everything equally and discard that ordering.The specific use-case is the dms-emoji-launcher plugin surfacing recently-used emojis at the top of the
:etrigger default list.Test plan
_preScored > 900appear above other plugin items_preScored ≤ 900orundefined)