Skip to content

Fix Dialog Owner & Improve Window Exiting & Improve WindowsThumbnailProvider & Fix Warnings #3467

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

Merged
merged 14 commits into from
Apr 15, 2025

Conversation

Jack251970
Copy link
Contributor

Fix dialog owner

Follow on with #3466. Use Window.GetWindow to get owner.

Improve window exiting

First hide main window and then exiting window for better display effect.

Improve WindowsThumbnailProvider

Fix possible task exception with WindowsThumbnailProvider.

Fix warnings

Lots of tweaks for fixing warnings.

@prlabeler prlabeler bot added the bug Something isn't working label Apr 15, 2025
@Jack251970 Jack251970 requested a review from Copilot April 15, 2025 05:34
@Jack251970 Jack251970 added this to the 1.20.0 milestone Apr 15, 2025
@Jack251970 Jack251970 added the Dev branch only An issue or fix for the Dev branch build label Apr 15, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 18 out of 21 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml: Language not supported
  • Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj: Language not supported
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml: Language not supported
Comments suppressed due to low confidence (1)

Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs:114

  • Ensure that the UI binding now passes a Button instance to this command since the method signature requires a parameter. If the binding is not updated accordingly, the command may fail at runtime.
private async Task OpenHelperAsync(Button button)

This comment has been minimized.

Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

❌ Errors Count
❌ forbidden-pattern 22
⚠️ non-alpha-in-dictionary 19

See ❌ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@Jack251970 Jack251970 marked this pull request as ready for review April 15, 2025 06:33
@Jack251970 Jack251970 requested a review from Copilot April 15, 2025 06:33
@Jack251970 Jack251970 requested a review from onesounds April 15, 2025 06:33
@Jack251970 Jack251970 enabled auto-merge April 15, 2025 06:33
@Jack251970
Copy link
Contributor Author

Tested and it works well.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 18 out of 21 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml: Language not supported
  • Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj: Language not supported
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml: Language not supported

Copy link

gitstream-cm bot commented Apr 15, 2025

🥷 Code experts: no user but you matched threshold 10

Jack251970, onesounds have most 👩‍💻 activity in the files.
jjw24, Jack251970 have most 🧠 knowledge in the files.

See details

Flow.Launcher.Infrastructure/Image/ImageLoader.cs

Activity based on git-commit:

Jack251970 onesounds
APR 121 additions & 46 deletions
MAR
FEB
JAN
DEC 4 additions & 3 deletions
NOV 12 additions & 4 deletions

Knowledge based on git-blame:
Jack251970: 26%
jjw24: 4%

Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB 13 additions & 8 deletions
JAN
DEC 51 additions & 105 deletions
NOV

Knowledge based on git-blame:
Jack251970: 54%
jjw24: 1%

Flow.Launcher/Msg.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR 3 additions & 4 deletions
MAR 10 additions & 11 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 14%
jjw24: 7%

Flow.Launcher/ReportWindow.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR 4 additions & 2 deletions
MAR
FEB 53 additions & 44 deletions
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 29%
jjw24: 5%

Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs

Activity based on git-commit:

Jack251970 onesounds
APR 100 additions & 60 deletions 41 additions & 5 deletions
MAR 2 additions & 1 deletions 69 additions & 0 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 52%

Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml

Activity based on git-commit:

Jack251970 onesounds
APR 9 additions & 20 deletions 84 additions & 43 deletions
MAR 45 additions & 43 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 7%

Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR 4 additions & 14 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 12%

Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj

Activity based on git-commit:

Jack251970 onesounds
APR
MAR 2 additions & 1 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
jjw24: 75%
Jack251970: 3%

Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:

Plugins/Flow.Launcher.Plugin.Explorer/Helper/SortOptionTranslationHelper.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:

Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
jjw24: 53%

Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/ActionKeywordModel.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:

Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs

Activity based on git-commit:

Jack251970 onesounds
APR 1 additions & 1 deletions
MAR
FEB
JAN
DEC
NOV 3 additions & 4 deletions

Knowledge based on git-blame:
jjw24: 6%

Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB 6 additions & 6 deletions
JAN
DEC
NOV 8 additions & 8 deletions

Knowledge based on git-blame:
jjw24: 21%
Jack251970: 6%

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

Activity based on git-commit:

Jack251970 onesounds
APR 2 additions & 2 deletions
MAR 2066 additions & 1972 deletions 1 additions & 1 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 90%
jjw24: 1%

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
jjw24: 56%

Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR 12 additions & 12 deletions
MAR
FEB 13 additions & 3 deletions
JAN
DEC
NOV 9 additions & 9 deletions

Knowledge based on git-blame:
jjw24: 37%
Jack251970: 6%

Plugins/Flow.Launcher.Plugin.Sys/Main.cs

Activity based on git-commit:

Jack251970 onesounds
APR 4 additions & 3 deletions
MAR 200 additions & 186 deletions 12 additions & 3 deletions
FEB 98 additions & 56 deletions
JAN
DEC 12 additions & 38 deletions
NOV 12 additions & 14 deletions

Knowledge based on git-blame:
Jack251970: 43%
jjw24: 9%

Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs

Activity based on git-commit:

Jack251970 onesounds
APR
MAR
FEB 6 additions & 7 deletions
JAN
DEC
NOV 13 additions & 13 deletions

Knowledge based on git-blame:
jjw24: 15%
Jack251970: 8%

To learn more about /:\ gitStream - Visit our Docs

Copy link

gitstream-cm bot commented Apr 15, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

Copy link
Contributor

coderabbitai bot commented Apr 15, 2025

📝 Walkthrough

Walkthrough

This set of changes primarily refactors command handling in the Explorer plugin to use CommunityToolkit.Mvvm's [RelayCommand] attribute, removing manual RelayCommand implementations and updating related XAML bindings. Several files receive code quality improvements, such as nullability annotations, suppression of async void warnings, and minor code cleanups. Logging and exception handling are refined in image and thumbnail loading infrastructure. Other updates include project dependency additions, minor UI logic adjustments, and removal of unused fields and code.

Changes

File(s) Change Summary
Flow.Launcher.Infrastructure/Image/ImageLoader.cs Simplified exception log messages in thumbnail loading by removing a log message prefix.
Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs Improved exception handling in thumbnail retrieval: added new HRESULT constants, refined COMException handling, and added a generic exception catch for better error reporting.
Flow.Launcher/Msg.xaml.cs
Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs
Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs
Added [SuppressMessage] attributes to async void methods to silence VSTHRD100 warnings; no logic changes.
Flow.Launcher/ReportWindow.xaml.cs Removed unused static field ClassName.
Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs
Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml
Refactored OpenHelperAsync to accept a Button parameter and updated XAML to bind the button as a command parameter.
Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs Added a zero-width BOM and reordered using directives; no functional changes.
Flow.Launcher/ViewModel/RelayCommand.cs
Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/RelayCommand.cs
Deleted custom RelayCommand classes implementing ICommand.
Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj Added CommunityToolkit.Mvvm package dependency.
Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs Replaced deprecated thread ID API, added null-forgiving operator, and inserted BOM; no logic changes.
Plugins/Flow.Launcher.Plugin.Explorer/Helper/SortOptionTranslationHelper.cs
Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs
Added null-forgiving operators to suppress nullable warnings.
Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/ActionKeywordModel.cs Enabled nullable reference types, updated event and field declarations for nullability.
Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs Refactored to use [RelayCommand] attributes from CommunityToolkit.Mvvm, removed manual command properties, and converted the class to partial.
Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs Added blank lines for code readability; no logic changes.
Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml Updated Button Command bindings to match new [RelayCommand]-generated command names.
Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs Removed unused field and using directives; reordered imports.
Plugins/Flow.Launcher.Plugin.Sys/Main.cs Inserted call to hide main window before closing in "Exit" command.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SettingsViewModel
    participant MVVMToolkit
    participant UI

    User->>UI: Clicks "Add Link" button
    UI->>SettingsViewModel: Invokes AddLinkCommand (via [RelayCommand])
    SettingsViewModel->>MVVMToolkit: [RelayCommand] attribute triggers AddLink method
    SettingsViewModel->>UI: Updates UI based on logic
