Skip to content
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

Unify Settings Panel Design & Fix JsonRPC Settings Empty Issue #3265

Open
wants to merge 37 commits into
base: dev
Choose a base branch
from

Conversation

Jack251970
Copy link
Contributor

@Jack251970 Jack251970 commented Feb 21, 2025

Unify settings panel design

Unify desgin in InstalledPluginDisplayKeyword.xaml, JsonRPCPluginSettings.cs and settings panel xaml files of all plugins. All designed resources are in CustomControlTemplate.xaml.

Also fix JsonRPC plugin settings empty issues in JsonRPCSettings.cs. (Since this is import part for testing JsonRPC settings panel, I put it in this PR)

Fix:#2577, #3182 (InitializeAsync())

TODO list

Test

  1. JsonRPC
    Screenshot 2025-03-02 114715

  2. Dotnet
    image

This comment has been minimized.

@Jack251970
Copy link
Contributor Author

@onesounds Hi, I’d like to get your idea on the design for the settings panel. Which option do you think is better, or do you feel they both work well?

Left aligned version:

Screenshot 2025-02-21 222837

Right aligned version:

Screenshot 2025-02-21 222837 - Copy

@Jack251970
Copy link
Contributor Author

@onesounds Hi, I’d like to get your idea on the design for the settings panel. Which option do you think is better, or do you feel they both work well?

Left aligned version:

Screenshot 2025-02-21 222837

Right aligned version:

Screenshot 2025-02-21 222837 - Copy

@Flow-Launcher/team Hello everyone, I’d like to get your feedback on this design. What are your thoughts?

@cibere
Copy link
Contributor

cibere commented Feb 24, 2025

@Flow-Launcher/team Hello everyone, I’d like to get your feedback on this design. What are your thoughts?

I definitely like the left align more.

With the right align, it seems unnecessary to add the separation and make it a little harder to match the label to the input. for me at least, it takes me a little bit longer to match the label to the inputs on the right align vs the left align

@onesounds
Copy link
Contributor

For the check box type, left alignment is recommended, and for others, right alignment is recommended. (I referred to powertoy run and Windows 11's settings window as a reference.) I've tried to unify this a few times, but it wasn't easy because there were a lot of plug-ins with complicated settings. Anyway, the basic design recommends the Power Toy layout.

@Jack251970
Copy link
Contributor Author

@Flow-Launcher/team Hello everyone, I’d like to get your feedback on this design. What are your thoughts?

I definitely like the left align more.

With the right align, it seems unnecessary to add the separation and make it a little harder to match the label to the input. for me at least, it takes me a little bit longer to match the label to the inputs on the right align vs the left align

Thanks for your reply!❤

@Jack251970
Copy link
Contributor Author

For the check box type, left alignment is recommended, and for others, right alignment is recommended. (I referred to powertoy run and Windows 11's settings window as a reference.) I've tried to unify this a few times, but it wasn't easy because there were a lot of plug-ins with complicated settings. Anyway, the basic design recommends the Power Toy layout.

Thanks for your reply!❤ I wonder why for the check box type, left alignment is recommended?

image

As you can see in Windows Settings, it is also right-aligned. 😢

@Jack251970
Copy link
Contributor Author

For the check box type, left alignment is recommended, and for others, right alignment is recommended. (I referred to powertoy run and Windows 11's settings window as a reference.) I've tried to unify this a few times, but it wasn't easy because there were a lot of plug-ins with complicated settings. Anyway, the basic design recommends the Power Toy layout.

NVM. I confused Toggle Button and Check Box.

@VictoriousRaptor
Copy link
Contributor

Thanks for your reply!❤ I wonder why for the check box type, left alignment is recommended?

Just some personal idea:

Right alignment (or justified alignemnt if you consider labels and controls as a whole line) is harder to match label and control as cibere mentioned. but windows 11 in your example image has a box containing the label and control so it's not a big deal. As in our program we don't have boxes so left alignment is better IMO.

Here's an example of windows 11 using left alignment.

image

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@Jack251970 Jack251970 added kind/ui related to UI, icons, themes, etc and removed 1 min review labels Feb 27, 2025

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@prlabeler prlabeler bot added the bug Something isn't working label Mar 1, 2025

This comment has been minimized.

@Jack251970 Jack251970 marked this pull request as ready for review March 2, 2025 02:41
Copy link
Contributor

coderabbitai bot commented Mar 2, 2025

Warning

Rate limit exceeded

@Jack251970 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 26 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 20d0ed1 and c848fab.

📒 Files selected for processing (1)
  • Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (5 hunks)
📝 Walkthrough

Walkthrough

This pull request refines settings management and UI layout consistency. In the core plugin settings, property types are updated to allow nullable values, and initialization methods are enhanced with robust null checks and type conversions. Across various XAML files, hardcoded margins, paddings, and fixed sizes have been replaced by static resource references. The changes also restructure several layouts and styles to promote consistent appearance and easier maintainability throughout the application.

Changes

File(s) Change Summary
Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs Updated settings properties to use nullable types, refined the InitializeAsync method with null checks and type conversion of JsonElement, and changed the CreateSettingPanel return type to Control? with improved handling for missing settings.
Flow.Launcher/Resources/Controls/InstalledPluginDisplayKeyword.xaml
Flow.Launcher/Resources/CustomControlTemplate.xaml
Adjusted UI layout by replacing fixed height and margin values with static resource references, and introduced new resource definitions (thickness, double values, styles) for a consistent settings panel appearance.
Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml
Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml
Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
Plugins/Flow.Launcher.Plugin.PluginsManager/Views/PluginsManagerSettings.xaml
Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml
Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml
Plugins/Flow.Launcher.Plugin.Sys/SysSettings.xaml
Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml
Modified UI layouts across plugins by standardizing margins, paddings, and alignments using static resources. Changes include restructuring of layouts (e.g., removal of a tab-based interface in Explorer) and enhancements in component spacing and visual consistency.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Settings as JsonRPCPluginSettings
  participant Storage as JsonStorage

  Client->>Settings: InitializeAsync()
  Settings->>Settings: Check if Settings is null
  alt Settings is null
      Settings->>Storage: Create new instance & call LoadAsync()
      Storage-->>Settings: Return settings data
      Settings->>Settings: Convert JsonElement values to proper types
  else
      Settings->>Settings: Process existing settings
  end
Loading

Possibly related PRs

Suggested reviewers

  • jjw24
  • onesounds

Poem

I'm a rabbit hopping through lines of code,
Where nulls are checked and settings now load,
Margins and paddings align with a graceful nod,
In a burrow of resources, the UI's bestowed,
With every tweak I cheer, a joyful abode.
🐇 Happy coding, let the improvements explode!


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: 0

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

64-64: Minor margin notation tweak
Switching from comma-separated to space-separated values (e.g., 6 0 0 0) is valid in XAML. This is a harmless consistency fix.


121-147: Ensure correct suggestion provider binding
Using a DockPanel to group the label, combo box, and checkbox for enabling suggestions is clean. However, the comment “Not sure why binding IsEnabled directly to Settings.EnableWebSearchSuggestion is not working” indicates a data context or property binding issue.

One approach is to ensure the property is public, has a compatible INotifyPropertyChanged implementation, and is properly set in the same data context:

<ComboBox
  IsEnabled="{Binding Settings.EnableSuggestion, Mode=TwoWay}"
  ...
/>

Feel free to let me know if you’d like more assistance debugging the binding!

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

71-71: Consider converting hardcoded margin to resource
Margin="480 5 0 0" stands out as a hardcoded value. Replacing it with a static resource (like SettingPanelItemLeftTopBottomMargin) could further unify layout consistency.


93-136: Large grid with many rows
Defining numerous row definitions is valid, yet can reduce clarity. Consider grouping related settings into smaller user controls or sections for improved maintainability.

Flow.Launcher/Resources/CustomControlTemplate.xaml (1)

5589-5615: Good addition of standardized resources for settings panel design.

These new resources will help create a consistent look and feel across settings panels throughout the application, which aligns with the PR objective to unify settings panel design. The resources include standard margins, separator styles, minimum dimensions for various text box types, and a description text style.

There's a typo in the style name on line 5599: "SettingPanelSeperatorStyle" should be "SettingPanelSeparatorStyle" (incorrect spelling of "Separator").

-<Style x:Key="SettingPanelSeperatorStyle" TargetType="Separator">
+<Style x:Key="SettingPanelSeparatorStyle" TargetType="Separator">
Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (3)

39-60: Consider parsing numeric types from JSON.
Currently, numeric JsonElement values will fall through to the default case. This can cause potential data loss or confusion if numeric settings are provided. Extending the switch block to convert numbers can improve flexibility:

 JsonValueKind.Number => jsonElement.TryGetInt64(out var iVal)
     ? iVal
     : (object)jsonElement.GetDouble(),

140-494: Improve readability of the large switch statement & address the TODO.

  1. Refactor suggestion: The creation of multiple control types in a single method is extensive. Splitting code paths into smaller helper methods (e.g., CreateTextBoxControl(), CreateHyperlinkControl(), etc.) can improve clarity, testability, and maintainability over the long term.

  2. Confirm design alignment choices: Since the PR discusses left vs. right alignment for controls, confirm that the final alignment (currently set to HorizontalAlignment.Left in multiple places) adheres to the desired unified panel design.

  3. TODO at line 360: There's a “TODO: Fix issue here” for password handling. If you need a secure or more specialized approach for storing or masking passwords, please finalize this before merging.


496-498: Future-proof condition checks.
This helper method correctly excludes certain control types from being saved in settings. When a new control type is introduced, remember to update this method's logic if necessary.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 79d54d0 and ae8f647.

📒 Files selected for processing (11)
  • Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (4 hunks)
  • Flow.Launcher/Resources/Controls/InstalledPluginDisplayKeyword.xaml (1 hunks)
  • Flow.Launcher/Resources/CustomControlTemplate.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml (4 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml (3 hunks)
  • Plugins/Flow.Launcher.Plugin.PluginsManager/Views/PluginsManagerSettings.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml (4 hunks)
  • Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml (3 hunks)
  • Plugins/Flow.Launcher.Plugin.Sys/SysSettings.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml (4 hunks)
✅ Files skipped from review due to trivial changes (3)
  • Plugins/Flow.Launcher.Plugin.PluginsManager/Views/PluginsManagerSettings.xaml
  • Plugins/Flow.Launcher.Plugin.Sys/SysSettings.xaml
  • Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: gitStream.cm
🔇 Additional comments (34)
Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml (5)

13-13: Good standardization of margins!

Replacing hard-coded margin with a static resource improves consistency and maintainability across the application.


23-25: Proper vertical alignment added

Good improvement to add the VerticalAlignment property while standardizing margins using static resources.


61-61: Consistent separator styling applied

Using the SettingPanelSeperatorStyle for separators creates visual consistency across the application.

Also applies to: 93-93


33-33: Unified checkbox and button margins

Great job standardizing all interactive element margins with appropriate static resources.

Also applies to: 40-40, 46-46, 73-73, 78-78, 83-83, 101-101, 108-108, 115-115, 128-128


203-203: Consistent left-aligned button margins

Using SettingPanelItemLeftTopBottomMargin for these buttons maintains proper spacing and alignment.

Also applies to: 209-209

Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml (3)

20-20: Good standardization of panel margin

Replacing hard-coded margin with SettingPanelMargin static resource maintains consistent design across plugin settings.


42-44: Improved ComboBox alignment

Adding VerticalAlignment="Center" ensures consistent vertical alignment with the labels, creating a more polished appearance.

Also applies to: 65-67


33-33: Consistent label margins

Using SettingPanelItemRightTopBottomMargin for TextBlock elements ensures proper spacing and alignment with other elements.

Also applies to: 57-57

Flow.Launcher/Resources/Controls/InstalledPluginDisplayKeyword.xaml (4)

14-14: Flexible height improvement

Changing from fixed height to Auto allows the control to adapt to its content, improving responsiveness and accommodating different content sizes.


21-21: Standardized panel margin

Using SettingPanelMargin static resource ensures consistent spacing across different settings panels.


23-26: Improved glyph alignment

Adding proper horizontal and vertical alignment along with standardized margins ensures consistent positioning of the glyph icon.


39-39: Consistent button margin

Using SettingPanelItemLeftMargin provides appropriate spacing for right-aligned buttons.

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml (4)

11-15: Improved grid structure

Good standardization of the panel margin and improved row definition structure to better organize the content.


16-40: Well-organized browser selection controls

The horizontal layout with consistent margins improves the user experience by placing related controls in a more intuitive arrangement. The addition of a dedicated "Others" button enhances functionality.


41-49: Clean custom browsers list implementation

The ListView now has proper margins and consistent styling, improving the visual consistency with other settings panels.


67-91: Consistent button sizing and spacing

Setting fixed widths (100) for all buttons and using standardized margins creates a clean, professional appearance for the button group.

Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml (5)

38-42: Adopt a unified margin resource for maintainability
Replacing the hardcoded Grid margin with SettingPanelMargin helps ensure consistent spacing throughout the application and eases future layout adjustments.


48-48: Good move to a top/bottom margin resource
Using SettingPanelItemTopBottomMargin for the ListView replaces magic numbers, enhances readability, and aligns with the unified design strategy.


73-77: Confirm column width sufficiency
The column width changed to 239. Verify that no localization strings or long titles become truncated in narrower widths.


101-119: Static resources for button margins
Adopting SettingPanelItemTopBottomMargin and SettingPanelItemLeftMargin ensures uniform button spacing. This is a neat improvement in UI consistency.


120-120: Separator for logical grouping
Adding this Separator helps break up the settings sections. This small change improves usability and clarity for users.

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

19-26: New style promotes consistent header formatting
HeaderTextBlockStyle cleanly centralizes font weight, alignment, and wrapping rules, ensuring uniform look-and-feel across header elements.


138-347: Streamlined “General Setting” section
All newly added checkboxes and text blocks are now consistently spaced and aligned. Great job applying SettingPanelItemTopBottomMargin for uniform spacing.


357-387: Native context menu pattern lists
Consolidating the included/excluded patterns into multiline text boxes is convenient for users. Using the same margin resources ensures consistent spacing.


389-467: Preview panel date/time layout
Separating preview panel settings with a Separator and grouping controls in a DockPanel clarifies the configuration. This design reasoning is consistent with the rest of the refactor.


469-545: Everything integration
Adding dedicated checkboxes and combos for Everything-based searches is a solid approach. Ensure the user sees relevant warnings if Everything is not installed or misconfigured.


547-583: Action keywords management
The new section for managing action keywords is self-explanatory and visually distinct, simplifying user interaction.


585-693: Quick access links and exclusion paths
The consistent use of ListView and StackPanel with shared margins for adding/editing/deleting these links matches the rest of the UI. It nicely unifies the settings panel design.

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (6)

3-3: Good library import.
Importing System.Text.Json is necessary for handling JsonElement and related conversions. No concerns here.


11-11: Nullable reference enabled.
Enabling nullable references is a good step toward preventing null-related runtime errors. Ensure it's consistently used and enforced across the entire project for maximum benefit.


22-23: Thread safety verification for concurrent dictionary.
Exposing the ConcurrentDictionary<string, object?> via a read-only property is a clean design choice. However, ensure that reads and writes happen in a safe, well-defined manner across different threads or tasks, given that UI code may invoke updates concurrently.

Also applies to: 26-26


28-35: Verify the resource references.
These static resource lookups rely on the specified keys being present in application resources. Consider fallback or error-checking logic to prevent runtime failures if the keys aren’t found.


69-69: No further action needed.
This is just a comment line detailing the skip logic. No additional remarks.


95-98: Graceful handling of null or empty settings.
Checking if the settings dictionary is null or empty and returning early is a clean approach to avoid unnecessary operations.

This comment has been minimized.

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: 0

🧹 Nitpick comments (4)
Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml (2)

71-71: Avoid hardcoded margin for alignment.
Consider referencing a static resource or using a more flexible layout solution instead of "480 5 0 0" for consistency with the rest of the settings panel design.

- <TextBlock Margin="480 5 0 0">
+ <TextBlock Margin="{StaticResource SomeMarginResource}">

93-132: Consider reducing the large number of row definitions.
Having dozens of <RowDefinition /> entries can hamper maintainability; using a more dynamic layout approach or grouping related settings might simplify future changes.

Flow.Launcher/Resources/CustomControlTemplate.xaml (2)

5599-5604: Fix the spelling error in style name

There's a typo in the style key name "SettingPanelSeperatorStyle" - it should be "SettingPanelSeparatorStyle" (with an "a" instead of "e" in "Separator").

-<Style x:Key="SettingPanelSeperatorStyle" TargetType="Separator">
+<Style x:Key="SettingPanelSeparatorStyle" TargetType="Separator">

5599-5604: Consider the relationship between margin values

The separator style uses negative margins that directly correspond to the values in SettingPanelMargin (line 5590). This creates a maintenance dependency - if the panel margin changes, the separator margin would need to be updated to match.

Consider either adding a comment to highlight this relationship or using a more maintainable approach like deriving these values.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ae8f647 and 1681ac4.

📒 Files selected for processing (3)
  • Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (4 hunks)
  • Flow.Launcher/Resources/CustomControlTemplate.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml (3 hunks)
🔇 Additional comments (63)
Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml (39)

17-17: No further action needed for this blank line.


19-25: New style definitions look good.
No issues noted with the HeaderTextBlockStyle. Using static resources for margin aligns with the PR objective of design unification.


27-27: No further action needed for this blank line.


138-153: General settings header and checkbox layout look consistent.
These lines follow a left-aligned approach as discussed in the PR comments. Good job.


155-163: Default open in file manager option looks good.
No issues noted with binding and layout.


164-188: File Editor Path configuration is properly implemented.
The OpenFileEditorPath command binding appears correct. No issues found.


190-214: Folder Editor Path configuration is consistent.
Similar approach to File Editor Path, no concerns.


216-240: Shell Path configuration is straightforward.
Binding to OpenShellPath command looks fine.


242-256: IndexSearchEngines ComboBox logic is clear.
Great use of DisplayMemberPath and SelectedItem.


258-272: ContentIndexSearchEngines ComboBox logic follows the same pattern.
No issues found.


274-288: Directory Recursive Search Engine selection appears properly bound.
No concerns with data binding.


290-303: Excluded File Types setting is straightforward.
No issues noted.


305-321: Maximum Results input field is well implemented.
Preview text input check and numeric constraint seem fine.


323-329: Button for opening indexing options is properly integrated.
Command event handling looks good.


332-339: Native Context Menu header is introduced cleanly.
No issues found.


341-347: ShowWindowsContextMenu checkbox is straightforward.
Binding is correct.


349-355: Include patterns guide text is clearly presented.
No concerns here.


357-367: WindowsContextMenuIncludedItems text box is appropriately bound.
No issues to report.


369-375: Exclude patterns guide text is clear and consistent.
Good approach to help user understanding.


377-387: WindowsContextMenuExcludedItems text box binding is correct.
No issues found.


390-397: Preview Panel header is introduced properly.
Follows the established style pattern.


399-425: WrapPanel usage for file info checkboxes is consistent.
No misalignments or binding issues noted.


428-467: Date/time format combos for the preview panel are well structured.
Logic for enabling and visibility toggles is sound.


470-477: Everything Setting header is declared with consistent style usage.
No issues found.


479-487: EverythingSearchFullPath checkbox is properly bound.
No concerns.


488-496: EverythingEnableRunCount logic is straightforward.
No issues found.


497-519: Sort option combo box for Everything is well integrated.
The EnumNameConverter usage is appropriate.


520-533: Everything installed path text box matches the other path fields.
Implementation is consistent.


535-546: Fast Sort warning message is displayed properly.
The binding and visibility approach look sound.


549-556: Customization header for Action Keywords is introduced nicely.
No issues found.


558-570: ActionKeywordsModels ListView logic is correct.
Data template usage is consistent.


572-583: Edit action keyword command is wired up properly.
Nice minimal UI approach.


586-593: Quick Access Links header follows the new style.
No further concerns.


595-613: QuickAccessLinks ListView binding is correct.
Drag and drop events are properly defined.


615-639: Button commands for removing, editing, and adding quick access links are correct.
Layout is consistent with the design approach.


642-649: IndexSearchExcludedPaths header is consistent with the rest of the design.
No issues found.


651-668: Excluded subdirectory paths ListView usage matches QuickAccessLinks pattern.
No concerns regarding the drag-and-drop configuration.


670-694: Button setup for removing, editing, and adding index search excluded paths is consistent.
No problems noted.


697-697: No further action needed for this blank line.

Flow.Launcher/Resources/CustomControlTemplate.xaml (1)

5589-5615: Good implementation of standardized resources for settings panels

The addition of these standardized resources aligns well with the PR objective to unify settings panel designs across various components. The naming conventions are consistent, and the resource types (Thickness, Style, Double) are appropriate for their intended usage.

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs (23)

3-3: Good addition for enhanced type safety.

Adding the System.Text.Json import and enabling nullable reference types improves type safety and correctly signals that this code handles JSON elements and null values, which aligns with the refinements made to the settings handling throughout the class.

Also applies to: 11-11


22-23: Improved null handling in dictionary types.

The update to use nullable object types (object?) in both the Inner property and Settings property is a good enhancement for type safety. This explicitly acknowledges that dictionary values can be null, which is especially important when working with JSON data.


26-26: Consistent nullable type handling for storage.

The update to the _storage field type correctly reflects the nullable changes made to the Settings property, maintaining type consistency throughout the class.


28-35: Excellent use of static resources for UI consistency.

Moving hardcoded UI values to static resources referenced from the application resources is a significant improvement that supports the PR's objective of unifying the settings panel design. This approach promotes consistency across components and makes future UI adjustments more maintainable.


39-60: Enhanced initialization with robust JSON element handling.

The improved initialization logic with proper null checking and type conversion from JsonElement is a significant enhancement. The switch statement based on JsonValueKind ensures values are correctly interpreted as appropriate types.


70-73: More explicit null checking for attributes.

The modified null check for attributes is more explicit and safer by specifically checking for null in the name property.


75-89: Better type handling for default values.

The refactored approach for handling default values with specific handling for checkboxes is more robust, ensuring correct type conversion based on the setting type.


95-98: Added consistent bracing for the early return condition.

Adding explicit braces for the early return improves code consistency and reduces the risk of future bugs when additional code might be added.


140-146: Clear signaling of possible null return with nullable return type.

Changing the return type to Control? correctly signals that this method may return null. The comprehensive null checks provide clear logic for when null should be returned.


148-158: Improved grid-based layout with dynamic sizing.

The updated grid configuration with auto-sized first column and star-sized second column creates a more flexible and responsive layout. Using resource-defined margins enhances consistency with the rest of the application.


175-218: Well-structured conditional panel creation.

The logic for creating type-specific panels with proper labels and descriptions is clear and well-organized. The approach ensures that only appropriate controls receive labels and descriptions, improving the UI experience.


223-235: Enhanced textBlock handling with improved text wrapping.

The updated textBlock implementation now properly handles line breaks and has consistent margin settings, improving readability of descriptive text in the settings panel.


238-256: Consistent styling for input fields.

The input TextBox now uses resource-defined minimum width and margins, which ensures consistent appearance across the application. The event handling for text changes is straightforward and effective.


260-322: Improved file/folder input with consistent button styling.

The file/folder input controls now use resource-defined dimensions and margins, with improved layout through the StackPanel. The refactored button click handler using pattern matching is more elegant and maintainable.


325-346: Better textarea implementation with appropriate dimensions.

The textarea control now uses resource-defined minimum dimensions and margins, ensuring a consistent appearance with other multi-line text input areas across the application.


349-369: Consistent passwordBox styling with improved event handling.

The passwordBox implementation now uses resource-defined dimensions and margins. Note the TODO comment on line 360 - this might need attention in future updates.

Could you clarify what issue the TODO on line 360 is referring to? This might need to be addressed before finalizing this PR.


372-390: Enhanced dropdown control with consistent styling.

The ComboBox now uses resource-defined margins and has consistent horizontal/vertical alignment, matching the styling of other input controls.


393-414: Improved checkbox implementation with better type handling.

The CheckBox now has consistent margins and improved IsChecked handling that accounts for both boolean and string representations in the settings.


415-443: Well-implemented hyperlink control with proper event handling.

The hyperlink implementation is well-structured with consistent margins and proper text wrapping, improving the appearance of linked content in the settings panel.


444-453: Consistent separator styling using theme resources.

The separator correctly uses a resource reference for its style, ensuring it will adapt properly to theme changes.


458-478: Logical control placement based on type.

The logic for placing controls in the grid based on their type is clear and well-organized. Special cases like textBlock and separator span multiple columns, while standard controls maintain a label-input relationship across columns.


489-494: Clean UserControl wrapping.

Wrapping the main grid in a UserControl is a clean approach that allows for easier integration with the rest of the application UI.


496-499: Helpful utility method for determining settings storage.

Extracting the logic for determining if a setting needs to be saved into a separate method improves code readability and maintainability.

This comment has been minimized.

This comment has been minimized.

@Jack251970
Copy link
Contributor Author

@Flow-Launcher/team Hi everyone! I have created a unified settings panel design for both preinstalled and JSON-RPC plugins. Could you spare some time to review this update?

You just need to install the installer here. This installer is quick to install and fully compatible with existing Flow Launcher installations.

If you do not have JSON-RPC plugins, you can use my demo plugin. You need to download and extract the files into %APPDATA%\FlowLauncher\Plugins. Then restart FL to see the changes.

Thank you for your time, and I would greatly appreciate your thoughts! 😊

@cibere
Copy link
Contributor

cibere commented Mar 2, 2025

If you do not have JSON-RPC plugins, you can use my demo plugin. You need to download and extract the files into %APPDATA%\FlowLauncher\Plugins. Then restart FL to see the changes.

btw you can just run the following command with the package manager to install it:

pm install https://github.com/user-attachments/files/19041646/Hello.World.Python-1.0.0.zip

This comment has been minimized.

Copy link

github-actions bot commented Mar 5, 2025

@check-spelling-bot Report

🔴 Please review

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

❌ Errors Count
❌ forbidden-pattern 22
⚠️ ignored-expect-variant 1
⚠️ 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 changed the title Unify Settings Panel Design Unify Settings Panel Design & Fix JsonRPC Settings Empty Issue Mar 6, 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 enhancement New feature or request kind/ui related to UI, icons, themes, etc
Projects
None yet
4 participants