-
-
Notifications
You must be signed in to change notification settings - Fork 364
Support filtering dotnet, python, node.js, executable plugins #3494
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
🚨 gitStream Monthly Automation Limit Reached 🚨 Your organization has exceeded the number of pull requests allowed for automation with gitStream. To continue automating your PR workflows and unlock additional features, please contact LinearB. |
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 extends the plugin filtering functionality by adding support for filtering dotnet, python, node.js, and executable plugins so that users without specific environments (like Python) can avoid installing them unnecessarily.
- Converted auto-properties to properties with change notification in the view model
- Updated the UI logic to refresh the plugin list when any filter property changes
- Extended AllowedLanguage helper methods for Python, Node.js, and executable languages
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml.cs | Updated the property change handler to refresh the view when filter or language display properties change |
Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs | Refactored filter properties with notifications and added language-based filtering in SatisfiesFilter |
Flow.Launcher.Plugin/AllowedLanguage.cs | Introduced helper methods for Python, Node.js, and executable language checks and simplified IsAllowed |
Files not reviewed (1)
- Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml: Language not supported
This comment has been minimized.
This comment has been minimized.
🥷 Code experts: Yusyuriv, onesounds Jack251970 has 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 |
📝 WalkthroughWalkthroughThis update introduces language-based filtering to the plugin store interface. The Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SettingsPanePluginStoreViewModel
participant PluginStoreCollectionView
User->>SettingsPanePluginStoreViewModel: Change filter text or toggle language checkboxes
SettingsPanePluginStoreViewModel->>SettingsPanePluginStoreViewModel: Update property, trigger OnPropertyChanged
SettingsPanePluginStoreViewModel->>PluginStoreCollectionView: Refresh view
PluginStoreCollectionView->>SettingsPanePluginStoreViewModel: Call SatisfiesFilter for each plugin
SettingsPanePluginStoreViewModel->>SettingsPanePluginStoreViewModel: Check language filter and text filter
PluginStoreCollectionView->>User: Display filtered plugin list
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
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:
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: 0
🧹 Nitpick comments (1)
Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs (1)
99-125
: Consider simplifying the SatisfiesFilter methodThe language filtering logic is implemented correctly, but could be made more concise.
Consider refactoring for better readability:
public bool SatisfiesFilter(PluginStoreItemViewModel plugin) { - // Check plugin language - var pluginShown = false; - if (AllowedLanguage.IsDotNet(plugin.Language)) - { - pluginShown = ShowDotNet; - } - else if (AllowedLanguage.IsPython(plugin.Language)) - { - pluginShown = ShowPython; - } - else if (AllowedLanguage.IsNodeJs(plugin.Language)) - { - pluginShown = ShowNodeJs; - } - else if (AllowedLanguage.IsExecutable(plugin.Language)) - { - pluginShown = ShowExecutable; - } - if (!pluginShown) return false; - - // Check plugin name & description + // Check plugin language + bool languageShown = + (AllowedLanguage.IsDotNet(plugin.Language) && ShowDotNet) || + (AllowedLanguage.IsPython(plugin.Language) && ShowPython) || + (AllowedLanguage.IsNodeJs(plugin.Language) && ShowNodeJs) || + (AllowedLanguage.IsExecutable(plugin.Language) && ShowExecutable); + + if (!languageShown) return false; + + // Check plugin name & description return string.IsNullOrEmpty(FilterText) || App.API.FuzzySearch(FilterText, plugin.Name).IsSearchPrecisionScoreMet() || App.API.FuzzySearch(FilterText, plugin.Description).IsSearchPrecisionScoreMet(); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Flow.Launcher/Images/EXE.png
is excluded by!**/*.png
📒 Files selected for processing (4)
Flow.Launcher.Plugin/AllowedLanguage.cs
(2 hunks)Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs
(2 hunks)Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml
(2 hunks)Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml.cs
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml.cs (1)
Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs (1)
SettingsPanePluginStoreViewModel
(10-126)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: gitStream.cm
- GitHub Check: build
🔇 Additional comments (10)
Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml.cs (1)
29-38
: LGTM: Property change handling implemented correctlyThe switch statement has been properly implemented to handle changes to all filter properties. This ensures the plugin list is refreshed whenever any filter criteria changes, providing immediate visual feedback to users.
Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml (2)
30-31
: LGTM: Grid layout improvementsThe column definition changes from equal widths to Auto/* provide better responsiveness, allowing the title to take its natural width while giving the rest of the space to the filter controls.
54-140
: LGTM: Filter controls UI implementationThe implementation of the language filter checkboxes is well-structured and consistent with the application's design language. The controls are properly arranged in a horizontal StackPanel with appropriate spacing and alignment.
Flow.Launcher.Plugin/AllowedLanguage.cs (5)
67-69
: LGTM: Minor formatting changesThe formatting changes to the IsDotNet method maintain consistency with the newly added methods.
71-80
: LGTM: Well-implemented Python language checkThe IsPython method correctly checks for both Python and PythonV2 language variants using case-insensitive comparison.
82-93
: LGTM: Comprehensive Node.js language detectionThe IsNodeJs method effectively covers all Node.js-based language variants, including TypeScript and JavaScript (with their V2 variants).
95-104
: LGTM: Executable language check implementationThe IsExecutable method properly identifies both Executable and ExecutableV2 language variants using case-insensitive comparison.
113-116
: LGTM: Improved IsAllowed methodThe refactored IsAllowed method leverages the helper methods, improving code organization and maintainability by centralizing language identification logic.
Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs (2)
12-24
: LGTM: Proper property implementation with notificationThe FilterText property has been correctly implemented with a backing field and change notification.
26-80
: LGTM: Well-implemented language filter propertiesThe four new boolean properties (ShowDotNet, ShowPython, ShowNodeJs, ShowExecutable) are properly implemented with backing fields and change notification, enabling the language filtering functionality.
📝 WalkthroughWalkthroughThis update introduces language-based filtering to the plugin store within the application. The Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI (SettingsPanePluginStore.xaml)
participant ViewModel
participant AllowedLanguage
User->>UI (SettingsPanePluginStore.xaml): Toggle language checkbox or update filter text
UI (SettingsPanePluginStore.xaml)->>ViewModel: Update property (ShowDotNet, ShowPython, etc. or FilterText)
ViewModel->>ViewModel: OnPropertyChanged triggers
ViewModel->>UI (SettingsPanePluginStore.xaml.cs): PropertyChanged event
UI (SettingsPanePluginStore.xaml.cs)->>UI (SettingsPanePluginStore.xaml.cs): Refresh PluginStoreCollectionView
ViewModel->>AllowedLanguage: Check plugin language group (IsPython, IsNodeJs, etc.)
AllowedLanguage-->>ViewModel: Return boolean for language match
ViewModel->>UI (SettingsPanePluginStore.xaml): Display filtered plugin list
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
🧰 Additional context used🧬 Code Graph Analysis (2)Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml.cs (1)
Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (9)
✨ 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:
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 (
|
@Jack251970 Done. Test it. |
This comment has been minimized.
This comment has been minimized.
Tested and it works well. I have adjusted little for the button & menu flyout. |
@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 ...
|
Support filtering plugin languages
If users have not installed python environment, they can filter out python language so that they do not need to install python environment during next startup.
Test
To onesounds
I am not sure if this UI is good, feel free to change its design.