Loading
sequenceDiagram
    participant User
    participant SettingsPanePluginsViewModel
    participant Button
    participant ContentDialog

    User->>Button: Clicks "Open Helper"
    Button->>SettingsPanePluginsViewModel: Executes OpenHelperCommand with Button as parameter
    SettingsPanePluginsViewModel->>ContentDialog: Sets Owner to Window.GetWindow(button)
    ContentDialog->>User: Displays dialog
Loading

Possibly related PRs

  • Flow-Launcher/Flow.Launcher#3412: Introduces a new LoadImageAsync API and refactors image loading, which is related to the changes in exception logging in ImageLoader.cs.

Suggested labels

enhancement, Code Quality

Suggested reviewers

  • onesounds

Poem

In the warren where commands once hopped alone,
Now MVVM magic makes them feel at home.
With attributes sprinkled and warnings suppressed,
The code is much neater—our bunny is impressed!
No more relay clutter, just toolkit delight,
Explorer commands leap forward, swift and light.
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (8)
Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs (2)

31-31: Warning suppression for async void method

Suppressing the VSTHRD100 warning is appropriate for event handlers and initialization methods in UI code. Consider adding a more specific justification comment to explain why async void is necessary here.

-[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "<Pending>")]
+[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "Required for UI initialization method")]

128-128: Warning suppression for async void event handler

Suppressing the VSTHRD100 warning is appropriate for event handlers and initialization methods in UI code. Consider adding a more specific justification comment to explain why async void is necessary here.

-[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "<Pending>")]
+[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "Required for UI event handler")]
Flow.Launcher/Msg.xaml.cs (1)

62-62: Add a specific justification for the warning suppression.

The warning suppression for the async void method is appropriate since this is a public API that would require significant refactoring to change, but the justification should be more specific than "".

-[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "<Pending>")]
+[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "Public API that would require significant refactoring to change to Task-returning method")]
Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs (5)

149-149: Add a specific justification for the warning suppression.

The suppression is appropriate, but the justification should be more specific about why this method needs to remain as async void.

-[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "<Pending>")]
+[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "Called from multiple event handlers; refactoring would require extensive changes")]

187-187: Add a specific justification for the warning suppression.

Similar to the previous suppression, provide a clear justification for why this method uses async void.

-[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "<Pending>")]
+[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "Called from event handlers that cannot await Task-returning methods")]

282-282: Add a specific justification for the warning suppression.

For event handlers, the justification should mention that these are UI event handlers where async void is appropriate.

-[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "<Pending>")]
+[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "UI event handler that cannot return Task")]

290-290: Add a specific justification for the warning suppression.

For event handlers, the justification should mention that these are UI event handlers where async void is appropriate.

-[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "<Pending>")]
+[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "UI event handler that cannot return Task")]

149-156: Consider refactoring this method to return Task.

Although suppressing the warning is a valid approach, a better practice would be to refactor non-event-handler methods to return Task when possible. This improves exception handling and testability.

-[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "<Pending>")]
-private async void ReIndexing()
+private async Task ReIndexingAsync()
 {
     ViewRefresh();
     indexingPanel.Visibility = Visibility.Visible;
     await Main.IndexProgramsAsync();
     indexingPanel.Visibility = Visibility.Hidden;
 }

You would also need to update the calling methods to await this method, which is why this is suggested as an optional refactor for a future PR.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 309a710 and 4768290.

