-
-
Notifications
You must be signed in to change notification settings - Fork 381
Fix result clearing for non-query calls and home page + history results page toggling #3553
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
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
This PR fixes issues with result clearing for non-query calls and improves toggling behavior on the home and history results pages.
- Updates logging and result clearing logic in ResultsViewModel and MainViewModel.
- Refactors the methods determining when to clear results based on query type.
- Updates event handling in MainWindow.xaml.cs and refines the ShowHistoryResultsForHomePage property implementation in Settings.cs.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
Flow.Launcher/ViewModel/ResultsViewModel.cs | Adds a block to clear existing results based on a flag in non-query calls. |
Flow.Launcher/ViewModel/MainViewModel.cs | Renames and refines methods for determining when to clear results, with updated logging. |
Flow.Launcher/MainWindow.xaml.cs | Changes the OnLoaded event handler from async to synchronous and adds a case for the history results toggle. |
Flow.Launcher.Infrastructure/UserSettings/Settings.cs | Refactors the ShowHistoryResultsForHomePage property to use a backing field with property change notification. |
Comments suppressed due to low confidence (1)
Flow.Launcher.Infrastructure/UserSettings/Settings.cs:176
- Consider making the backing field '_showHistoryResultsForHomePage' private (e.g., private bool _showHistoryResultsForHomePage) to follow standard naming conventions and avoid exposing internal state.
public bool _showHistoryResultsForHomePage { get; set; } = false;
This comment has been minimized.
This comment has been minimized.
🥷 Code experts: Jack251970, onesounds Jack251970, onesounds 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: To learn more about /:\ gitStream - Visit our Docs |
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
1 similar comment
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughThis change refactors how the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Settings
participant MainWindow
participant MainViewModel
participant ResultsViewModel
User->>Settings: Toggle ShowHistoryResultsForHomePage
Settings-->>MainWindow: PropertyChanged event (ShowHistoryResultsForHomePage)
MainWindow->>MainViewModel: QueryResults() (if query is empty and results selected)
MainViewModel->>ResultsViewModel: Update results (may clear based on new logic)
ResultsViewModel->>ResultsViewModel: Log if results are cleared
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ Context from checks skipped due to timeout of 90000ms (4)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
Flow.Launcher.Infrastructure/UserSettings/Settings.cs
(1 hunks)Flow.Launcher/MainWindow.xaml.cs
(2 hunks)Flow.Launcher/ViewModel/MainViewModel.cs
(9 hunks)Flow.Launcher/ViewModel/ResultsViewModel.cs
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
Flow.Launcher/ViewModel/MainViewModel.cs (4)
Flow.Launcher.Plugin/Query.cs (1)
Query
(8-102)Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs (1)
LogDebug
(255-255)Flow.Launcher.Core/Plugin/PluginManager.cs (3)
ICollection
(267-279)ICollection
(281-284)PluginPair
(380-383)Flow.Launcher.Infrastructure/UserSettings/Settings.cs (1)
Settings
(16-485)
🪛 GitHub Actions: Check Spelling
Flow.Launcher/MainWindow.xaml.cs
[warning] 61-61: WMP
is not a recognized word. (unrecognized-spelling)
[warning] 82-82: Ioc
is not a recognized word. (unrecognized-spelling)
[warning] 83-83: Ioc
is not a recognized word. (unrecognized-spelling)
[warning] 84-84: Ioc
is not a recognized word. (unrecognized-spelling)
[warning] 111-111: Wnd
is not a recognized word. (unrecognized-spelling)
[warning] 336-336: Wnd
is not a recognized word. (unrecognized-spelling)
[warning] 460-460: VSTHRD
is not a recognized word. (unrecognized-spelling)
[warning] 475-475: VSTHRD
is not a recognized word. (unrecognized-spelling)
[warning] 487-487: VSTHRD
is not a recognized word. (unrecognized-spelling)
[warning] 491-491: Wnd
is not a recognized word. (unrecognized-spelling)
[warning] 493-493: Wnd
is not a recognized word. (unrecognized-spelling)
[warning] 564-564: WMP
is not a recognized word. (unrecognized-spelling)
[warning] 566-566: WMP
is not a recognized word. (unrecognized-spelling)
[warning] 567-567: WMP
is not a recognized word. (unrecognized-spelling)
[warning] 648-648: gamemode
is not a recognized word. (unrecognized-spelling)
[warning] 649-649: gamemode
is not a recognized word. (unrecognized-spelling)
[warning] 652-652: gamemode
is not a recognized word. (unrecognized-spelling)
[warning] 655-655: positionreset
is not a recognized word. (unrecognized-spelling)
[warning] 658-658: positionreset
is not a recognized word. (unrecognized-spelling)
[warning] 674-674: gamemode
is not a recognized word. (unrecognized-spelling)
[warning] 675-675: positionreset
is not a recognized word. (unrecognized-spelling)
[warning] 680-680: positionreset
is not a recognized word. (unrecognized-spelling)
[warning] 790-790: XRatio
is not a recognized word. (unrecognized-spelling)
[warning] 791-791: YRatio
is not a recognized word. (unrecognized-spelling)
[warning] 1005-1005: clocksb
is not a recognized word. (unrecognized-spelling)
[warning] 1006-1006: clocksb
is not a recognized word. (unrecognized-spelling)
[warning] 1007-1007: iconsb
is not a recognized word. (unrecognized-spelling)
[warning] 1008-1008: iconsb
is not a recognized word. (unrecognized-spelling)
[warning] 1013-1013: clocksb
is not a recognized word. (unrecognized-spelling)
[warning] 1014-1014: iconsb
is not a recognized word. (unrecognized-spelling)
Flow.Launcher/ViewModel/MainViewModel.cs
[warning] 72-72: Ioc
is not a recognized word. (unrecognized-spelling)
[warning] 1727-1727: VSTHRD
is not a recognized word. (unrecognized-spelling)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: gitStream workflow automation
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: build
🔇 Additional comments (6)
Flow.Launcher/ViewModel/ResultsViewModel.cs (1)
238-241
: Enhanced debugging with clear log message.Adding debug logging when results are cleared provides valuable diagnostic information that will help track result clearing behavior, making it easier to understand when and why results are being refreshed.
Flow.Launcher/MainWindow.xaml.cs (1)
278-278
: Good addition of ShowHistoryResultsForHomePage to the settings property changed handler.This change ensures that the UI properly reacts to changes in the history results setting the same way it does for the home page setting, maintaining consistent behavior when either setting is toggled.
Flow.Launcher/ViewModel/MainViewModel.cs (4)
1341-1345
: Good conditional clearing of results for non-query scenarios.This code properly checks if results should be cleared when no query is running by calling the new
ShouldClearExistingResultsForNonQuery
method. Adding debug logging also helps with diagnostics.
1565-1582
: Improved method naming for clarity.Renaming the method to
ShouldClearExistingResultsForQuery
more accurately describes its purpose. The addition of debug logging helps track when results are being cleared.
1584-1602
: Well-implemented method for handling non-query result clearing logic.This new method nicely encapsulates the logic for determining when to clear results in non-query scenarios. It checks both the setting state and the plugin collection state to make the correct decision.
1313-1313
: Simplified debug logging for plugin list.Good simplification of the debug logging for valid plugins by inlining the plugin name selection.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. Forbidden patterns 🙅 (1)In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves. These forbidden patterns matched content: s.b. workaround(s)
If the flagged items are 🤯 false positivesIf items relate to a ...
|
Changes:
Tested:
Follow on from #3524