Skip to content

Conversation

AWAS666
Copy link

@AWAS666 AWAS666 commented Oct 9, 2025

Closes #3773

This is still missing some translations though and it also adds a settings panel to the url plugin.

There are some other unused properties in this plugin, not sure if these can be deleted?

Also default behaviour is http but I think https should be the state of the art at this point

@github-actions github-actions bot added this to the 2.1.0 milestone Oct 9, 2025
Copy link

gitstream-cm bot commented Oct 9, 2025

🥷 Code experts: jjw24, Jack251970

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

See details

Plugins/Flow.Launcher.Plugin.Url/Languages/de.xaml

Activity based on git-commit:

Jack251970
OCT
SEP
AUG
JUL
JUN
MAY

Knowledge based on git-blame:
jjw24: 100%

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

Activity based on git-commit:

Jack251970
OCT
SEP
AUG
JUL
JUN
MAY

Knowledge based on git-blame:
jjw24: 33%

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

Activity based on git-commit:

Jack251970
OCT
SEP 7 additions & 7 deletions
AUG
JUL 1 additions & 1 deletions
JUN
MAY

Knowledge based on git-blame:
jjw24: 2%

Plugins/Flow.Launcher.Plugin.Url/Settings.cs

Activity based on git-commit:

Jack251970
OCT
SEP
AUG
JUL
JUN
MAY

Knowledge based on git-blame:
jjw24: 22%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

Copy link

gitstream-cm bot commented Oct 9, 2025

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

@coderabbitai coderabbitai bot added the enhancement New feature or request label Oct 9, 2025
Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

📝 Walkthrough

Walkthrough

Adds an "Always open with HTTPS" boolean setting and UI to the Url plugin, updates Main to implement ISettingProvider and use that preference when normalizing URLs, adds localization entries, and wraps URL opening in a try/catch. Includes ViewModel and XAML UserControl for settings.

Changes

Cohort / File(s) Summary
Localization
Plugins/Flow.Launcher.Plugin.Url/Languages/en.xaml, Plugins/Flow.Launcher.Plugin.Url/Languages/de.xaml
Added resource key flowlauncher_plugin_url_usehttps with English and German values for the new setting label.
Plugin core
Plugins/Flow.Launcher.Plugin.Url/Main.cs
Main now implements ISettingProvider. Added GetHttpPreference() and CreateSettingPanel(). URL normalization uses the preference (case-insensitive scheme checks). Opening URLs is wrapped in try/catch to show errors.
Settings model
Plugins/Flow.Launcher.Plugin.Url/Settings.cs
Added public bool AlwaysOpenWithHttps { get; set; } = false;.
Settings ViewModel
Plugins/Flow.Launcher.Plugin.Url/SettingsViewModel.cs
New SettingsViewModel exposing a read-only Settings property and deriving from BaseModel.
Settings UI (XAML)
Plugins/Flow.Launcher.Plugin.Url/URLSettings.xaml
New UserControl with a checkbox TwoWay-bound to Settings.AlwaysOpenWithHttps and label using flowlauncher_plugin_url_usehttps.
Settings UI (code-behind)
Plugins/Flow.Launcher.Plugin.Url/URLSettings.xaml.cs
New URLSettings : UserControl that constructs a SettingsViewModel, sets DataContext, and calls InitializeComponent.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as URLSettings (UI)
  participant Main as Url Plugin Main
  participant Settings as Settings
  participant API as Flow API

  User->>UI: Toggle "Prefer https over http"
  UI->>Settings: Update AlwaysOpenWithHttps (TwoWay bind)

  User->>Main: Enter URL (without scheme)
  Main->>Settings: Read AlwaysOpenWithHttps
  alt AlwaysOpenWithHttps = true
    Main->>Main: Scheme = "https"
  else
    Main->>Main: Scheme = "http"
  end
  Main->>Main: Normalize URL with selected scheme
  Main->>API: OpenUrl(normalized)
  alt OpenUrl throws
    API--x Main: Exception
    Main->>API: Show error message
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • Jack251970
  • jjw24

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The title concisely and accurately describes the main addition of a setting to prefer HTTPS over HTTP for URLs in the plugin.
Linked Issues Check ✅ Passed The changes implement the requested enhancement by adding a user-configurable preference to open URLs with HTTPS by default, integrate it into the UI, and maintain support for HTTP, thereby fulfilling the linked issue requirements.
Out of Scope Changes Check ✅ Passed All modifications are scoped to adding the HTTPS preference, its localization, UI integration, and corresponding logic, with no unrelated or extraneous changes detected.
Description Check ✅ Passed The pull request description clearly references the linked issue, describes the addition of the settings panel and missing translations, and directly relates to the changes introduced.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a373e1 and ae3559c.

📒 Files selected for processing (1)
  • Plugins/Flow.Launcher.Plugin.Url/Main.cs (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
Plugins/Flow.Launcher.Plugin.Url/Main.cs (1)
Plugins/Flow.Launcher.Plugin.Url/URLSettings.xaml.cs (2)
  • URLSettings (5-15)
  • URLSettings (9-14)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: gitStream.cm
🔇 Additional comments (1)
Plugins/Flow.Launcher.Plugin.Url/Main.cs (1)

62-69: Scheme detection fix looks correct.

Explicitly checking for both http:// and https:// before prefixing resolves the double-prefix bug from the earlier revision while keeping existing schemes intact. ✅


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

Comment @coderabbitai help to get the list of available commands and usage tips.

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 (2)
Plugins/Flow.Launcher.Plugin.Url/SettingsViewModel.cs (1)

1-2: Remove unused imports.

Neither System.Collections.Generic nor System.Linq are used in this file.

Apply this diff:

-using System.Collections.Generic;
-using System.Linq;
-
 namespace Flow.Launcher.Plugin.Url;
Plugins/Flow.Launcher.Plugin.Url/URLSettings.xaml.cs (1)

7-7: Consider removing the unused field.

The _viewModel field is assigned but never read. Since DataContext is set directly, the field is not needed.

Apply this diff if you want to simplify:

 public partial class URLSettings : UserControl
 {
-    private readonly SettingsViewModel _viewModel;
-
     public URLSettings(Settings settings)
     {
-        _viewModel = new SettingsViewModel(settings);
-        DataContext = _viewModel;
+        DataContext = new SettingsViewModel(settings);
         InitializeComponent();
     }
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ae159d and 1a373e1.

📒 Files selected for processing (7)
  • Plugins/Flow.Launcher.Plugin.Url/Languages/de.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Url/Languages/en.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Url/Main.cs (4 hunks)
  • Plugins/Flow.Launcher.Plugin.Url/Settings.cs (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Url/SettingsViewModel.cs (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Url/URLSettings.xaml (1 hunks)
  • Plugins/Flow.Launcher.Plugin.Url/URLSettings.xaml.cs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
Plugins/Flow.Launcher.Plugin.Url/SettingsViewModel.cs (2)
Plugins/Flow.Launcher.Plugin.Url/Settings.cs (1)
  • Settings (3-9)
Plugins/Flow.Launcher.Plugin.ProcessKiller/ViewModels/SettingsViewModel.cs (1)
  • SettingsViewModel (3-6)
Plugins/Flow.Launcher.Plugin.Url/URLSettings.xaml.cs (2)
Plugins/Flow.Launcher.Plugin.Url/SettingsViewModel.cs (1)
  • SettingsViewModel (6-9)
Plugins/Flow.Launcher.Plugin.Url/Settings.cs (1)
  • Settings (3-9)
Plugins/Flow.Launcher.Plugin.Url/Main.cs (1)
Plugins/Flow.Launcher.Plugin.Url/URLSettings.xaml.cs (2)
  • URLSettings (5-15)
  • URLSettings (9-14)
🪛 GitHub Check: Check Spelling
Plugins/Flow.Launcher.Plugin.Url/URLSettings.xaml

[warning] 28-28:
usehttps is not a recognized word. (unrecognized-spelling)

🔇 Additional comments (8)
Plugins/Flow.Launcher.Plugin.Url/Languages/de.xaml (1)

17-19: LGTM!

The German localization for the HTTPS preference setting is properly added and the translation is accurate.

Plugins/Flow.Launcher.Plugin.Url/Settings.cs (1)

8-8: LGTM!

The new AlwaysOpenWithHttps property is well-named with a sensible default that maintains backward compatibility.

Plugins/Flow.Launcher.Plugin.Url/SettingsViewModel.cs (1)

6-9: LGTM!

The ViewModel structure is clean and follows the pattern used in other plugins (e.g., ProcessKiller plugin). The primary constructor syntax is modern and concise.

Plugins/Flow.Launcher.Plugin.Url/Languages/en.xaml (1)

18-19: LGTM!

The English localization for the HTTPS preference setting is properly added and clearly worded.

Plugins/Flow.Launcher.Plugin.Url/URLSettings.xaml (1)

1-31: LGTM!

The settings UI is properly structured with correct two-way binding for the checkbox and dynamic resource lookup for localization. The static analysis warning about "usehttps" is a false positive—it's part of a valid resource key name.

Plugins/Flow.Launcher.Plugin.Url/Main.cs (3)

66-76: LGTM!

The try-catch block properly handles URL opening failures and displays an error message to the user, improving the robustness of the plugin.


84-87: LGTM!

The GetHttpPreference() helper method is clear and concise, encapsulating the preference logic.


123-126: LGTM!

The CreateSettingPanel() implementation correctly returns a settings UI bound to the plugin's settings instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 min review enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Option to prefer https:// urls
1 participant