📒 Files selected for processing (21)
  • Flow.Launcher.Infrastructure/Image/ImageLoader.cs (1 hunks)
  • Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs (3 hunks)
  • Flow.Launcher/Msg.xaml.cs (1 hunks)
  • Flow.Launcher/ReportWindow.xaml.cs (0 hunks)
  • Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs (1 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml (1 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs (1 hunks)
  • Flow.Launcher/ViewModel/RelayCommand.cs (0 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs (3 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Helper/SortOptionTranslationHelper.cs (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs (2 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/ActionKeywordModel.cs (2 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/RelayCommand.cs (0 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs (6 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs (2 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml (3 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs (3 hunks)
  • Plugins/Flow.Launcher.Plugin.Sys/Main.cs (1 hunks)
  • Plugins/Flow.Launcher.Plugin.WebSearch/SearchSourceSetting.xaml.cs (2 hunks)
💤 Files with no reviewable changes (3)
  • Flow.Launcher/ReportWindow.xaml.cs
  • Flow.Launcher/ViewModel/RelayCommand.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/RelayCommand.cs
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
🔇 Additional comments (32)
Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs (4)

15-15: Documentation improvement.

Using the shorter reference to SIIGBF instead of the fully qualified name improves readability while maintaining clarity.


34-36: Good practice: Named constants for error codes.

Using named constants for HRESULT values makes the code more readable and maintainable. This change supports better error handling by clearly identifying specific error conditions.


84-88: Enhanced exception handling improves robustness.

The updated exception handling now properly accounts for both extraction failures and path not found errors when in ThumbnailOnly mode. The fallback to IconOnly is appropriate in both cases.


95-99: Good addition of general exception handler.

Adding a catch-all exception handler prevents unhandled exceptions from propagating up the call stack. Wrapping in an InvalidOperationException with a descriptive message provides better context about the failure.

Flow.Launcher.Infrastructure/Image/ImageLoader.cs (1)

174-175: Improved log message clarity.

Removing the redundant class name prefix from log messages makes them cleaner and more concise while maintaining all necessary information. Since the class name is already passed as the first parameter to Log.Exception, there's no need to include it again in the message.

Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml (1)

60-60: Good improvement for dialog ownership

Adding the CommandParameter binding to pass the button itself to the OpenHelperCommand ensures the correct dialog owner window can be determined. This fixes potential dialog parenting issues that could cause focus/z-order problems.

Plugins/Flow.Launcher.Plugin.Sys/Main.cs (1)

365-365: Good UX improvement for application exit

Hiding the main window before closing it provides a smoother visual transition during application shutdown. This prevents users from seeing partial UI destruction which could appear jarring.

Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs (1)

114-114: Great fix for dialog owner resolution

Using the Button parameter and Window.GetWindow() to determine the dialog owner is the correct approach. This ensures the dialog is properly owned by its parent window instead of using the application's main window, which might not be the correct context for the dialog.

This change:

  1. Improves focus management between the dialog and parent window
  2. Ensures the dialog follows the parent window when moved
  3. Prevents z-order issues when multiple windows are open

Also applies to: 118-118

Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj (1)

48-48: Good addition to support modern MVVM patterns.

Adding the CommunityToolkit.Mvvm package is a positive change that enables using source-generated commands via the [RelayCommand] attribute, which reduces boilerplate code compared to manual RelayCommand implementations.

Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs (1)

1-5: Harmless formatting change.

The code only contains minor ordering changes to using directives and the addition of a BOM character. These changes don't affect functionality.

Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs (2)

50-50: Good nullability annotation improvement.

Adding the null-forgiving operator ensures the compiler that special.Value won't be null, improving null safety analysis without changing runtime behavior.


64-64: Good nullability annotation improvement.

Adding the null-forgiving operator ensures the compiler that the result of special.Key.ToString() won't be null, improving null safety analysis.

Plugins/Flow.Launcher.Plugin.Explorer/Helper/SortOptionTranslationHelper.cs (1)

19-19: Good nullability annotation improvement.

Adding the null-forgiving operator to enumName properly informs the compiler that this value won't be null when Split() is called, which aligns with the null check done in line 16 using ArgumentNullException.ThrowIfNull(API).

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml (3)

248-248: Updated binding to match source-generated command name.

This change correctly updates the Command binding to use the new property name generated by CommunityToolkit.Mvvm's [RelayCommand] attribute.


275-275: Updated binding to match source-generated command name.

This change correctly updates the Command binding to use the new property name generated by CommunityToolkit.Mvvm's [RelayCommand] attribute.


302-302: Updated binding to match source-generated command name.

This change correctly updates the Command binding to use the new property name generated by CommunityToolkit.Mvvm's [RelayCommand] attribute.

Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs (3)

88-88: Code formatting improvement with added blank line.

The addition of a blank line after the method improves readability by creating clearer visual separation between methods.


98-98: Code formatting improvement with added blank line.

The addition of a blank line after the method improves readability by creating clearer visual separation between methods.


104-104: Code formatting improvement with added blank line.

The addition of a blank line after the method improves readability by creating clearer visual separation between methods.

Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/ActionKeywordModel.cs (3)

4-5: Enabling nullable reference types improves type safety.

Enabling nullable reference types helps catch potential null reference exceptions at compile time by making nullability explicit in the type system.


10-10: Appropriate use of null-forgiving operator.

Using the null-forgiving operator with the static field is appropriate here since the field is initialized through the Init method before use.


12-12: Correctly marking event as nullable.

The PropertyChanged event is correctly marked as nullable to align with the nullable reference type system.

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs (1)

1-6: Improved organization of using directives.

The using directives have been reordered for better organization, with specific plugin namespaces now explicitly ordered.

Plugins/Flow.Launcher.Plugin.Explorer/Helper/ShellContextMenu.cs (1)

1538-1538: Updated to use modern thread ID retrieval.

Replaced the deprecated AppDomain.GetCurrentThreadId() with the recommended Environment.CurrentManagedThreadId. This is a good modernization of the code.

Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs (8)

11-16: LGTM! Good refactoring to use CommunityToolkit.Mvvm.

The changes properly set up the class for using the MVVM toolkit's source generation features. Converting the class to partial and adding the necessary import for CommunityToolkit.Mvvm.Input are correct steps for enabling the [RelayCommand] attribute pattern.

Also applies to: 20-20


262-298: Refactoring to [RelayCommand] pattern looks good.

The EditActionKeyword method has been properly annotated with the [RelayCommand] attribute. This will generate a public EditActionKeywordCommand property via source generation, eliminating the need for manual command property implementation.


318-347: Refactoring to [RelayCommand] pattern looks good.

The EditLink method has been properly annotated with the [RelayCommand] attribute. The implementation itself is well-structured, handling both quick access links and excluded paths in a consistent way.


355-378: Refactoring to [RelayCommand] pattern looks good.

The AddLink method has been properly annotated with the [RelayCommand] attribute. The implementation correctly handles adding different types of links based on the command parameter.


380-397: Refactoring to [RelayCommand] pattern looks good.

The RemoveLink method has been properly annotated with the [RelayCommand] attribute. The implementation correctly handles both link types and calls Save() to persist the changes.


443-451: Refactoring to [RelayCommand] pattern looks good.

The OpenFileEditorPath method has been properly annotated with the [RelayCommand] attribute. This will generate a public OpenFileEditorPathCommand property that can be bound to in XAML.


453-461: Refactoring to [RelayCommand] pattern looks good.

The OpenFolderEditorPath method has been properly annotated with the [RelayCommand] attribute. This will generate a public OpenFolderEditorPathCommand property.


463-471: Refactoring to [RelayCommand] pattern looks good.

The OpenShellPath method has been properly annotated with the [RelayCommand] attribute. This will generate a public OpenShellPathCommand property.

@Jack251970 Jack251970 merged commit 7d6fceb into dev Apr 15, 2025
17 checks passed
@Jack251970 Jack251970 deleted the warning_fix_tweak branch April 15, 2025 07:09
@jjw24 jjw24 removed the Dev branch only An issue or fix for the Dev branch build label May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants