Skip to content

Conversation

onesounds
Copy link
Contributor

@onesounds onesounds commented Jun 25, 2024

What's the PR

Detail

  • Added a QtTabBar in "File Manager" entry.
  • For new installations, the qttabbar setting is listed.
  • Existing users are not listing. but if user add and select "qttabbar" (in name. case-insensitive), it will behave as a qttabbar.

Test Cases

  • opening in tabs in qttabbar.
  • Doesn't affect existing user settings.

Copy link
Contributor

coderabbitai bot commented Jun 25, 2024

Walkthrough

Walkthrough

The recent updates to the Flow Launcher application improve its compatibility with the QTTabBar tool in Windows 10. Custom explorer configurations now support dynamic directory path replacements, allowing users to open directories in existing QTTabBar tabs. Additionally, UI elements have been visually refined, and language instructions for file manager configurations have been clarified.

Changes

Files Change Summary
Flow.Launcher.Infrastructure/UserSettings/Settings.cs Added a new item for QTTabBar in the CustomExplorer property for custom explorer configurations.
Flow.Launcher/PublicAPIInstance.cs Enhanced the OpenDirectory method to support custom explorers, dynamically replacing %d placeholders in paths and arguments with the directory path parameter.
Flow.Launcher/SelectFileManagerWindow.xaml Modified margins, orientations, alignments, and sizes of various UI components to refine the layout and visual presentation of the file manager window.
Flow.Launcher/Languages/en.xaml Revised language instructions to clarify the usage of arguments like %d for directory paths and %f for file paths when configuring 3rd party file managers.

Sequence Diagram(s)

Silent ignore.

Assessment against linked issues

Objective Addressed Explanation
Ensure compatibility with QTTabBar for opening directories in existing tabs (#2790)
Dynamically replace %d placeholder in custom explorer configurations (#2790)
Refine UI elements in the file manager window
Clarify instructions for specifying file manager locations and arguments

Poem

In Flow's new dawn, QTTabBar shines bright,
Custom paths, dynamic flights in sight.
UI refined with elegant grace,
Clear instructions now take their place.
Flow Launcher hops with lively cheer,
Opening tabs without a fear.
🎉🐇✨


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bdbde14 and 6476e54.

Files selected for processing (1)
  • Flow.Launcher/Languages/en.xaml (1 hunks)
Additional comments not posted (2)
Flow.Launcher/Languages/en.xaml (2)

292-292: Instructions for specifying file manager location are clear.

The instructions provide necessary details on using %d for directory paths and %f for file paths.


293-293: Example for using file manager commands is clear.

The example includes specific instructions for QTTabBar, explaining the usage of %d and leaving other fields blank as needed.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@prlabeler prlabeler bot added the enhancement New feature or request label Jun 25, 2024

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

@onesounds onesounds self-assigned this Jun 25, 2024
@prlabeler prlabeler bot added the bug Something isn't working label Jun 25, 2024

This comment has been minimized.

This comment has been minimized.

Copy link
Member

@jjw24 jjw24 left a comment

Choose a reason for hiding this comment

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

We need to handle the scenario where the new OTTabBar entry should show up on existing user data, because the way the code loads the existing user settings it won't load the new entry in unless it's a fresh install.

@onesounds
Copy link
Contributor Author

We need to handle the scenario where the new OTTabBar entry should show up on existing user data, because the way the code loads the existing user settings it won't load the new entry in unless it's a fresh install.

I agree, but I don't know how to do it. I considered adding a separate setting for this item for existing user, but there was no proper location. (And since qtttabbar is not being maintained. so I didn't want to add a setting menu for this.)

Let me ask chatgpt...

@onesounds
Copy link
Contributor Author

We need to handle the scenario where the new OTTabBar entry should show up on existing user data, because the way the code loads the existing user settings it won't load the new entry in unless it's a fresh install. In this case, the qttabbar is an item that cannot be deleted.

Now, there are three ways to support this. I can work with 1 or 2.

  1. Each time the user launches, we check the user's settings to see if the "qttabbar" entry exists, and if not, we add it to the list.

  2. Add qttabbar and explorer as user-immutable constant entries and adjust the list.
    In this case, we either have to risk messing with existing users' FileManager settings(settings.CustomExplorerIndex), or we have to reset it and change it to store and recognize by "name" (string). Also, in this case, qttabbar, which should be lower in the support list, is occupying the second list.

3.If the user doesn't have qttabbar setting, it should be added automatically, and if it is already added, it should not be added again if the user subsequently deletes it. I don't think I can do this, and while it's probably possible, it results in an incredibly complex structure. Is there any other easy way to do this?

This is entirely down to me structuring it incorrectly at the beginning, However, I don't know if it's worth adding such a structure for this utility. Given the importance of qttabbar support, I think my PR state is good enough. I can't do 3. After reviewing all 3, I still think what I proposed is the right way to go, but if you want to do 1 and 2 to add a qttabbar item to the list that almost all existing users will never use, that's fine. Just pick one and let me know.

@onesounds
Copy link
Contributor Author

I'm closing that PR because I don't think my plan is clear and it's causing confusion. If I come up with a new idea, I'll write a new one, or others can make one.

@onesounds onesounds closed this Jun 27, 2024
@jjw24 jjw24 reopened this Jun 27, 2024

This comment has been minimized.

This comment has been minimized.

@jjw24 jjw24 force-pushed the 240625-QtTabBar branch from 7e6f504 to 0656568 Compare July 1, 2024 10:59

This comment has been minimized.

greater flexibility with custom explorer profile
@jjw24 jjw24 force-pushed the 240625-QtTabBar branch from 0656568 to c0afb19 Compare July 1, 2024 11:02

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

Outside diff range and nitpick comments (1)
Flow.Launcher/PublicAPIInstance.cs (1)

Line range hint 232-247: Consider adding error handling for process start.

Currently, there is no error handling if the process fails to start. Consider adding a try-catch block to handle potential exceptions.

try
{
    using var process = new Process();
    process.StartInfo = new ProcessStartInfo
    {
        FileName = explorerInfo.Path.Replace("%d", DirectoryPath),
        UseShellExecute = true,
        Arguments = FileNameOrFilePath is null
            ? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath)
            : explorerInfo.FileArgument
                .Replace("%d", DirectoryPath)
                .Replace("%f",
                    Path.IsPathRooted(FileNameOrFilePath) ? FileNameOrFilePath : Path.Combine(DirectoryPath, FileNameOrFilePath)
                )
    };
    process.Start();
}
catch (Exception ex)
{
    LogException(nameof(PublicAPIInstance), "Failed to start process", ex);
}

@jjw24
Copy link
Member

jjw24 commented Jul 1, 2024

I'm closing that PR because I don't think my plan is clear and it's causing confusion. If I come up with a new idea, I'll write a new one, or others can make one.

Thanks for helping to investigate how to get QTTabBar integrated. We just need to do a slight tweaking that will have less complexity, please see my commit. The commit will allow QTTabBar be added as a custom profile, which means there is no need to provide backwards support for a new default profile. We can add it like this:

image

Tested:

  • QTTabBar works with the setup in the image
  • Switching back to Explorer profile and opening directory works as a new window.

@jjw24
Copy link
Member

jjw24 commented Jul 1, 2024

@onesounds could you please help make the change to allow the 'Arg For Folder' and 'Arg For File' fields to be blank.

@onesounds
Copy link
Contributor Author

'Arg For Folder' and 'Arg For File'

@jjw24 Done.

This comment has been minimized.

Copy link

github-actions bot commented Jul 7, 2024

@check-spelling-bot Report

🔴 Please review

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

❌ Errors Count
❌ ignored-expect-variant 1
⚠️ 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.

@jjw24 jjw24 added bug Something isn't working and removed enhancement New feature or request 1 min review bug Something isn't working labels Jul 7, 2024
@jjw24 jjw24 added this to the 1.19.0 milestone Jul 7, 2024
@jjw24 jjw24 enabled auto-merge July 7, 2024 07:57
@jjw24 jjw24 merged commit 7ef623a into Flow-Launcher:dev Jul 7, 2024
Copy link

gitstream-cm bot commented Jul 7, 2024

 /:\ gitStream DRY RUN 

gitstream/estimated_time_to_review

• add label 5 min review with color fbca04

gitstream/explain_code_experts

• add explain code experts comment:

🥷 Code experts: jjw24

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

See details

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

jjw24 onesounds
JUL 2 additions & 2 deletions
JUN 2 additions & 2 deletions 9 additions & 0 deletions
MAY 16 additions & 4 deletions
APR 6 additions & 6 deletions 47 additions & 17 deletions
MAR
FEB

Knowledge based on git-blame:
onesounds: 46%
jjw24: 8%

Flow.Launcher/PublicAPIInstance.cs

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 33 additions & 14 deletions
MAY
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 17%
onesounds: 1%

Flow.Launcher/SelectFileManagerWindow.xaml

Activity based on git-commit:

jjw24 onesounds
JUL 22 additions & 28 deletions
JUN
MAY
APR
MAR
FEB

Knowledge based on git-blame:
onesounds: 96%

Flow.Launcher.Core/Flow.Launcher.Core.csproj

Activity based on git-commit:

jjw24 onesounds
JUL
JUN
MAY
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 14%

Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj

Activity based on git-commit:

jjw24 onesounds
JUL
JUN
MAY
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 13%

Flow.Launcher.Test/Flow.Launcher.Test.csproj

Activity based on git-commit:

jjw24 onesounds
JUL
JUN
MAY
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 22%

Flow.Launcher/Languages/fr.xaml

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 29 additions & 4 deletions
MAY 44 additions & 4 deletions
APR 2 additions & 0 deletions
MAR
FEB

Knowledge based on git-blame:
jjw24: 99%

Flow.Launcher/Languages/sk.xaml

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 32 additions & 7 deletions
MAY 45 additions & 5 deletions
APR 2 additions & 0 deletions
MAR 1 additions & 1 deletions
FEB

Knowledge based on git-blame:
jjw24: 96%
onesounds: 1%

Flow.Launcher/Languages/vi.xaml

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 41 additions & 16 deletions
MAY 426 additions & 0 deletions
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 100%

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

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 20 additions & 7 deletions
MAY
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 99%

Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-pt.xaml

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 20 additions & 7 deletions
MAY
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 66%

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

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 30 additions & 17 deletions
MAY 145 additions & 0 deletions
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 100%

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

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 32 additions & 14 deletions
MAY 75 additions & 62 deletions
APR
MAR
FEB

Knowledge based on git-blame:
onesounds: 55%

Plugins/Flow.Launcher.Plugin.Program/Languages/vi.xaml

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 6 additions & 4 deletions
MAY 93 additions & 0 deletions
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 100%

Plugins/Flow.Launcher.Plugin.Shell/Languages/vi.xaml

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 2 additions & 2 deletions
MAY 17 additions & 0 deletions
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 100%

Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.vi-VN.resx

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 9 additions & 9 deletions
MAY 2515 additions & 0 deletions
APR
MAR
FEB

Knowledge based on git-blame:
jjw24: 100%

README.md

Activity based on git-commit:

jjw24 onesounds
JUL
JUN 4 additions & 4 deletions 13 additions & 14 deletions
MAY 2 additions & 2 deletions
APR
MAR
FEB 1 additions & 0 deletions

Knowledge based on git-blame:
onesounds: 31%
jjw24: 26%

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

gitstream/percent_new_code

• add comment This PR is 52.21238938053098% new code.

gitstream/request_screenshot

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

To activate these actions - merge this PR into the main branch


Learn more on the gitStream Docs
See your automations on the Usage in LinearB
Create new rules on the gitSteam playground

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.

BUG: Flow Launcher not invoking / opening Tab in QTTabBar in Windows 10

2 participants