Skip to content

Add setting to disable non-error notifications#4429

Open
1203zxy wants to merge 11 commits intoFlow-Launcher:devfrom
1203zxy:feature/disable-success-notifications
Open

Add setting to disable non-error notifications#4429
1203zxy wants to merge 11 commits intoFlow-Launcher:devfrom
1203zxy:feature/disable-success-notifications

Conversation

@1203zxy
Copy link
Copy Markdown

@1203zxy 1203zxy commented Apr 23, 2026

Description

Add option to disable success notifications.

Related Issue

Fixes #4423

Changes

  • Add DisableSuccessNotifications setting
  • Update notification logic to respect setting
  • Add UI toggle in General settings

Summary by cubic

Adds a setting to hide non-error notifications across Flow Launcher. Errors and forced messages still show; the Settings toggle text is clearer with small UI tweaks.

Summary of changes

  • Changed behavior: Public notifications now respect Settings.EnableSuccessNotification. Non-error ShowMsg calls are suppressed unless forceShown is true. Errors always display via ShowMsgError/ShowMsgErrorWithButton (updated callers incl. plugin init failures and Plugins Manager “already exists”). Standardized notifications in installer/manager/updater/Everything flows to pass iconPath: "", forceShown: true, and use the main window as owner.
  • New logic: Added EnableSuccessNotification (default true) with a General settings toggle labeled “Show more notifications” and tooltip (plus spacing and a header icon). Added IPublicAPI.ShowMsg(..., forceShown) and a JsonRPCPublicAPI overload; PublicAPIInstance gates display based on the setting and forceShown. Backward-compatible ShowMsg overloads retained.
  • Removed: None.
  • Memory impact: Negligible (one bool setting, two localization strings).
  • Security risks: None.
  • Unit tests: None added; verified manually via the toggle and plugin/update flows.
  • Minor refactor: Replaced internal _saveSettingsLock object with Lock; no behavior change.

Written for commit 9640686. Summary will update on new commits.

@github-actions github-actions Bot added this to the 2.2.0 milestone Apr 23, 2026
@coderabbitai coderabbitai Bot added the enhancement New feature or request label Apr 23, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new Settings flag EnableSuccessNotification (default true), exposes it in General settings with localization, and extends the Public API (and plugin RPC) with a forceShown parameter; callers were updated so non-error success messages can be suppressed when the setting is disabled.

Changes

Cohort / File(s) Summary
Settings model
Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Adds public bool EnableSuccessNotification { get; set; } = true;.
Localization (English)
Flow.Launcher/Languages/en.xaml
Adds enableSuccessNotification and enableSuccessNotificationToolTip resource entries.
UI — General settings
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
Adds a SettingsCard with a ToggleSwitch bound to Settings.EnableSuccessNotification.
Public API / plugin-facing API
Flow.Launcher/PublicAPIInstance.cs, Flow.Launcher.Core/Plugin/JsonRPCV2Models/JsonRPCPublicAPI.cs, Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
Introduces ShowMsg(..., bool forceShown = false) overload; PublicAPI checks Settings.EnableSuccessNotification and suppresses non-error messages unless forceShown is true or icon is error; forwarders updated.
Call-site updates
Flow.Launcher.Core/Plugin/PluginManager.cs, Flow.Launcher.Core/Updater.cs, Plugins/.../EverythingDownloadHelper.cs, Plugins/.../PluginsManager.cs, Flow.Launcher.Core/Plugin/PluginInstaller.cs
Updated message calls to pass iconPath: "" and/or forceShown: true; several info messages switched to ShowMsgError to guarantee display; no control flow beyond notification behavior changed.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Caller (plugin/feature)
    participant PublicAPI as PublicAPIInstance
    participant Settings as Settings (EnableSuccessNotification)
    participant Notifier as Notification Service

    Caller->>PublicAPI: ShowMsg(title, subtitle, iconPath, useMainWindowAsOwner?, forceShown?)
    PublicAPI->>Settings: read EnableSuccessNotification
    alt forceShown == true
        PublicAPI->>Notifier: Notification.Show(...)
    else if EnableSuccessNotification == false AND iconPath.toLower() != Constant.ErrorIcon.toLower()
        PublicAPI-->>Caller: return (suppressed)
    else
        PublicAPI->>Notifier: Notification.Show(...)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jjw24
  • onesounds
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses the second part of issue #4423 (disable in-app success notifications) but does not address the first part (advanced content search within documents). This PR only implements the notification settings feature from #4423 and omits the advanced document content search feature. Either implement both features or update the linked issue to reflect that this PR only addresses notifications.
Docstring Coverage ⚠️ Warning Docstring coverage is 39.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a setting to disable non-error notifications, which is the primary objective of the PR.
Out of Scope Changes check ✅ Passed All code changes are directly related to implementing the success notification toggle setting and its enforcement across notification call sites, with no unrelated modifications detected.
Description check ✅ Passed The PR description accurately describes the changeset, including the new EnableSuccessNotification setting, UI toggle, and gating logic for notifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown
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: 2

