Skip to content

Improve Quick Access Link Adding UI #3739

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 12 commits into from
Jun 17, 2025

Conversation

onesounds
Copy link
Contributor

@onesounds onesounds commented Jun 17, 2025

What's the PR

image

Details:

  • Currently, when adding a new Quick Access entry in the Explorer plugin, only a folder selection dialog is shown.

  • However, since Quick Access already supports files and drive volumes, it would be better if users could select files or other locations as well when clicking "Browse."

  • The standard dialog requires using separate dialogs for selecting files or folders.

  • Therefore, I added a Type radio selection. Depending on the selected type, the appropriate dialog will be shown when clicking the "Browse" button.

  • The Type selection only affects the behavior of the Browse button.

  • Default selection is set to File.

Test Case:

  • Verify that the dialog type changes correctly based on the selected type.

- Updated "Name" and "Path" keys and added new keys in en.xaml.
- Modified QuickAccessLinkSettings.xaml: increased Window height and improved layout using Grid structure.
- Added new UI elements: implemented radio buttons for file/folder selection.
- Added and initialized QuickAccessLinks property in QuickAccessLinkSettings.xaml.cs.
- Added file selection dialog in SelectPath_OnClick method.
- Added IsFileSelected and IsFolderSelected properties to implement selection functionality.

This comment has been minimized.

Copy link

gitstream-cm bot commented Jun 17, 2025

🥷 Code experts: Jack251970

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Activity based on git-commit:

Jack251970
JUN 7 additions & 0 deletions
MAY 10 additions & 2 deletions
APR
MAR
FEB
JAN

Knowledge based on git-blame:
Jack251970: 9%

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

Activity based on git-commit:

Jack251970
JUN
MAY
APR
MAR
FEB
JAN

Knowledge based on git-blame:

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

Activity based on git-commit:

Jack251970
JUN 45 additions & 50 deletions
MAY
APR
MAR
FEB
JAN

Knowledge based on git-blame:
Jack251970: 29%

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

Copy link
Contributor

coderabbitai bot commented Jun 17, 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 6 minutes and 42 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 054ee4c and bc8e77a.

📒 Files selected for processing (7)
  • Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj (1 hunks)
  • Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs (2 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/ActionKeywordModel.cs (2 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs (2 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml.cs (6 hunks)
📝 Walkthrough

Walkthrough

The Explorer plugin's Quick Access Link feature was updated to allow users to select either files or folders as shortcuts. UI elements and localization resources were adjusted to support this, including new radio buttons for type selection and updated resource strings. The selection dialog now adapts based on the chosen type.

Changes

Files/Groups Change Summary
Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml Updated resource strings: removed colons, added keys for "Type," "File," and "Folder."
Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml Restructured UI: added radio buttons for file/folder type, reorganized layout, improved spacing.
Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml.cs Added support for file/folder selection, new properties for type, updated dialog logic.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant QuickAccessLinkSettings (UI)
    participant QuickAccessLinkSettings.xaml.cs (Logic)
    participant FileDialog
    participant FolderDialog

    User->>QuickAccessLinkSettings (UI): Open Quick Access Link Settings
    QuickAccessLinkSettings (UI)->>User: Show "File" and "Folder" radio buttons
    User->>QuickAccessLinkSettings (UI): Select "File" or "Folder"
    User->>QuickAccessLinkSettings (UI): Click "Select" for Path
    QuickAccessLinkSettings (UI)->>QuickAccessLinkSettings.xaml.cs: Trigger SelectPath_OnClick
    alt IsFileSelected
        QuickAccessLinkSettings.xaml.cs->>FileDialog: Open file selection dialog
        FileDialog-->>QuickAccessLinkSettings.xaml.cs: Return selected file path
    else IsFolderSelected
        QuickAccessLinkSettings.xaml.cs->>FolderDialog: Open folder selection dialog
        FolderDialog-->>QuickAccessLinkSettings.xaml.cs: Return selected folder path
    end
    QuickAccessLinkSettings.xaml.cs->>QuickAccessLinkSettings (UI): Update Path field
Loading

Suggested labels

kind/ui, Explorer Plugin

Suggested reviewers

  • onesounds

Poem

In Explorer’s den, a choice unfolds,
File or folder, the story told.
Radio buttons side by side,
Paths selected with joy and pride.
A rabbit hops with gleeful cheer,
New shortcuts made, the way is clear! 🐇✨

✨ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @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 generate sequence diagram to generate a sequence diagram of the changes in 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

🔭 Outside diff range comments (2)
Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml.cs (2)

118-126: Type property is not persisted for new links

When adding a new AccessLink, you omit the Type:

var newAccessLink = new AccessLink
{
    Name = SelectedName,
    Path = SelectedPath
};

Down-stream consumers will treat the link as “Unknown”.
Inject the selected type:

+    Type = IsFileSelected
+        ? AccessLink.LinkType.File
+        : AccessLink.LinkType.Folder,

99-113: Editing scenario ignores updated type

In edit mode you keep SelectedAccessLink.Type, even if the user toggles File/Folder.
Assign the freshly chosen type as shown above.

🧹 Nitpick comments (1)
Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml (1)

68-79: Minor: redundant stacked panels & empty rows

The outer <StackPanel> + inner <StackPanel> + <Grid> triple-nest adds unnecessary visual tree depth.
Consider removing the middle anonymous StackPanel and set the margin on the Grid directly – simpler and cheaper.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 00a80ae and 52da1c9.

📒 Files selected for processing (3)
  • Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml (3 hunks)
  • Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml.cs (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (3)
Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml (1)

101-105: Duplicate-key/ backward-compatibility check

You replaced the old plugin_explorer_name, plugin_explorer_path values and re-added them here without the trailing colon.
Please confirm that:

  1. The old “Name:” / “Path:” entries were removed from every language file.
  2. No other key with the same name still exists earlier in this resource dictionary (duplicate keys crash the XAML parser on load).

If both conditions aren’t met the app will throw at startup.

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

104-118: RadioButton bindings are one-way – selection never reaches code-behind

IsChecked="{Binding IsFileSelected}" / IsFolderSelected default to OneWay, meaning user clicks do not update the booleans used in SelectPath_OnClick.
Result: IsFileSelected remains false; the file dialog is never shown.

-IsChecked="{Binding IsFileSelected}"
+IsChecked="{Binding IsFileSelected, Mode=TwoWay}"
...
-IsChecked="{Binding IsFolderSelected}"
+IsChecked="{Binding IsFolderSelected, Mode=TwoWay}"

Without TwoWay binding the new feature is effectively broken.

Likely an incorrect or invalid review comment.

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

131-157: Dialog branching relies on booleans that never change

Because of the one-way binding noted in XAML, IsFileSelected / IsFolderSelected never reflect user input, so this block always falls into the folder branch.
Once the binding is fixed, also mark the properties with OnPropertyChanged() when altered to refresh the UI if needed.

Additionally, add a DefaultExt / Filter to OpenFileDialog to improve UX.

This comment has been minimized.

@Jack251970 Jack251970 added the enhancement New feature or request label Jun 17, 2025
@Jack251970 Jack251970 added this to the 2.0.0 milestone Jun 17, 2025

This comment has been minimized.

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 and Warnings Count
❌ forbidden-pattern 22
⚠️ non-alpha-in-dictionary 13

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.

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.

Pull Request Overview

This PR enhances the Quick Access Link dialog by adding a Type selector (File/Folder) and updating the UI layout and design, while also migrating view classes to use the CommunityToolkit.Mvvm source generators.

  • Added a Type radio group and dynamic Browse behavior in QuickAccessLinkSettings.
  • Converted several Views to [INotifyPropertyChanged] and removed manual INotifyPropertyChanged implementations.
  • Updated XAML layouts, labels, sizes, and window dimensions; added new localization keys.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
QuickAccessLinkSettings.xaml.cs Added ResultType logic, refactored dialog branches, removed manual change events
QuickAccessLinkSettings.xaml Switched to a Grid layout and added Type radio buttons
PreviewPanel.xaml.cs Removed manual INotifyPropertyChanged, decorated with [INotifyPropertyChanged]
ExplorerSettings.xaml Cleaned up unused xmlns
ActionKeywordSetting.xaml.cs Replaced manual PC events with [INotifyPropertyChanged] and SetProperty
ActionKeywordModel.cs Moved to ViewModels namespace, inherits BaseModel
en.xaml Added localization for "Type", "File", and "Folder"
SettingsControl.xaml.cs Added [INotifyPropertyChanged], removed manual events
Flow.Launcher.Plugin.BrowserBookmark.csproj Added CommunityToolkit.Mvvm package reference

@onesounds onesounds merged commit 3688837 into Flow-Launcher:dev Jun 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants