-
-
Notifications
You must be signed in to change notification settings - Fork 540
Add toggle disable selection score #4234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Co-authored-by: Jack251970 <53996452+Jack251970@users.noreply.github.com>
|
🥷 Code experts: jjw24 Jack251970, jjw24 have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: ✨ Comment |
|
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughAdds 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ 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. Comment |
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.
There was a problem hiding this 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(defaulttrue) to control whether selection count contributes to ranking. - Gate selection-count score contribution in
MainViewModel.UpdateResultViewbehind 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.
There was a problem hiding this 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.
Results are currently ranked by match quality + selection frequency. This adds a toggle to rank by match quality alone, providing deterministic ordering.
Changes
UseSelectionScoreboolean (defaultstrue)useSelectionScoreanduseSelectionScoreToolTipstrings to en.xamlBehavior
Enabled (default): Match score + selection history + priority
Disabled: Match score + priority
Default maintains existing behavior for backward compatibility.
Resolve #4232