🧹 Nitpick comments (1)
Flow.Launcher/PublicAPIInstance.cs (1)

130-153: Extract the suppression check into a small helper to avoid duplication.

The same 4-line guard is duplicated in ShowMsg and ShowMsgWithButton. A tiny helper keeps the intent in one place and makes future tweaks (e.g., also comparing against other non-error icons) straightforward.

♻️ Suggested refactor
+        private bool ShouldSuppressNonErrorNotification(string iconPath) =>
+            _settings.DisableSuccessNotifications &&
+            !string.Equals(iconPath, Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase);
+
         public void ShowMsg(string title, string subTitle, string iconPath, bool useMainWindowAsOwner = true)
         {
-            if (_settings.DisableSuccessNotifications &&
-                !string.Equals(iconPath, Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase))
-            {
-                return;
-            }
+            if (ShouldSuppressNonErrorNotification(iconPath)) return;

             Notification.Show(title, subTitle, iconPath);
         }
@@
         public void ShowMsgWithButton(string title, string buttonText, Action buttonAction, string subTitle, string iconPath, bool useMainWindowAsOwner = true)
         {
-            if (_settings.DisableSuccessNotifications &&
-                !string.Equals(iconPath, Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase))
-            {
-                return;
-            }
+            if (ShouldSuppressNonErrorNotification(iconPath)) return;

             Notification.ShowWithButton(title, buttonText, buttonAction, subTitle, iconPath);
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Flow.Launcher/PublicAPIInstance.cs` around lines 130 - 153, Extract the
duplicated suppression guard into a small private helper (e.g., bool
ShouldSuppressNotification(string iconPath)) that returns
_settings.DisableSuccessNotifications && !string.Equals(iconPath,
Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase); then replace the
four-line guards in ShowMsg and ShowMsgWithButton to call
ShouldSuppressNotification(iconPath) and return when true; keep remaining calls
to Notification.Show and Notification.ShowWithButton unchanged so behavior is
preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Flow.Launcher/PublicAPIInstance.cs`:
- Around line 132-136: The current guard in PublicAPIInstance.cs treats only
Constant.ErrorIcon as an "error" so custom error-like icons passed to
ShowMsg(...) or ShowMsgWithButton(...) can be suppressed when
_settings.DisableSuccessNotifications is true; add XML documentation comments to
the IPublicAPI members (e.g., ShowMsg, ShowMsgWithButton, ShowMsgError,
ShowMsgErrorWithButton) explaining this behavior and advising plugin authors to
call ShowMsgError/ShowMsgErrorWithButton for error messages (or use
Constant.ErrorIcon) so their error notifications are not hidden; reference
Constant.ErrorIcon and the guard in PublicAPIInstance.cs in the docs for
clarity.

In `@Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml`:
- Around line 95-103: The SettingsPane shows a double-negative: the SettingsCard
header reads as "Disable..." while the ToggleSwitch uses OnContent/OffContent
"Enable"/"Disable", which is confusing; update either the header to a positive
phrasing (e.g., "ShowSuccessNotifications") and invert the bound value for
ToggleSwitch IsOn by using a Boolean inverter converter or renaming the bound
property (Settings.DisableSuccessNotifications ->
Settings.ShowSuccessNotifications), or keep the negative property and simply
remove the ToggleSwitch OnContent/OffContent attributes so the control uses its
default visuals; apply the same change consistently to other toggles in this
pane (references: ui:SettingsCard, ui:ToggleSwitch,
Settings.DisableSuccessNotifications, OnContent, OffContent).

---

Nitpick comments:
In `@Flow.Launcher/PublicAPIInstance.cs`:
- Around line 130-153: Extract the duplicated suppression guard into a small
private helper (e.g., bool ShouldSuppressNotification(string iconPath)) that
returns _settings.DisableSuccessNotifications && !string.Equals(iconPath,
Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase); then replace the
four-line guards in ShowMsg and ShowMsgWithButton to call
ShouldSuppressNotification(iconPath) and return when true; keep remaining calls
to Notification.Show and Notification.ShowWithButton unchanged so behavior is
preserved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 009c9a45-f2ea-4cfb-aa75-29d8b5615945

📥 Commits

Reviewing files that changed from the base of the PR and between d0d41c6 and b80b4a6.

📒 Files selected for processing (4)
  • Flow.Launcher.Infrastructure/UserSettings/Settings.cs
  • Flow.Launcher/Languages/en.xaml
  • Flow.Launcher/PublicAPIInstance.cs
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Comment thread Flow.Launcher/PublicAPIInstance.cs Outdated
Comment thread Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
Copy link
Copy Markdown
Member

@Jack251970 Jack251970 left a comment

Choose a reason for hiding this comment

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

Double-negative toggle wording may confuse users.

I think we should change this option to EnableSuccessNotification

@1203zxy 1203zxy requested a review from Jack251970 April 26, 2026 05:54
@1203zxy
Copy link
Copy Markdown
Author

1203zxy commented Apr 26, 2026

Double-negative toggle wording may confuse users.

I think we should change this option to EnableSuccessNotification

Ok, I'll update the option to EnableSuccessNotification to avoid the double-negative wording confusion.

Copy link
Copy Markdown
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 (1)
Flow.Launcher/PublicAPIInstance.cs (1)

130-153: Optional: extract the suppression check to a small helper to avoid duplication.

The same guard is repeated verbatim in ShowMsg and ShowMsgWithButton. A tiny helper keeps the policy in one place so any future refinement (e.g., recognizing additional error-icon variants) only has to change once.

♻️ Proposed refactor
+        private bool ShouldSuppressNotification(string iconPath) =>
+            !_settings.EnableSuccessNotification &&
+            !string.Equals(iconPath, Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase);
+
         public void ShowMsg(string title, string subTitle, string iconPath, bool useMainWindowAsOwner = true)
         {
-            if (!_settings.EnableSuccessNotification &&
-                !string.Equals(iconPath, Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase))
-            {
-                return;
-            }
+            if (ShouldSuppressNotification(iconPath)) return;

             Notification.Show(title, subTitle, iconPath);
         }

         public void ShowMsgWithButton(string title, string buttonText, Action buttonAction, string subTitle, string iconPath, bool useMainWindowAsOwner = true)
         {
-            if (!_settings.EnableSuccessNotification &&
-                !string.Equals(iconPath, Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase))
-            {
-                return;
-            }
+            if (ShouldSuppressNotification(iconPath)) return;

             Notification.ShowWithButton(title, buttonText, buttonAction, subTitle, iconPath);
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Flow.Launcher/PublicAPIInstance.cs` around lines 130 - 153, The duplicate
guard that checks _settings.EnableSuccessNotification and compares iconPath to
Constant.ErrorIcon appears in ShowMsg and ShowMsgWithButton; extract it into a
small helper (e.g., CanShowNotification or ShouldSuppressNotification) that
accepts the iconPath and returns a bool, then replace the inline checks in
ShowMsg and ShowMsgWithButton with that helper and keep the Notification.Show
and Notification.ShowWithButton calls unchanged so future policy changes are
applied in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Flow.Launcher/PublicAPIInstance.cs`:
- Around line 132-136: The current check using
_settings.EnableSuccessNotification together with iconPath/Constant.ErrorIcon
also suppresses in-progress/informational notifications (e.g., callers like
Updater.cs calling ShowMsg("Checking for new update") with empty iconPath), so
update the UI/tooltip and any related text to clearly state that this setting
controls non-error notifications (both success and informational pop-ups) while
errors are always shown; search for _settings.EnableSuccessNotification,
ShowMsg, Constant.ErrorIcon and update the displayed tooltip/label text (and any
user-facing help) to something like "Show non-error notifications (success and
informational pop-ups). Error notifications are always shown." Also apply the
same text change to the other occurrence referenced (lines 146-150).

---

Nitpick comments:
In `@Flow.Launcher/PublicAPIInstance.cs`:
- Around line 130-153: The duplicate guard that checks
_settings.EnableSuccessNotification and compares iconPath to Constant.ErrorIcon
appears in ShowMsg and ShowMsgWithButton; extract it into a small helper (e.g.,
CanShowNotification or ShouldSuppressNotification) that accepts the iconPath and
returns a bool, then replace the inline checks in ShowMsg and ShowMsgWithButton
with that helper and keep the Notification.Show and Notification.ShowWithButton
calls unchanged so future policy changes are applied in one place.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bdde3a67-9809-41b6-8f50-fdf4e72cf094

📥 Commits

Reviewing files that changed from the base of the PR and between b80b4a6 and ab854d5.

📒 Files selected for processing (4)
  • Flow.Launcher.Infrastructure/UserSettings/Settings.cs
  • Flow.Launcher/Languages/en.xaml
  • Flow.Launcher/PublicAPIInstance.cs
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Comment thread Flow.Launcher/PublicAPIInstance.cs Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Flow.Launcher.Infrastructure/UserSettings/Settings.cs">

<violation number="1" location="Flow.Launcher.Infrastructure/UserSettings/Settings.cs:465">
P2: Renaming this persisted setting without a compatibility migration breaks existing user settings files and will re-enable success notifications after upgrade.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Clarified the "enableSuccessNotification" label to indicate it enables all non-error notifications, not just success notifications.
Added forceShown to ShowMsg in IPublicAPI and updated PublicAPIInstance to support forced notifications. Error messages now always show regardless of user settings. Simplified ShowMsgWithButton to always display. Changed _saveSettingsLock to Lock type and made minor formatting improvements.
Added a new overload of the ShowMsg method in JsonRPCPublicAPI to support a forceShown parameter, enabling callers to control whether the message is forcibly displayed. This overload delegates to the underlying _api.ShowMsg with the new argument.
Refactored message display calls to use error-specific methods (e.g., ShowMsgError) and added iconPath and forceShown parameters. These changes improve user feedback and ensure consistent message presentation, especially for errors and update notifications.
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 8 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Flow.Launcher/PublicAPIInstance.cs">

<violation number="1" location="Flow.Launcher/PublicAPIInstance.cs:128">
P0: ShowMsg's 3-argument overload recursively calls itself, so normal notification calls overflow the stack instead of displaying a message.</violation>

<violation number="2" location="Flow.Launcher/PublicAPIInstance.cs:131">
P0: ShowMsg's 4-argument overload recursively calls itself, so callers that use the bool overload never reach the notification implementation.</violation>

<violation number="3" location="Flow.Launcher/PublicAPIInstance.cs:145">
P0: ShowMsgWithButton's short overload recursively calls itself, breaking button notifications and the error-button path.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread Flow.Launcher/PublicAPIInstance.cs Outdated
Comment thread Flow.Launcher/PublicAPIInstance.cs Outdated
Comment thread Flow.Launcher/PublicAPIInstance.cs Outdated
Explicitly set useMainWindowAsOwner and forceShown parameters in message and notification methods to ensure consistent notification display and ownership context. This improves reliability and fixes potential issues with notification visibility.
Copy link
Copy Markdown
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: 3

🧹 Nitpick comments (3)
Flow.Launcher/PublicAPIInstance.cs (1)

122-122: Nit: spacing in named arguments.

forceShown:true and useMainWindowAsOwner:useMainWindowAsOwner are missing the conventional space after the colon. Most of the codebase (and dotnet format defaults) uses name: value.

♻️ Proposed tweak
-            ShowMsg(title, subTitle, Constant.ErrorIcon, forceShown:true);
+            ShowMsg(title, subTitle, Constant.ErrorIcon, forceShown: true);
...
-            ShowMsg(title, subTitle, iconPath, useMainWindowAsOwner:useMainWindowAsOwner);
+            ShowMsg(title, subTitle, iconPath, useMainWindowAsOwner: useMainWindowAsOwner);

Also applies to: 131-131

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Flow.Launcher/PublicAPIInstance.cs` at line 122, The named-argument
formatting is inconsistent: update the calls to ShowMsg so named arguments
follow the "name: value" convention (add a space after the colon) — specifically
change occurrences using forceShown:true and
useMainWindowAsOwner:useMainWindowAsOwner to forceShown: true and
useMainWindowAsOwner: useMainWindowAsOwner in the ShowMsg(...) invocations to
match project formatting (e.g., the call within PublicAPIInstance.cs where
ShowMsg(title, subTitle, Constant.ErrorIcon, forceShown:true) is used and the
similar call at the later occurrence).
Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs (1)

139-147: Adding an abstract method to a public interface is a binary-breaking change for external implementers.

Anyone outside the repo who implements IPublicAPI (tests, alternative hosts, mocks) will fail to compile after this PR. Since the new overload is just a strict superset of the 4-arg one, consider giving it a default interface implementation that forwards to the existing overload, so external implementers aren't forced to update:

♻️ Optional: default interface implementation
-        void ShowMsg(string title, string subTitle, string iconPath, bool useMainWindowAsOwner = true, bool forceShown = false);
+        void ShowMsg(string title, string subTitle, string iconPath, bool useMainWindowAsOwner = true, bool forceShown = false)
+            => ShowMsg(title, subTitle, iconPath, useMainWindowAsOwner);

Then PublicAPIInstance overrides it as today. This preserves binary compat for third-party IPublicAPI implementers while giving plugins access to the new behavior when running against the official host.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs` around lines 139 - 147, You
added a new ShowMsg overload to IPublicAPI which is a binary-breaking change for
external implementers; make it a default interface implementation that forwards
to the existing 4-argument ShowMsg so external implementers aren’t forced to
recompile. In IPublicAPI provide a default body for the new ShowMsg(string
title, string subTitle, string iconPath, bool useMainWindowAsOwner = true, bool
forceShown = false) that simply calls the existing ShowMsg(title, subTitle,
iconPath, useMainWindowAsOwner), and keep PublicAPIInstance overriding behavior
as-is.
Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs (1)

113-114: Minor: alreadyexists is more "info/no-op" than "error".

Switching this to ShowMsgError will now display app_error.png (red error badge) and route through the always-shown path. The condition is simply "this plugin is already at this version, nothing to do" — not really an error, just an idempotent skip. The existing pattern elsewhere (e.g. Flow.Launcher/CustomShortcutSetting.xaml.cs:48-52) uses ShowMsgBox(Localize.duplicateShortcut()) for similar conflicts.

If the goal is just to ensure the message isn't suppressed when success notifications are off, an alternative is to keep ShowMsg and pass forceShown: true so the visual cue still says "informational" rather than "error".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs` around lines
113 - 114, Replace the error-style notification for the "already exists" case in
PluginsManager (the Context.API.ShowMsgError call) with an informational
notification: call
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_update_alreadyexists"),
forceShown: true) (or use
Context.API.ShowMsgBox/ShowMsgBox(Localize.duplicateShortcut()) pattern if you
prefer a modal) so the message is shown as an informational/no-op rather than an
error; leave the subsequent return in place.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs`:
- Line 146: The XML doc for the parameter forceShown incorrectly references a
non-existent setting name "Show more notifications"; update the doc comment in
IPublicAPI.cs for the forceShown parameter to reference the actual setting key
EnableSuccessNotification or use the user-facing label (e.g., "Show success
notifications") or a neutral descriptive phrase (e.g., "regardless of the user's
success notification setting") so plugin authors can find the correct toggle;
ensure the doc mentions the setting by its code name EnableSuccessNotification
and/or the user-facing label used in en.xaml and keep the description concise.

In `@Flow.Launcher/PublicAPIInstance.cs`:
- Around line 124-125: ShowMsgErrorWithButton currently calls the 6-arg
ShowMsgWithButton which doesn't honor the "always show on error" behavior in
ShowMsg; either mirror the gating logic there or plumb a forceShown flag
through. Update ShowMsgWithButton (the overload that calls
Notification.ShowWithButton) to check for iconPath == Constant.ErrorIcon (or
accept a bool forceShown parameter) and bypass EnableSuccessNotification when
true, and change ShowMsgErrorWithButton to pass forceShown=true (or call the new
overload) so error popups with buttons are always displayed.

In
`@Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingDownloadHelper.cs`:
- Around line 49-50: The success notification is being forced via
api.ShowMsg(..., forceShown: true) which bypasses EnableSuccessNotification; in
EverythingDownloadHelper remove the forceShown: true argument from the
"installation success" api.ShowMsg call so the success toast respects the user's
EnableSuccessNotification setting (optionally also remove forceShown: true from
the "installing..." api.ShowMsg call if you decide it should be treated as a
non-essential courtesy notification).

---

Nitpick comments:
In `@Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs`:
- Around line 139-147: You added a new ShowMsg overload to IPublicAPI which is a
binary-breaking change for external implementers; make it a default interface
implementation that forwards to the existing 4-argument ShowMsg so external
implementers aren’t forced to recompile. In IPublicAPI provide a default body
for the new ShowMsg(string title, string subTitle, string iconPath, bool
useMainWindowAsOwner = true, bool forceShown = false) that simply calls the
existing ShowMsg(title, subTitle, iconPath, useMainWindowAsOwner), and keep
PublicAPIInstance overriding behavior as-is.

In `@Flow.Launcher/PublicAPIInstance.cs`:
- Line 122: The named-argument formatting is inconsistent: update the calls to
ShowMsg so named arguments follow the "name: value" convention (add a space
after the colon) — specifically change occurrences using forceShown:true and
useMainWindowAsOwner:useMainWindowAsOwner to forceShown: true and
useMainWindowAsOwner: useMainWindowAsOwner in the ShowMsg(...) invocations to
match project formatting (e.g., the call within PublicAPIInstance.cs where
ShowMsg(title, subTitle, Constant.ErrorIcon, forceShown:true) is used and the
similar call at the later occurrence).

In `@Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs`:
- Around line 113-114: Replace the error-style notification for the "already
exists" case in PluginsManager (the Context.API.ShowMsgError call) with an
informational notification: call
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_update_alreadyexists"),
forceShown: true) (or use
Context.API.ShowMsgBox/ShowMsgBox(Localize.duplicateShortcut()) pattern if you
prefer a modal) so the message is shown as an informational/no-op rather than an
error; leave the subsequent return in place.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ffa741a2-8992-43b9-8adc-f35a8b8611a0

📥 Commits

Reviewing files that changed from the base of the PR and between ab854d5 and 0eb5e0b.

📒 Files selected for processing (8)
  • Flow.Launcher.Core/Plugin/JsonRPCV2Models/JsonRPCPublicAPI.cs
  • Flow.Launcher.Core/Plugin/PluginManager.cs
  • Flow.Launcher.Core/Updater.cs
  • Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
  • Flow.Launcher/Languages/en.xaml
  • Flow.Launcher/PublicAPIInstance.cs
  • Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingDownloadHelper.cs
  • Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
✅ Files skipped from review due to trivial changes (1)
  • Flow.Launcher/Languages/en.xaml

Comment thread Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
Comment thread Flow.Launcher/PublicAPIInstance.cs Outdated
Jack251970 and others added 3 commits April 26, 2026 15:28
Update all ShowMsg calls in PluginInstaller.cs and PluginsManager.cs to include iconPath (empty string) and forceShown (true). This ensures consistent message display behavior and no icon for plugin install, update, and uninstall notifications.
Increased the top margin of the "enableSuccessNotification" SettingsCard from 4 to 14 units for improved spacing. Added a header icon (FontIcon with glyph &#xE91C;) to enhance visual clarity.
Copy link
Copy Markdown
Member

@Jack251970 Jack251970 left a comment

Choose a reason for hiding this comment

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

LGTM! Please wait for jjw24's review

@Jack251970 Jack251970 requested a review from jjw24 April 26, 2026 07:31
Copy link
Copy Markdown
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: 2

🧹 Nitpick comments (1)
Flow.Launcher/PublicAPIInstance.cs (1)

56-56: Unrelated refactor: use of System.Threading.Lock instead of object for _saveSettingsLock.

This change is compatible with the project's .NET 9 target but unrelated to the PR's scope (adding notification gating). Keep off-topic refactors in separate PRs to maintain clear change history.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Flow.Launcher/PublicAPIInstance.cs` at line 56, The field _saveSettingsLock
was changed to use System.Threading.Lock which is an unrelated refactor; revert
it to the original pattern using a private readonly object (e.g., private
readonly object _saveSettingsLock = new();), and update any Monitor/lock usages
that rely on _saveSettingsLock to work with an object; keep this refactor out of
this PR and restore the original _saveSettingsLock type and initialization in
PublicAPIInstance (symbol: _saveSettingsLock) so the change history stays
focused on the notification gating work.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Flow.Launcher/PublicAPIInstance.cs`:
- Around line 130-131: The 4-arg ShowMsg overload is dropping the incoming
useMainWindowAsOwner because it forwards a hard-coded true; update the wrapper
so ShowMsg(string title, string subTitle, string iconPath, bool
useMainWindowAsOwner = true) forwards the actual useMainWindowAsOwner value to
the 5-arg ShowMsg(title, subTitle, iconPath, useMainWindowAsOwner:
useMainWindowAsOwner, forceShown: false), or remove the 4-arg overload entirely
and rely on the existing 5-arg ShowMsg that defaults forceShown to false to
eliminate the forwarding hazard.
- Around line 133-142: The public API methods ShowMsg and ShowMsgWithButton
declare a useMainWindowAsOwner parameter but never use it—either plumb it
through by adding owner-aware overloads in the Notification class (e.g.,
Notification.Show(string title, string subTitle, string iconPath = null, bool
useMainWindowAsOwner = true) and Notification.ShowWithButton(string title,
string buttonText, Action buttonAction, string subTitle, string iconPath = null,
bool useMainWindowAsOwner = true)) and pass useMainWindowAsOwner from
PublicAPIInstance.ShowMsg/ShowMsgWithButton, or remove the unused
useMainWindowAsOwner parameter from the ShowMsg and ShowMsgWithButton signatures
to avoid a misleading API; update corresponding calls to Notification.Show and
Notification.ShowWithButton accordingly.

---

Nitpick comments:
In `@Flow.Launcher/PublicAPIInstance.cs`:
- Line 56: The field _saveSettingsLock was changed to use System.Threading.Lock
which is an unrelated refactor; revert it to the original pattern using a
private readonly object (e.g., private readonly object _saveSettingsLock =
new();), and update any Monitor/lock usages that rely on _saveSettingsLock to
work with an object; keep this refactor out of this PR and restore the original
_saveSettingsLock type and initialization in PublicAPIInstance (symbol:
_saveSettingsLock) so the change history stays focused on the notification
gating work.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c33834bf-d07f-4df6-81bb-2d0a715bacc7

📥 Commits

Reviewing files that changed from the base of the PR and between 0eb5e0b and be7c922.

📒 Files selected for processing (1)
  • Flow.Launcher/PublicAPIInstance.cs

Comment thread Flow.Launcher/PublicAPIInstance.cs
Comment thread Flow.Launcher/PublicAPIInstance.cs
Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
Flow.Launcher.Core/Plugin/PluginInstaller.cs (1)

307-308: Forcing the “no updates available” toast may surprise users who disabled success notifications.

The silentUpdate == false branch already gates this on the caller’s explicit request to surface a result, but forceShown: true additionally bypasses EnableSuccessNotification. For users who disabled the setting because they want a silent workflow, an informational "no results" pop-up is arguably the most expendable of the new forced messages. Consider dropping forceShown: true here so the user setting still applies, even though the caller asked for non-silent behavior.

♻️ Suggested change
-                PublicApi.Instance.ShowMsg(Localize.updateNoResultTitle(), Localize.updateNoResultSubtitle(), iconPath: "",
-                    forceShown: true);
+                PublicApi.Instance.ShowMsg(Localize.updateNoResultTitle(), Localize.updateNoResultSubtitle());
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Flow.Launcher.Core/Plugin/PluginInstaller.cs` around lines 307 - 308, The
ShowMsg call is forcing a "no updates" toast despite user preference; remove the
forceShown: true argument from PublicApi.Instance.ShowMsg (the invocation using
Localize.updateNoResultTitle/Subtitle) so that the existing silentUpdate
handling respects EnableSuccessNotification, i.e., call ShowMsg without the
forceShown override when silentUpdate == false so the user's
success-notification setting is honored.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@Flow.Launcher.Core/Plugin/PluginInstaller.cs`:
- Around line 307-308: The ShowMsg call is forcing a "no updates" toast despite
user preference; remove the forceShown: true argument from
PublicApi.Instance.ShowMsg (the invocation using
Localize.updateNoResultTitle/Subtitle) so that the existing silentUpdate
handling respects EnableSuccessNotification, i.e., call ShowMsg without the
forceShown override when silentUpdate == false so the user's
success-notification setting is honored.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9c6688e2-9125-49fe-a09f-dd5ba64508d7

📥 Commits

Reviewing files that changed from the base of the PR and between be7c922 and a907ad1.

📒 Files selected for processing (3)
  • Flow.Launcher.Core/Plugin/PluginInstaller.cs
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
  • Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs
🚧 Files skipped from review as they are similar to previous changes (2)
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
  • Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs

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.

Advanced Content Search within Documents | Mandatory Notifications

2 participants