Skip to content

Conversation

@Jack251970
Copy link
Member

Results are currently ranked by match quality + selection frequency. This adds a toggle to rank by match quality alone, providing deterministic ordering.

Changes

  • Settings: Added UseSelectionScore boolean (defaults true)
  • Ranking logic: Conditionally apply selection count based on setting
    // Before
    if (result.AddSelectedCount)
    
    // After  
    if (result.AddSelectedCount && Settings.UseSelectionScore)
  • UI: Toggle switch in General settings between "Query Search Precision" and "Last Query Mode"
  • Localization: Added useSelectionScore and useSelectionScoreToolTip strings to en.xaml

Behavior

Enabled (default): Match score + selection history + priority
Disabled: Match score + priority

Default maintains existing behavior for backward compatibility.

Resolve #4232

Copilot AI and others added 2 commits January 25, 2026 07:34
Co-authored-by: Jack251970 <53996452+Jack251970@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 25, 2026 07:58
@github-actions github-actions bot added this to the 2.1.0 milestone Jan 25, 2026
@gitstream-cm
Copy link

gitstream-cm bot commented Jan 25, 2026

🥷 Code experts: jjw24

Jack251970, jjw24 have most 👩‍💻 activity in the files.
Jack251970, jjw24 have most 🧠 knowledge in the files.

See details

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Activity based on git-commit:

Jack251970 jjw24
JAN
DEC
NOV
OCT 31 additions & 52 deletions
SEP 2 additions & 3 deletions
AUG 699 additions & 0 deletions

Knowledge based on git-blame:
jjw24: 95%
Jack251970: 4%

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

Jack251970 jjw24
JAN
DEC
NOV
OCT 13 additions & 10 deletions
SEP 14 additions & 6 deletions
AUG 663 additions & 0 deletions

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Activity based on git-commit:

Jack251970 jjw24
JAN
DEC
NOV
OCT 405 additions & 348 deletions
SEP 2 additions & 2 deletions
AUG 538 additions & 0 deletions

Knowledge based on git-blame:
Jack251970: 95%

Flow.Launcher/ViewModel/MainViewModel.cs

Activity based on git-commit:

Jack251970 jjw24
JAN
DEC
NOV 106 additions & 94 deletions
OCT 125 additions & 88 deletions
SEP 13 additions & 15 deletions
AUG 4581 additions & 0 deletions

Knowledge based on git-blame:
Jack251970: 98%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@gitstream-cm
Copy link

gitstream-cm bot commented Jan 25, 2026

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Jan 25, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Walkthrough

Adds a toggleable setting to disable selection-based scoring: new Settings property, two localization strings, ToggleSwitch controls in General settings, and a gate in result-ranking logic to skip applying selection score when the setting is off.

Changes

Cohort / File(s) Summary
Settings Configuration
Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Added UseSelectionScore boolean property with default true.
Localization Resources
Flow.Launcher/Languages/en.xaml
Added useSelectionScore and useSelectionScoreToolTip strings for label and tooltip.
UI Controls
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
Inserted ToggleSwitch bound to Settings.UseSelectionScore (OffContent=disable, OnContent=enable) in two locations of the General settings pane.
Result Ranking Logic
Flow.Launcher/ViewModel/MainViewModel.cs
UpdateResultView now requires both AddSelectedCount and Settings.UseSelectionScore to apply selection-based score increments.

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant UI as Settings UI
  participant Store as Settings Store
  participant VM as MainViewModel
  participant View as Results View

  User->>UI: Toggle "Use Selection Score"
  UI->>Store: Persist UseSelectionScore
  Note right of Store: Setting saved
  View->>VM: Request results update (query)
  VM->>Store: Read UseSelectionScore
  alt UseSelectionScore = true and AddSelectedCount = true
    VM->>VM: Apply selection-based score increments
  else
    VM->>VM: Apply only match/priority scoring
  end
  VM->>View: Return ranked results
  View->>User: Display results
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • jjw24
  • onesounds
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a toggle to disable selection score in result ranking.
Description check ✅ Passed The description provides clear context about the feature, explaining the problem, solution, and behavior changes with code examples.
Linked Issues check ✅ Passed The PR fully implements the requirements from issue #4232: a toggle switch UI setting and conditional exclusion of selection frequency from ranking.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the selection score toggle feature and localization; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Moved the "Use Selection Score" settings card in SettingsPaneGeneral.xaml to appear before the "Query Search Precision" card for improved UI organization. No functional changes were made.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a user-facing setting to optionally exclude selection-history weighting from result ranking, so results can be ranked without selection frequency influencing score.

Changes:

  • Add Settings.UseSelectionScore (default true) to control whether selection count contributes to ranking.
  • Gate selection-count score contribution in MainViewModel.UpdateResultView behind the new setting.
  • Add a General Settings toggle and corresponding English localization strings.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
Flow.Launcher/ViewModel/MainViewModel.cs Conditionally applies selection-count score contribution based on Settings.UseSelectionScore.
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml Adds a toggle switch in General settings bound to Settings.UseSelectionScore.
Flow.Launcher/Languages/en.xaml Adds useSelectionScore and useSelectionScoreToolTip strings for the new toggle.
Flow.Launcher.Infrastructure/UserSettings/Settings.cs Introduces the persisted UseSelectionScore setting with a default of true.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml`:
- Around line 233-242: The two new localization keys useSelectionScore and
useSelectionScoreToolTip referenced in SettingsPaneGeneral.xaml (ToggleSwitch
Description/Header) are only present in en.xaml; add these keys with appropriate
translations to every language resource file (all non-English .xaml files) so
resource lookups succeed; update each language resource dictionary to include
entries for "useSelectionScore" and "useSelectionScoreToolTip" (matching the key
names used in SettingsPaneGeneral.xaml) with localized text, and ensure the
files remain valid XAML resource dictionaries and compile without errors.

@Jack251970 Jack251970 enabled auto-merge January 25, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 min review enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Support disabling selection score when ranking results

2 participants