Skip to content

[CmdPal] Per-provider search weight (Lower/Normal/Higher)#49191

Draft
michaeljolley wants to merge 1 commit into
dev/mjolley/frecency-redesignfrom
dev/mjolley/provider-weighting
Draft

[CmdPal] Per-provider search weight (Lower/Normal/Higher)#49191
michaeljolley wants to merge 1 commit into
dev/mjolley/frecency-redesignfrom
dev/mjolley/provider-weighting

Conversation

@michaeljolley

Copy link
Copy Markdown
Contributor

Phase 3 of the stacked CmdPal search overhaul. Based on and targeting dev/mjolley/frecency-redesign (phase 2), NOT main.

What

Adds a per-provider Search weight (Lower / Normal / Higher, default Normal) that nudges main-page search results within their relevance tier only. Tier always dominates; the weight can reorder near-ties but can never move an item across a tier boundary.

Changes

  • ProviderSettings: new ProviderSearchWeight enum (Lower = -1, Normal = 0, Higher = 1) + SearchWeight property. Missing/legacy JSON deserializes to Normal.
  • MainListRanker: ProviderWeightBonus = 5.0 constant and ProviderBonus(weight) mapping (signed magnitude). Half a point of lexical quality (LexicalScale = 10), so it only breaks near-ties.
  • MainListPage.ScoreTopLevelItem: resolves each item's provider weight (top-level commands by their provider id, installed apps by the well-known AllApps provider) and feeds it into the within-tier score. Backward-compatible optional parameter.
  • ProviderSettingsViewModel + ExtensionPage.xaml: a Lower/Normal/Higher ComboBox per provider (shown for built-ins and apps too). New resw strings. Ran applyXamlStyling.

Design constant

  • Provider bonus per level: +/- 5.0 points (Higher = +5, Normal = 0, Lower = -5), vs LexicalScale = 10 per lexical point and FrecencyScale = 1. Modest by design.

Tests (all green, x64 host)

  • Provider weight reorders within a tier; never crosses a tier boundary (even Higher + heavy history vs a Lower exact match).
  • Default Normal == the previous provider-unaware behavior (no-op).
  • Applies to app-style (non-TopLevel) items.
  • Serialization round-trips; legacy JSON without the property defaults to Normal.
  • Build CommandPalette.slnf x64/Debug = exit 0. ViewModels 157/157. All other CmdPal unit suites pass (Registry + WindowWalker not run - known pre-existing non-green).

Atomic to phase 3; host-side only, no extension SDK changes.

Add a per-provider SearchWeight (Lower/Normal/Higher, default Normal) that
nudges main-page search results within their relevance tier only. The nudge is
a small additive within-tier bonus (+/- 5 points, half a point of lexical
quality) so it breaks near-ties but can never move an item across a tier
boundary. Applies to installed apps too via the well-known AllApps provider.

- ProviderSettings: new ProviderSearchWeight enum + SearchWeight property;
  legacy/missing JSON deserializes to Normal.
- MainListRanker: ProviderWeightBonus constant + ProviderBonus() mapping.
- MainListPage.ScoreTopLevelItem: resolves each item's provider weight and
  feeds it into the within-tier score.
- ProviderSettingsViewModel + ExtensionPage.xaml: a Lower/Normal/Higher
  ComboBox per provider.
- Tests: within-tier reorder, never crosses a tier boundary, Normal is a
  no-op, applies to app items, serialization round-trip + legacy default.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the Product-Command Palette Refers to the Command Palette utility label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Command Palette Refers to the Command Palette utility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant