-
-
Notifications
You must be signed in to change notification settings - Fork 395
IPluginHotkey Interface for Global Hotkey & Window Hotkey / Support Rename File & Folder by Hotkey or Context Menu #3770
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?
IPluginHotkey Interface for Global Hotkey & Window Hotkey / Support Rename File & Folder by Hotkey or Context Menu #3770
Conversation
🥷 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:
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:
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 |
@onesounds I wonder if you can help me with UI improvement especially with plugin hotkey setting UI. Thanks! ![]() |
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 (3)
Flow.Launcher/Helper/HotKeyMapper.cs (2)
45-144
: Consider breaking down this large initialization method.While the method is well-organized, its ~100 lines suggest it could benefit from refactoring into smaller, focused methods for each hotkey category (e.g.,
InitializeSystemHotkeys()
,InitializeFlowLauncherHotkeys()
,InitializePluginHotkeys()
). This would improve maintainability and testability.private static void InitializeRegisteredHotkeys() { - // Fixed hotkeys & Editable hotkeys - var list = new List<RegisteredHotkeyData> - { - // System default window hotkeys - new(RegisteredHotkeyType.Up, HotkeyType.SearchWindow, "Up", "HotkeyLeftRightDesc", null), - // ... (all other hotkey definitions) - }; + var list = new List<RegisteredHotkeyData>(); + + list.AddRange(InitializeSystemDefaultHotkeys()); + list.AddRange(InitializeFlowLauncherHotkeys()); + list.AddRange(InitializeResultModifierHotkeys()); + list.AddRange(InitializeCustomQueryHotkeys()); + list.AddRange(InitializePluginHotkeys());
23-826
: Consider architectural improvements for this large coordinator class.While the centralized hotkey management is beneficial, this 800+ line class handles multiple concerns (registration, event handling, UI commands, legacy support). Consider extracting some responsibilities into separate classes (e.g.,
HotkeyRegistrationService
,PluginHotkeyManager
) while keeping this as a coordinator.Flow.Launcher/Resources/Pages/WelcomePage3.xaml (1)
109-163
: All DynamicResource Keys Are Defined
Verified thatHotkeySelectLastResult
,HotkeyRequery
,ToggleGameModeHotkey
,CopyFilePathHotkey
,QuickWidthHotkey
, andQuickHeightHotkey
are present in everyFlow.Launcher/Languages/*.xaml
resource dictionary (the project doesn’t use.resx
files for localization).Please also consider:
- Grouping or collapsing related hotkey cards (e.g., basic vs. advanced) to prevent overwhelming new users
- Reviewing the new combinations (e.g., Ctrl+Shift+C) for potential conflicts with common OS or application shortcuts
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
Flow.Launcher.Infrastructure/UserSettings/Settings.cs
(3 hunks)Flow.Launcher/Helper/HotKeyMapper.cs
(4 hunks)Flow.Launcher/Resources/Pages/WelcomePage3.xaml
(1 hunks)Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml
(5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:12:13.386Z
Learning: In Flow.Launcher, hotkey styling is implemented with a two-component structure: a Border element with style `ItemHotkeyBGStyle` that provides background and border styling, containing a TextBlock with style `ItemHotkeyStyle` that handles the text styling.
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.
Learnt from: Koisu-unavailable
PR: Flow-Launcher/Flow.Launcher#3770
File: Flow.Launcher/ViewModel/MainViewModel.cs:0-0
Timestamp: 2025-06-24T19:06:48.344Z
Learning: In Flow.Launcher's Explorer plugin results, the SubTitle property always contains the directory containing the file. For file results, Title contains the filename and SubTitle contains the parent directory. For directory results, SubTitle contains the directory path itself.
Flow.Launcher/Resources/Pages/WelcomePage3.xaml (1)
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:12:13.386Z
Learning: In Flow.Launcher, hotkey styling is implemented with a two-component structure: a Border element with style `ItemHotkeyBGStyle` that provides background and border styling, containing a TextBlock with style `ItemHotkeyStyle` that handles the text styling.
Flow.Launcher/Helper/HotKeyMapper.cs (3)
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:12:13.386Z
Learning: In Flow.Launcher, hotkey styling is implemented with a two-component structure: a Border element with style `ItemHotkeyBGStyle` that provides background and border styling, containing a TextBlock with style `ItemHotkeyStyle` that handles the text styling.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.
Flow.Launcher.Infrastructure/UserSettings/Settings.cs (3)
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:12:13.386Z
Learning: In Flow.Launcher, hotkey styling is implemented with a two-component structure: a Border element with style `ItemHotkeyBGStyle` that provides background and border styling, containing a TextBlock with style `ItemHotkeyStyle` that handles the text styling.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.
🪛 GitHub Actions: Check Spelling
Flow.Launcher/Helper/HotKeyMapper.cs
[warning] 419-419: Spell check warning: LWin
is not a recognized word. (unrecognized-spelling)
[warning] 419-419: Spell check warning: RWin
is not a recognized word. (unrecognized-spelling)
[warning] 517-517: Spell check warning: LWin
is not a recognized word. (unrecognized-spelling)
[warning] 517-517: Spell check warning: RWin
is not a recognized word. (unrecognized-spelling)
[warning] 683-683: Spell check warning: nullability
is not a recognized word. (unrecognized-spelling)
[warning] 16-16: Spell check warning: NHotkey
is not a recognized word. (unrecognized-spelling)
[warning] 670-670: Spell check warning: nullability
is not a recognized word. (unrecognized-spelling)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
🔇 Additional comments (12)
Flow.Launcher/Helper/HotKeyMapper.cs (5)
32-44
: LGTM! Well-structured initialization approach.The initialization properly sets up dependencies, separates concerns between legacy ActionContext hotkeys and the new registered hotkey system, and establishes event handlers for dynamic hotkey management.
150-308
: Excellent event-driven hotkey management.The event handlers comprehensively manage hotkey changes across different sources (settings, custom plugin hotkeys, plugin manager). The dynamic registration/unregistration ensures hotkeys stay synchronized with configuration changes.
466-509
: Robust window hotkey registration with good conflict detection.The implementation properly checks for existing hotkey bindings and includes special handling for ActionContext compatibility. The error handling provides both logging and user feedback.
641-697
: Well-implemented command handlers with proper state validation.The commands include comprehensive state checks (plugin enabled/modified state, hotkey ignore conditions) and handle different hotkey types appropriately. The fallback to ActionContext events maintains backward compatibility.
724-794
: Good deprecation strategy for ActionContext support.The obsolete ActionContext functionality is properly marked with clear deprecation messages pointing to
IPluginHotkey
. Maintaining backward compatibility while encouraging migration to the new interface is the right approach.Flow.Launcher.Infrastructure/UserSettings/Settings.cs (3)
42-268
: Excellent property change notification implementation.The conversion of hotkey properties to full properties with change notifications enables the new event-driven hotkey management system. The consistent pattern (backing field, value comparison, OnPropertyChanged) follows proper MVVM practices and allows
HotKeyMapper
to respond dynamically to setting changes.
573-646
: Good modernization with target-typed new expressions.The simplified collection initialization using target-typed
new()
expressions reduces verbosity while maintaining type safety. This is a clean code improvement.
649-649
: Architectural improvement: delegated hotkey management.Changing
RegisteredHotkeys
from a computed property to a simpleObservableCollection
properly delegates hotkey management toHotKeyMapper
while maintaining UI binding capabilities. This separation of concerns improves the architecture.Flow.Launcher/Resources/Pages/WelcomePage3.xaml (4)
86-92
: LGTM: Consistent title update for context menu hotkey.The title change from "HotkeyShiftEnterDesc" to "OpenContextMenuHotkey" aligns with the new hotkey naming conventions while maintaining the same key combination.
94-100
: LGTM: Hotkey change from Ctrl+Enter to F5 for plugin reload.The change from "CTRL+ENTER" to "F5" for the reload plugin hotkey is more intuitive and follows common application conventions where F5 is used for refresh/reload operations.
102-108
: LGTM: Clear hotkey change for first result selection.The change from "CTRL+SHIFT+ENTER" to "Alt+Home" for selecting the first result is more intuitive and follows navigation conventions where Home/End keys are used for first/last positioning.
141-163
: Good UX pattern for related hotkey pairs.The QuickWidthHotkey and QuickHeightHotkey cards effectively demonstrate the pattern of showing multiple related hotkeys in a single card. The margin spacing between the hotkey displays provides good visual separation.
It looks generally fine. I think just having a title in the plugin list section should be enough. I’ll handle that part in a separate PR after this one is merged. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.Infrastructure/DialogJump/DialogJump.cs (1)
700-700
: Fix typo in log messageThere's a typo in the log message that was flagged by the pipeline spelling check.
- Log.Debug(ClassName, $"Destory dialog: {hwnd}"); + Log.Debug(ClassName, $"Destroy dialog: {hwnd}");
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
Flow.Launcher.Core/Plugin/PluginManager.cs
(8 hunks)Flow.Launcher.Core/Resource/Internationalization.cs
(1 hunks)Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs
(2 hunks)Flow.Launcher.Infrastructure/Hotkey/RegisteredHotkeyData.cs
(7 hunks)Flow.Launcher.Infrastructure/UserSettings/Settings.cs
(4 hunks)Flow.Launcher/Helper/HotKeyMapper.cs
(4 hunks)Flow.Launcher/HotkeyControl.xaml.cs
(4 hunks)Flow.Launcher/Languages/en.xaml
(1 hunks)Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs
(1 hunks)Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml
(5 hunks)Flow.Launcher/ViewModel/MainViewModel.cs
(2 hunks)Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs
(2 hunks)Plugins/Flow.Launcher.Plugin.Explorer/Helper/RenameThing.cs
(1 hunks)Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
(2 hunks)Plugins/Flow.Launcher.Plugin.Explorer/Main.cs
(3 hunks)Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs
(6 hunks)Plugins/Flow.Launcher.Plugin.Program/Main.cs
(2 hunks)Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (13)
- Flow.Launcher.Core/Resource/Internationalization.cs
- Flow.Launcher/Languages/en.xaml
- Flow.Launcher/ViewModel/MainViewModel.cs
- Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs
- Plugins/Flow.Launcher.Plugin.Program/Main.cs
- Flow.Launcher/HotkeyControl.xaml.cs
- Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs
- Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
- Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml
- Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs
- Plugins/Flow.Launcher.Plugin.Explorer/Helper/RenameThing.cs
- Flow.Launcher.Infrastructure/Hotkey/RegisteredHotkeyData.cs
- Flow.Launcher.Core/Plugin/PluginManager.cs
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:12:13.386Z
Learning: In Flow.Launcher, hotkey styling is implemented with a two-component structure: a Border element with style `ItemHotkeyBGStyle` that provides background and border styling, containing a TextBlock with style `ItemHotkeyStyle` that handles the text styling.
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.
Learnt from: Koisu-unavailable
PR: Flow-Launcher/Flow.Launcher#3770
File: Flow.Launcher/ViewModel/MainViewModel.cs:0-0
Timestamp: 2025-06-24T19:06:48.344Z
Learning: In Flow.Launcher's Explorer plugin results, the SubTitle property always contains the directory containing the file. For file results, Title contains the filename and SubTitle contains the parent directory. For directory results, SubTitle contains the directory path itself.
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (2)
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Plugins/Flow.Launcher.Plugin.Explorer/Main.cs (9)
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:12:13.386Z
Learning: In Flow.Launcher, hotkey styling is implemented with a two-component structure: a Border element with style `ItemHotkeyBGStyle` that provides background and border styling, containing a TextBlock with style `ItemHotkeyStyle` that handles the text styling.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.
Learnt from: Koisu-unavailable
PR: Flow-Launcher/Flow.Launcher#3770
File: Flow.Launcher/ViewModel/MainViewModel.cs:0-0
Timestamp: 2025-06-24T19:06:48.344Z
Learning: In Flow.Launcher's Explorer plugin results, the SubTitle property always contains the directory containing the file. For file results, Title contains the filename and SubTitle contains the parent directory. For directory results, SubTitle contains the directory path itself.
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.
Learnt from: taooceros
PR: Flow-Launcher/Flow.Launcher#2616
File: Flow.Launcher/Flow.Launcher.csproj:7-7
Timestamp: 2024-10-08T15:52:58.573Z
Learning: In the Flow Launcher project, the version number in the `Flow.Launcher.csproj` file is dynamically updated during the CI/CD process.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3672
File: Flow.Launcher/MainWindow.xaml.cs:318-318
Timestamp: 2025-06-08T14:12:12.842Z
Learning: In Flow.Launcher, the App.NotifyIcon static property is initialized in the App class before MainWindow creation, so null checks are not needed when accessing App.NotifyIcon in MainWindow lifecycle methods.
Learnt from: jjw24
PR: Flow-Launcher/Flow.Launcher#2448
File: Plugins/Flow.Launcher.Plugin.Sys/ThemeSelector.cs:16-20
Timestamp: 2025-01-18T10:10:18.414Z
Learning: In Flow Launcher's plugin system, the PluginInitContext parameter passed to plugin constructors is guaranteed to be non-null by the plugin initialization system, making null checks unnecessary.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3672
File: Flow.Launcher/MainWindow.xaml.cs:244-247
Timestamp: 2025-06-08T14:12:21.348Z
Learning: In Flow.Launcher, App.NotifyIcon is created before MainWindow creation, so null checks for App.NotifyIcon are not necessary when accessing it from MainWindow code.
Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs (6)
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:12:13.386Z
Learning: In Flow.Launcher, hotkey styling is implemented with a two-component structure: a Border element with style `ItemHotkeyBGStyle` that provides background and border styling, containing a TextBlock with style `ItemHotkeyStyle` that handles the text styling.
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3672
File: Flow.Launcher/MainWindow.xaml.cs:244-247
Timestamp: 2025-06-08T14:12:21.348Z
Learning: In Flow.Launcher, App.NotifyIcon is created before MainWindow creation, so null checks for App.NotifyIcon are not necessary when accessing it from MainWindow code.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3672
File: Flow.Launcher/MainWindow.xaml.cs:318-318
Timestamp: 2025-06-08T14:12:12.842Z
Learning: In Flow.Launcher, the App.NotifyIcon static property is initialized in the App class before MainWindow creation, so null checks are not needed when accessing App.NotifyIcon in MainWindow lifecycle methods.
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#0
File: :0-0
Timestamp: 2025-04-23T15:14:49.986Z
Learning: In WPF applications like Flow.Launcher, font styling should be applied using implicit styles instead of setting the FontFamily property on individual controls. Define implicit styles in a ResourceDictionary using <Style TargetType="{x:Type Button}"> format and merge it into App.xaml, which automatically applies the font to all instances of the control type while still allowing explicit overrides where needed.
Flow.Launcher/Helper/HotKeyMapper.cs (3)
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:12:13.386Z
Learning: In Flow.Launcher, hotkey styling is implemented with a two-component structure: a Border element with style `ItemHotkeyBGStyle` that provides background and border styling, containing a TextBlock with style `ItemHotkeyStyle` that handles the text styling.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.
Flow.Launcher.Infrastructure/UserSettings/Settings.cs (3)
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#3394
File: Flow.Launcher/Themes/Darker Glass.xaml:134-141
Timestamp: 2025-03-28T21:12:13.386Z
Learning: In Flow.Launcher, hotkey styling is implemented with a two-component structure: a Border element with style `ItemHotkeyBGStyle` that provides background and border styling, containing a TextBlock with style `ItemHotkeyStyle` that handles the text styling.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.
🪛 GitHub Check: Check Spelling
Plugins/Flow.Launcher.Plugin.Explorer/Main.cs
[failure] 21-21:
Settings Settings
matches a line_forbidden.patterns entry: \s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s
. (forbidden-pattern)
🪛 GitHub Actions: Check Spelling
Plugins/Flow.Launcher.Plugin.Explorer/Main.cs
[warning] 138-138: opencontainingfolder
is not a recognized word. (unrecognized-spelling)
[warning] 139-139: opencontainingfolder
is not a recognized word. (unrecognized-spelling)
[warning] 227-227: opendir
is not a recognized word. (unrecognized-spelling)
[error] 21-21: Settings Settings
matches a line_forbidden.patterns entry: \s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s
. (forbidden-pattern)
Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs
[warning] 165-165: PInvoke
is not a recognized word. (unrecognized-spelling)
[warning] 170-170: PInvoke
is not a recognized word. (unrecognized-spelling)
[warning] 175-175: PInvoke
is not a recognized word. (unrecognized-spelling)
[warning] 180-180: PInvoke
is not a recognized word. (unrecognized-spelling)
[warning] 321-321: Wnd
is not a recognized word. (unrecognized-spelling)
[warning] 160-160: PInvoke
is not a recognized word. (unrecognized-spelling)
[warning] 314-314: Wnd
is not a recognized word. (unrecognized-spelling)
[warning] 700-700: Destory
is not a recognized word. (unrecognized-spelling)
Flow.Launcher/Helper/HotKeyMapper.cs
[warning] 432-432: LWin
is not a recognized word. (unrecognized-spelling)
[warning] 432-432: RWin
is not a recognized word. (unrecognized-spelling)
[warning] 530-530: LWin
is not a recognized word. (unrecognized-spelling)
[warning] 530-530: RWin
is not a recognized word. (unrecognized-spelling)
[warning] 696-696: nullability
is not a recognized word. (unrecognized-spelling)
[warning] 17-17: NHotkey
is not a recognized word. (unrecognized-spelling)
[warning] 683-683: nullability
is not a recognized word. (unrecognized-spelling)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: gitStream.cm
🔇 Additional comments (23)
Flow.Launcher.Infrastructure/UserSettings/Settings.cs (4)
74-86
: LGTM: Hotkey property refactoring follows consistent patternThe conversion from auto-implemented to full properties with backing fields and
OnPropertyChanged()
calls enables proper change notification for reactive UI updates. This pattern is consistently applied across all hotkey properties.
671-673
: LGTM: Target-typed new expressions improve readabilityThe use of target-typed
new()
expressions for collection properties is a good modernization that reduces redundancy while maintaining type safety.
744-744
: LGTM: Target-typed new expression for PluginSettingsConsistent with the other collection property updates, this improves readability.
747-747
: RegisteredHotkeys population verified in HotKeyMapper
The emptyRegisteredHotkeys
initializer inSettings.cs
is intentional—all hotkey entries are added centrally inFlow.Launcher/Helper/HotKeyMapper.cs
. No further changes are required.Key locations where items are added/removed:
HotKeyMapper.InitializeRegisteredHotkeys()
– adds default and editable hotkeysCustomPluginHotkeys_CollectionChanged
handler – handles Add/Remove/Replace for custom plugin hotkeysPluginManager_PluginHotkeyChanged
handler – updates plugin window/global hotkeys- Various
NotifyCollectionChangedAction
cases – maintain_settings.RegisteredHotkeys
and callSetHotkey
/RemoveHotkey
accordinglyFlow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (1)
150-161
: LGTM: Simplified hotkey management delegationThe removal of direct
HotKeyMapper.SetHotkey
andHotKeyMapper.RemoveHotkey
calls simplifies the setter and properly delegates all dialog jump setup toDialogJump.SetupDialogJump()
. This aligns with the architectural shift to centralized hotkey management and command-based hotkey handling.Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs (4)
15-15
: LGTM: Added RelayCommand support for command-based hotkey handlingThe addition of
CommunityToolkit.Mvvm.Input
import enables the new command-based hotkey architecture, replacing the previous event-driven approach.
456-478
: LGTM: Well-implemented command-based hotkey systemThe new
DialogJumpCommand
properly implements the command pattern:
- Lazy initialization of the RelayCommand
- Proper guard clause checking
EnableDialogJump
setting- Asynchronous execution with exception handling
- Clean separation of concerns
This design aligns well with the architectural shift to centralized, command-based hotkey management.
160-180
: Pipeline spelling warnings for PInvoke are false positivesThe pipeline flagged "PInvoke" as an unrecognized word, but this is a legitimate API name in the Windows SDK. These warnings can be safely ignored as they represent proper Win32 API usage.
314-321
: Pipeline spelling warnings for "Wnd" are false positivesThe pipeline flagged "Wnd" as unrecognized, but this is part of standard Win32 API naming conventions (e.g.,
EnumWindows
,hWnd
). These warnings can be safely ignored.Plugins/Flow.Launcher.Plugin.Explorer/Main.cs (6)
1-23
: LGTM! Clean interface implementation and imports.The addition of the
IPluginHotkey
interface and supporting imports are well-structured. TheClassName
field for logging follows good practices.
131-133
: LGTM! Correct interface implementation.The method signature correctly implements the
IPluginHotkey
interface requirement.
135-172
: LGTM! Well-implemented open containing folder hotkey.The implementation correctly handles both files and directories with appropriate error handling, logging, and user feedback. The type checking and return values are appropriate.
173-198
: LGTM! Proper context menu hotkey implementation.The implementation correctly excludes Volume types and includes appropriate error handling. Returning
false
is correct since showing a context menu shouldn't hide the main window.
199-236
: LGTM! Correct run as administrator implementation.The implementation properly handles elevated execution for files and normal opening for directories, with consistent error handling and appropriate return values.
237-272
: LGTM! Excellent rename hotkey implementation.The implementation uses the standard F2 hotkey and correctly handles different file system types. The use of
ShowDialog()
makes the rename operation modal, which addresses previous feedback and provides better UX by preventing multiple dialogs or conflicting actions.Flow.Launcher/Helper/HotKeyMapper.cs (8)
21-151
: LGTM! Well-architected hotkey management system.The initialization is comprehensive and well-structured, covering all hotkey types (system, Flow Launcher, custom, and plugin hotkeys). The event-driven approach and dependency injection usage are appropriate for this complex system.
157-321
: LGTM! Comprehensive event handling implementation.The event handlers properly manage hotkey lifecycle changes across all supported scenarios. The logic correctly handles collection changes and plugin hotkey updates with appropriate cleanup and registration.
387-597
: LGTM! Robust hotkey registration and removal system.The implementation provides comprehensive error handling, supports multiple hotkey managers (HotkeyManager and ChefKeysManager), and includes proper duplicate prevention. The user feedback on registration failures is excellent.
645-710
: LGTM! Well-implemented command pattern with proper state validation.The command implementations correctly validate plugin states, handle result selection, and include appropriate checks for disabled/modified plugins. The logic for invoking plugin hotkey actions is sound.
737-807
: LGTM! Excellent backward compatibility approach.The ActionContext support is properly deprecated with clear migration guidance while maintaining existing functionality. The Obsolete attributes with descriptive messages guide developers toward the new
IPluginHotkey
interface.
603-641
: LGTM! Well-designed helper methods for modularity.The helper methods for changing and searching registered hotkeys improve code modularity and maintainability. The CheckAvailability method includes proper cleanup in the finally block.
809-838
: LGTM! Appropriate data container classes.The helper classes provide clean encapsulation for command parameters. The Obsolete attribute on the WindowPluginHotkeyPair.Hotkey property correctly aligns with the ActionContext deprecation strategy.
1-840
: Excellent comprehensive hotkey management system.This refactor establishes a robust, extensible hotkey management framework that handles system, application, and plugin hotkeys with proper event-driven updates, comprehensive error handling, and thoughtful backward compatibility. The architecture supports future enhancements while maintaining existing functionality.
Context
Windows system has a default context menu for doing some operations to one specific object like exe file, pdf file, etc. And some operations can have some hotkeys like ctrl-c for copy, etc. Since Flow provides many results like them, we should add context menu for them.
Flow designed context menu is good, but currently, for hotkey event binding in context menu, Flow introduces action context (
ActionContext
parameter inAction
andAsyncAction
inResult class
) like ctrl, alt, win key with the enter hotkey event (this is the key to open the action in one result) which means Flow need to regard ctrl+enter key event as enter event so that ctrl key will be passed with enter key.This can lead many possible problems:
Considering these issues, I would like to deprecate the action context API and introduce
IPluginHotkey
interface which can help plugins to register any hotkeys for their results. Additionally, plugins can return results with their supported hotkeys. And we need to find a workaround to ensure the compatibility for action context and I think we can fully deprecate it in future.In future, if plugins can register their hotkeys and specific supported hotkeys for their results. And we can look forward to a command bar like what does as Raycast. It will tell users what commands are available for the selected result. And it looks very nice for me, and I really enjoy this design.
Changes:
IPluginHotkey
to register global & search window hotkeys for one plugins.Hotkey registration refactor for both global hotkeys and main window hotkeys (KeyBinding): Now we are using call back function to register / unregister global and main window hotkeys which can improve code quality (Put all codes related to hotkey in
HotkeyMapper.cs
)Redesign welcome page 3: Removed Ctrl+Enter & Ctrl+Shift+Enter hotkeys since it will be deprated API and added more preset hotkeys.
Resolve #1614.
TODOS:
HotKeyMapper.Initialize();
(Asynchronous Loading & Initialization Plugin Model to Improve Window Startup Speed #3854).Future:
Test: