-
-
Notifications
You must be signed in to change notification settings - Fork 448
Do not query again when setting private field of QueryText #3503
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
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 aims to prevent duplicate Query calls when setting the QueryText property by introducing a new field (_ignoredQueryText) to act as a flag.
- Introduces _ignoredQueryText to bypass unnecessary Query calls.
- Refactors the Query method to check _ignoredQueryText and return early when appropriate.
- Replaces a direct assignment to SelectedResults with a call to BackToQueryResults for UI consistency.
Comments suppressed due to low confidence (1)
Flow.Launcher/ViewModel/MainViewModel.cs:1438
- [nitpick] The comment regarding setting _ignoredQueryText is repeated in multiple parts of the code. Consider refactoring this logic into a helper method to ensure consistency and improve maintainability.
_queryText = queryBuilderTmp.ToString();
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
🥷 Code experts: onesounds Jack251970, onesounds have most 👩💻 activity in the files. See details
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. |
📝 WalkthroughWalkthroughThe changes introduce a mechanism in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MainViewModel
participant UI
User->>UI: Interact with context menu
UI->>MainViewModel: Set SelectedResults to Results
MainViewModel->>MainViewModel: Set _ignoredQueryText to _queryText
MainViewModel->>MainViewModel: Raise OnPropertyChanged(QueryText)
MainViewModel->>MainViewModel: Query method checks _ignoredQueryText
alt _ignoredQueryText matches QueryText
MainViewModel->>MainViewModel: Clear _ignoredQueryText and skip query
else _ignoredQueryText does not match
MainViewModel->>MainViewModel: Clear _ignoredQueryText and execute query
end
Assessment against linked issues
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (8)
🔇 Additional comments (6)
✨ 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 (
|
Do not query again when setting private field of QueryText
From #3350, we use TextChanged event to invoke Query, which can cause duplicated call of Query if we use OnPropertyChange(nameof(QueryText)).
In this PR, we use
to resolve that.
Fix #3497, #3498.