feat: Minimized mode with popup window on session completion#415
Open
feat: Minimized mode with popup window on session completion#415
Conversation
When PolyPilot is not focused and a session completes, a compact popup window appears showing the last response with a text input for quick follow-up. After sending, the popup auto-closes. New files: - Services/IMinimizedModeService.cs — interface (test-safe) - Services/MinimizedModeService.cs — concrete with MAUI window management - Components/PopupChat/PopupChatHost.razor — Blazor root for popup window - Components/PopupChat/PopupChatView.razor — compact chat UI (header, response, input) - Components/PopupChat/PopupChatView.razor.css — dark theme styling - PopupChatPage.xaml/.cs — MAUI ContentPage hosting the BlazorWebView Modified: - App.xaml.cs — tracks window.Activated/Deactivated for focus state - CopilotService.Events.cs — hooks session completion to show popup - ConnectionSettings.cs — adds EnableMinimizedMode (default: false) - SettingsRegistry.cs — exposes setting in UI (desktop only) - MauiProgram.cs — registers MinimizedModeService singleton Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add 📌 pin button to dashboard toolbar (desktop only) that enables always-on-top window mode, keeping PolyPilot above all other windows - In always-on-top mode, show only the top Focus session in a compact single-session view with queue badge for waiting sessions - Persist IsAlwaysOnTop in UiState, restore window level on startup - Add MacSleepWakeMonitor: subscribes to NSWorkspace sleep/wake notifications so connection health is checked immediately on wake (fixes PolyPilot stopping work after Mac sleep) - Add WindowLevelHelper: sets UIWindow.WindowLevel to 1001f (above normal app windows, below system UI) on Mac Catalyst Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…etting - WindowLevelHelper: change from broken level 1001 (screensaver level, blocked by macOS sandboxing) to level 3 (NSFloatingWindowLevel) which correctly floats above all normal app windows - WindowLevelHelper: also set NSWindow via P/Invoke on libobjc for reliable behavior; set collectionBehavior=canJoinAllSpaces|managed so window stays visible on all Spaces - Remove 'Minimized Mode Popup' checkbox from Settings UI (the popup window approach was abandoned in favor of Always On Top mode) - Keep EnableMinimizedMode in ConnectionSettings.cs for JSON compat Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When PolyPilot is not focused and a session completes, a compact popup window appears with the last response and a text input for quick follow-up. After sending, the popup auto-closes.
Enable via Settings → UI → Notifications → Minimized Mode Popup (desktop only, disabled by default).
How it works
App.xaml.cssubscribes towindow.Activated/window.Deactivatedto track focusSessionIdleEvent), if the main window is unfocused and the setting is on,MinimizedModeService.OnSessionCompleted()is called instead of a system notificationWindowis opened with aPopupChatPagehosting aPopupChatViewBlazor componentSendPromptAsyncfires, popup closes, main window switches to the sessionNew files
Services/IMinimizedModeService.cs— interface (test-safe, no MAUI types)Services/MinimizedModeService.cs— concrete with MAUI window management + queueComponents/PopupChat/PopupChatHost.razor— Blazor root for the popup BlazorWebViewComponents/PopupChat/PopupChatView.razor— compact chat UIComponents/PopupChat/PopupChatView.razor.css— dark theme, usesvar(--type-*)andvar(--font-base)PopupChatPage.xaml/.cs— MAUI ContentPage hosting the BlazorWebViewModified files
App.xaml.cs— focus tracking via window eventsCopilotService.Events.cs— hooks session completion to show popup (falls back to system notification if popup not applicable)ConnectionSettings.cs—EnableMinimizedMode(default: false)SettingsRegistry.cs— UI setting (desktop only)MauiProgram.cs— DI registrationPolyPilot.Tests/TestStubs.cs—StubMinimizedModeServicefor testsTests
All 2897 tests pass.