Skip to content

Add ShowNotification API: inline notification bar in main window#4550

Draft
VictoriousRaptor with Copilot wants to merge 2 commits into
devfrom
copilot/enhancement-api-popup-method
Draft

Add ShowNotification API: inline notification bar in main window#4550
VictoriousRaptor with Copilot wants to merge 2 commits into
devfrom
copilot/enhancement-api-popup-method

Conversation

Copilot AI commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

ShowMsg relies on OS toast notifications, which can be silently blocked, dismissed, or missed entirely — making it unreliable for plugins that need guaranteed user-visible feedback.

Changes

  • NotificationSeverity enum (Flow.Launcher.Plugin) — Informational, Success, Warning, Error
  • IPublicAPI.ShowNotification — new method signature:
    void ShowNotification(string title, string subTitle = "", NotificationSeverity severity = NotificationSeverity.Informational);
  • MainViewModel — adds InlineNotificationIsOpen/Title/Message/Severity properties (Fody-notified) and ShowInlineNotification() with dispatcher guard
  • MainWindow.xaml — inserts a ui:InfoBar between the query box and results list, two-way bound to the ViewModel; collapses when IsOpen=false so it takes no space at rest
  • Notification.ShowInline — maps NotificationSeverityInfoBarSeverity, resolves MainViewModel from IoC, calls ShowInlineNotification
  • PublicAPIInstance + JsonRPCPublicAPI — wire ShowNotification through to Notification.ShowInline, making the API available to both C# and JsonRPC (Python/Node.js) plugins

Result

Plugins call ShowNotification and a styled, dismissable bar appears inside the Flow Launcher window — unaffected by OS notification settings, guaranteed visible whenever the window is open.

context.API.ShowNotification("Done", "Results copied to clipboard", NotificationSeverity.Success);
context.API.ShowNotification("Warning", "Rate limit approaching", NotificationSeverity.Warning);

Introduces a new ShowNotification(title, subTitle, severity) method to IPublicAPI
that plugins can call to display a reliable inline notification bar directly inside
the Flow Launcher main window — not a dismissable OS toast notification.

Changes:
- NotificationSeverity.cs: new enum (Informational/Success/Warning/Error)
- IPublicAPI.cs: add ShowNotification method to the public interface
- Notification.cs: add ShowInline() that maps severity and delegates to MainViewModel
- MainViewModel.cs: add InlineNotification* properties and ShowInlineNotification()
- MainWindow.xaml: add ui:InfoBar bound to InlineNotification* ViewModel properties
- PublicAPIInstance.cs: implement ShowNotification via Notification.ShowInline
- JsonRPCPublicAPI.cs: expose ShowNotification for Python/Node.js plugins
Copilot AI changed the title [WIP] Add API method for showing a simple popup Add ShowNotification API: inline notification bar in main window Jun 27, 2026
Copilot AI requested a review from VictoriousRaptor June 27, 2026 17:46
@HorridModz

Copy link
Copy Markdown

This sounds awesome! I can't see what it looks like, of course, but I'll have to try it out when I get a chance. I think the Notification Severity is a nice touch.

@VictoriousRaptor

Copy link
Copy Markdown
Contributor

This sounds awesome! I can't see what it looks like, of course, but I'll have to try it out when I get a chance. I think the Notification Severity is a nice touch.

I'm sorry but this PR is just a click to copilot and see if it can solve that issue, not something we're bringing into the project yet.

@HorridModz

Copy link
Copy Markdown

This sounds awesome! I can't see what it looks like, of course, but I'll have to try it out when I get a chance. I think the Notification Severity is a nice touch.

I'm sorry but this PR is just a click to copilot and see if it can solve that issue, not something we're bringing into the project yet.

Yes, of course. But I do hope this makes it into Flow.Launcher (in whatever form that may be); the idea sounds fantastic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants