Skip to content

Notification click switches to the tab; pulsing question indicator on tabs - #27

Merged
SergKam merged 1 commit into
mainfrom
feat/notif-tab-switch-and-question-indicator
Jun 25, 2026
Merged

Notification click switches to the tab; pulsing question indicator on tabs#27
SergKam merged 1 commit into
mainfrom
feat/notif-tab-switch-and-question-indicator

Conversation

@SergKam

@SergKam SergKam commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Two ergonomics improvements.

1. Notification click → switch to the originating tab

Previously, clicking a desktop notification only raised the window. Now it also switches the notebook to the workspace tab the notification is about.

  • A new application action activate-workspace (string target = workspace id) is registered in build_ui. Its handler resolves the id to its tab index (under a short borrow, released before set_current_page so the switch-page handler can borrow mutably), switches to it, and calls window.present().
  • notify_workspace sets this as the notification's default action with the workspace id as target, and now keys notifications by workspace id so a newer alert for the same tab replaces the older one instead of stacking.
  • The installed com.flycrys.app.desktop matches APP_ID, so action routing works for the running instance.

2. Tab shows a question indicator while the agent waits

While the agent is blocked on an AskUserQuestion, the tab's spinner is swapped for a pulsing amber question-mark icon, so a tab that needs you is distinguishable at a glance from one that's still working. The spinner returns the moment the agent resumes — on answer, reject, or a new message — and on finish.

  • A gtk::Image question icon is threaded through the same path as the existing tab spinner: TabSlotWorkspace::newcreate_agent_panelPanelState.
  • The pulse is a CSS @keyframes animation (.tab-question) in both light and dark themes. If a GTK build ignores @keyframes, it degrades gracefully to a static amber icon — still a clear signal.

Notes / caveats

  • Not visually verified — these are UI-visual changes; clippy (-D warnings, lib+bins) and the full test suite pass, but the spinner↔question swap and the notification click should be eyeballed in a running session.
  • Notification action delivery depends on a running session bus; under the multi-instance NON_UNIQUE flag, routing targets the live instance (the normal single-instance case).

Two ergonomics improvements:

1. Clicking a desktop notification now raises the window AND switches to
   the workspace tab the notification is about (previously it only raised
   the window). Notifications carry the workspace id as the default-action
   target; a new app action `activate-workspace` resolves the id to its
   tab and calls set_current_page + present. Notifications are now keyed by
   workspace id, so a newer alert for a tab replaces the older one.

2. While the agent is blocked on an AskUserQuestion, the tab's spinner is
   swapped for a pulsing amber question-mark icon, so a waiting tab is
   distinguishable at a glance from a working one. The spinner returns as
   soon as the agent resumes (answer/reject/new message) or finishes.

The question icon is threaded through the same path as the existing tab
spinner (TabSlot -> Workspace -> agent panel -> PanelState). Pulse is a
CSS @Keyframes animation in both themes; degrades to a static amber icon
if a GTK build ignores it.
@SergKam
SergKam merged commit 0001226 into main Jun 25, 2026
2 checks passed
@SergKam
SergKam deleted the feat/notif-tab-switch-and-question-indicator branch June 25, 2026 20:37
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.

1 participant