The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Refine notification menu with shared harness status marks (#517)
Dee10af5a2ac810
diff --git a/desktop/README.md b/desktop/README.mdindex a18f1bb5b..a0155f171 100644--- a/desktop/README.md+++ b/desktop/README.md@@ -190,15 +190,17 @@ On macOS, the Harness portrait symbol follows the system menu bar's appearance acarries a small circular unread badge at its bottom-right corner,only when notifications are unread (`99+` above 99; the tooltip keeps the exact count). Open it forone Notifications section, with questions first and the newest results below.-Each row includes the question or completion recap, tab, machine, and arrival-time. The first five appear here; View all opens the full inbox. Read sessions-disappear, and an empty inbox says “No unread notifications.” Working expands-to show active sessions with elapsed time when the app observed their start;+Each row pairs the harness name with its question or completion recap, the+shared tab/pane status mark, and arrival time. Tab and machine details remain+in tooltips. The first five appear here; View all opens the full inbox. Read sessions+disappear, and an empty inbox says “No unread notifications.” Working starts+expanded, showing active sessions with elapsed time when the app observed their start;idle sessions and sessions already listed above do not fill this section.Working never contributes to the unread badge. New Harness and Open Harnessuse the normal creation and existing-session pickers. Show Harness brings thewindow forward; Quit exits the app. Selecting a conversation reuses its existing-pane before revealing the window. Mark all read acknowledges the opening+pane before revealing the window. The close icon beside Notifications marks+all read, acknowledging the openingsnapshot without answering pending questions or clearing newer arrivals.Linux and the browser keep the in-window notification bell. GitHub mergenotifications are not part of this menu yet.diff --git a/desktop/design/desktop-design-system.md b/desktop/design/desktop-design-system.mdindex 0408df39f..463ed02a3 100644--- a/desktop/design/desktop-design-system.md+++ b/desktop/design/desktop-design-system.md@@ -366,11 +366,15 @@ retain their meaning. Read-only loading/error views use the same hierarchy.**macOS notification menu** — one Notifications section with up to five unreadsession rows and a route to the full inbox. Use a 13-point semibold session title,-12-point status and tab/machine context, and a 13-point message preview capped-at two lines. Retain the full text in accessibility and tooltips. Questions-precede results; each kind is newest first. Mark all read belongs beside the-heading. Working is a collapsed disclosure with compact title/context rows-and observed elapsed time. The unread count excludes work in progress. Use+13-point message preview capped at two lines, and quiet 12-point timestamps.+The name and message are the content hierarchy. Use the same Harness activity+marks and theme colors as tabs and panes; do not add status captions or unread+dots beside them. Tab/machine context, full text and status descriptions remain+in accessibility and tooltips. Questions precede results; each kind is newest+first. Mark all read is the shared close icon in a 32-point target beside the+heading. Working starts expanded, with 28-point name/status/elapsed rows, and+is absent when empty. Its shared Braille clock only runs while the menu is+open and expanded, respecting Reduce Motion. The unread count excludes work in progress. Usenative menu selection and system colors; no inner cards or decorative borders.Settings stays in the application menu; this menu ends with Show Harness and Quit.Pane-resize guidance is app navigation: use the shared popover surface, systemdiff --git a/desktop/design/desktop-ui-migration.md b/desktop/design/desktop-ui-migration.mdindex e45c77105..2f332b46c 100644--- a/desktop/design/desktop-ui-migration.md+++ b/desktop/design/desktop-ui-migration.md@@ -20,7 +20,7 @@ on 2026-09-30; the unmerged checkpoints below describe earlier review stages.| Sharing | Access/people/options, comments, observer sidebar, and viewer access/error states use desktop surfaces; existing sharing and authentication rules retained || Add Phone | Desktop QR/device layout implemented; pairing lifecycle tests and light/dark enlarged-text renders pass || Machine recovery/linking | Desktop linking/password layouts implemented; bounded selectable errors, fixed actions, and 32-point reveal controls tested/rendered |-| Notifications | macOS menu overview has receipt-bound message previews, tab/machine context, a collapsed Working section, and Mark all read; full desktop inbox remains available. Synthetic native light/dark, expanded, empty, long, selected and unavailable states inspected; live menu interaction still needs review |+| Notifications | Native name/message rows share the tab/pane activity marks and colors. Working starts expanded; compact headers and clear icon replace repeated labels. Synthetic light/dark, collapsed, empty, long, selected and unavailable states inspected; live menu interaction still needs review || Branches / pull requests | Desktop lists and shared modal veil implemented; colored icons, readable status words, honest load failures, Page Up/Down tested and rendered || Settings / customization | Desktop status customization, natural-height controls, error contrast, keyboard focus and passive native footer preview implemented; actual status previews preserve the selected renderer || Store | Existing graphical discovery/detail/launch routes retained; ordinary labels, search and counts use system typography; desktop and narrow/enlarged previews inspected |@@ -38,29 +38,36 @@ The standalone MachinesManager, old machine-link dialog, and genericteam-creation presenter have no production caller in this tree. They are notcounted as completed user journeys. Shared controls still serve their tests.-## Notification overview review — 2026-09-30+## Notification overview refinement — 2026-10-01-The menu now presents questions and completed results together, with the actual-question or notified recap beneath the session title. Working expands inline;-its count excludes unread sessions already above it and never changes the badge.-Settings is removed from this menu and its last action is Quit. GitHub merge-events remain a follow-up rather than inferred notifications.+The earlier overview repeated a status caption and tab/machine context under+nearly every title. It now pairs the harness name directly with the message,+uses the existing tab/pane activity marks and colors, and keeps full context+in tooltips and accessibility. Working starts expanded as 28-point rows; the+section disappears when empty. Clear is a quiet icon with a 32-point target.+The menu keeps native actions, keyboard navigation and receipt validation.+[Apple notification research](macos-design-research.md#notification-menu-refinement--2026-10-01)+informed the hierarchy, not a claim of system Notification Center equivalence.Native captures use synthetic sessions and the production AppKit views:[light](images/notification-overview-light.png),[dark](images/notification-overview-dark.png), and-[expanded Working](images/notification-overview-working.png). These are view-renders on neutral surfaces; they do not simulate the window-server blur.-The fixture also covers empty, long/truncated, highlighted, and offline rows.-Reproduce with `tool/check_swarm_titlebar.sh <flutter-sdk> --status-menu-preview`.--Validation: 67 targeted Flutter tests, 44 native menu checks, changed-file static-analysis, icon audit, and a signed Intel Skia debug build. Coverage includes-receipt-bound previews, same-session coalescing, unread/working separation,-known versus unknown elapsed time, stale clicks, snapshot clearing, tab moves,-existing-pane navigation, disclosure key handling, effective shortcut hints,-and sign-out cleanup. Physical pointer/keyboard tracking and VoiceOver in the-user's running app remain manual review items; this fixture is not that evidence.+[collapsed Working](images/notification-overview-collapsed.png). The six-session+expanded sample is 360×465 points, down from 360×597. Empty is 360×184; long+names preserve the 360-point menu width. These are view renders on neutral+surfaces; they do not simulate window-server blur. The fixture also covers+long/truncated, highlighted and offline rows. Reproduce with+`tool/check_swarm_titlebar.sh <flutter-sdk> --status-menu-preview`.++Validation: 15 targeted Flutter tests, 50 native menu checks, and 4,405 native+tab/layout checks; changed-file static analysis and the icon audit pass. A+signed Intel Skia debug build is ready for local review. Menu and tab bridge payloads match for glyph, label and+color. Tests cover receipt-bound previews, stale clicks, snapshot clearing,+tab moves, existing-pane navigation, expanded defaults, disclosure keys,+shortcut hints, sign-out and the animation lifecycle. The native glyph drawing+is shared without changing tab geometry. Physical pointer/keyboard tracking+and VoiceOver in the user's running app remain manual review items; these+fixtures are not that evidence.## AI review paneldiff --git a/desktop/design/icon-design-system.md b/desktop/design/icon-design-system.mdindex be84ed86b..928692706 100644--- a/desktop/design/icon-design-system.md+++ b/desktop/design/icon-design-system.md@@ -85,6 +85,13 @@ These are content or identities, not a second action-icon library:- `AppRatingStar` uses a rounded outline and proportional fill to encode anumber. Layout thumbnails use the real pane geometry. Connection dots,progress indicators and activity marks encode state.+- Harness activity has one vocabulary in `harness_activity.dart`: `?`, `✗`,+ `✓`, the ten-frame Braille spinner, `◌`, `||`, `⊘`, and unmarked idle. Native+ tabs and menu notifications share `HarnessNativeActivity`; Dart pane headers+ share `ActivityMark`. Bridge payloads use `nativeActivityPayload` and the+ same `activityColor`, including the monochrome preference. Do not substitute+ SF Symbols or add status pills to a different Harness surface. A notification+ mark describes its unread receipt; a tab/pane mark describes current activity.- QR codes, companion artwork, explanatory diagrams, wallpaper, terminaloutput and user-selected status/Powerline artwork are content. Keep theirfunction and authorship; do not round QR modules or replace terminal glyphs.diff --git a/desktop/design/images/notification-overview-collapsed.png b/desktop/design/images/notification-overview-collapsed.pngnew file mode 100644index 000000000..73cb9d1c0Binary files /dev/null and b/desktop/design/images/notification-overview-collapsed.png differdiff --git a/desktop/design/images/notification-overview-dark.png b/desktop/design/images/notification-overview-dark.pngindex 99f43d001..f06c4f3de 100644Binary files a/desktop/design/images/notification-overview-dark.png and b/desktop/design/images/notification-overview-dark.png differdiff --git a/desktop/design/images/notification-overview-light.png b/desktop/design/images/notification-overview-light.pngindex d7be61bb4..c1731ebc8 100644Binary files a/desktop/design/images/notification-overview-light.png and b/desktop/design/images/notification-overview-light.png differdiff --git a/desktop/design/images/notification-overview-working.png b/desktop/design/images/notification-overview-working.pngdeleted file mode 100644index 5ef791fa1..000000000Binary files a/desktop/design/images/notification-overview-working.png and /dev/null differdiff --git a/desktop/design/macos-design-research.md b/desktop/design/macos-design-research.mdindex 5f7e6b1b4..450f3f3f1 100644--- a/desktop/design/macos-design-research.md+++ b/desktop/design/macos-design-research.md@@ -14,6 +14,23 @@ Award references below describe the named reference apps only.## What Apple recommends+### Notification menu refinement — 2026-10-01++Apple's [notification guidance](https://developer.apple.com/design/human-interface-guidelines/notifications?changes=_4)+prioritizes a recognizable title or sender and concise, informative content.+The [Mac Notification Center guide](https://support.apple.com/en-euro/guide/mac-help/mchl2fb1258f/mac)+documents opening the associated item, expanding groups and clearing notifications.++Our application of these patterns: a semibold harness name followed directly+by its message; quiet timestamps; secondary tab/machine context on hover;+and one small clear control beside the heading. Working is visible by default+as compact rows. Status marks reuse the tab/pane activity vocabulary, as the+user requested. This is an AppKit menu, not a replica of Notification Center:+the system owns its material, placement, keyboard navigation and dismissal.+Row measurements and the five-item limits are Harness design choices.++### Broader desktop guidance+These are paraphrases of primary sources. The numerical proposals later in thisnote are our choices, not Apple requirements.diff --git a/desktop/design/workspace-status-bar.md b/desktop/design/workspace-status-bar.mdindex 6b8a95d12..090eb6287 100644--- a/desktop/design/workspace-status-bar.md+++ b/desktop/design/workspace-status-bar.md@@ -221,25 +221,31 @@ adapts to the menu bar's light, dark, and selected appearances. It keeps a fixedabove 99 with the exact count in its tooltip and accessibilityvalue. The native menu has one Notifications section, with questions first,then failures and completed results, newest first within each kind. Each row-shows a title, status, up to two lines of the actual question or notified recap,-and tab/machine context. Its age is when this app received the notification.+shows a semibold harness name, up to two lines of the actual question or notified+recap, and a quiet timestamp. Status uses the same `?`, `✗`, `✓` activity marks+and theme colors as tabs and panes, without a second status caption or unread+dot. Its age is when this app received the notification.The recap stays bound to that unread receipt; later transcript text cannotreplace it. Show at most five notifications and a View all route to the fullinbox. A session in multiple tabs appears once, preferring the active tab,then the first containing it. Machine profiles do not hide notifications.-Project context remains in tooltips. Blue dots mark unread rows; unavailable+Tab, machine, project and full status descriptions remain in tooltips and+accessibility text. Unavailablerows remain visible and disabled. An empty inbox says “No unread notifications.”-Working is a collapsed inline disclosure. It shows active, known sessions that+Working starts expanded and disappears when empty. It shows active, known sessions thatare not already in Notifications, with elapsed time only when the app observedtheir turn start. Exclude idle shells, paused/offline sessions, and waiting-questions. Show five compact rows, with additional sessions in a submenu.+questions. Show five compact name/elapsed rows, with additional sessions in a+submenu. Reuse the tab's native activity renderer and 100ms Braille clock;+the menu clock stops when closed or collapsed, and with Reduce Motion.Working never adds to the badge. Both sections keep their snapshot while open;opening the disclosure must not insert new notifications under the pointer.Keyboard Left/Right and Return/Space toggle the disclosure. Rows use nativeselection, type-select, accessibility, and existing navigation receipts.-Mark all read sits beside the Notifications heading. New Harness and Open+Mark all read is the close icon beside the Notifications heading, with a+32-point target, explicit tooltip and accessibility label. New Harness and OpenHarness use the existing creation/session pickers and effective shortcut hints.Show Harness and Quit finish the menu; Settings stays in the application menu.Show Harness stays available while workspace actions are disabled. The window'sdiff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dartindex 52b10ff57..eb0d7768b 100644--- a/desktop/lib/screens/swarm_screen.dart+++ b/desktop/lib/screens/swarm_screen.dart@@ -1740,6 +1740,8 @@ class _SwarmScreenState extends State<SwarmScreen> {terminalThemeStore.value,);final barStyle = workspaceBarTextStyle();+ int activityInk(HarnessActivity activity) =>+ activityColor(activity, terminalTheme, color: prefs.color).toARGB32();final payload = {'enabled': _routeIsCurrent && !_dialogOpen && !_spokenPaletteOpen,'reduceMotion': _reduceMotion,@@ -1867,8 +1869,16 @@ class _SwarmScreenState extends State<SwarmScreen> {},],'attention': _attention,- if (_native) 'statusMenuEntries': statusMenuEntries(app),- if (_native) 'statusMenuWorkingEntries': statusMenuWorkingEntries(app),+ if (_native)+ 'statusMenuEntries': statusMenuEntries(+ app,+ colorForActivity: activityInk,+ ),+ if (_native)+ 'statusMenuWorkingEntries': statusMenuWorkingEntries(+ app,+ colorForActivity: activityInk,+ ),// The fallback bell and the macOS menu use the same unread ledger.'unread': _unread,'sessionsOpen': _harnessesVisible,@@ -1924,16 +1934,10 @@ class _SwarmScreenState extends State<SwarmScreen> {).length,if (tabActivity(app, swarm) case final activity?)- 'activity': {- 'mark': activity.mark,- 'label': activity.label,- 'working': activity == HarnessActivity.working,- 'color': activityColor(- activity,- terminalTheme,- color: prefs.color,- ).toARGB32(),- },+ 'activity': nativeActivityPayload(+ activity,+ color: activityInk(activity),+ ),},],};diff --git a/desktop/lib/state/harness_activity.dart b/desktop/lib/state/harness_activity.dartindex 3be29a959..b00deda55 100644--- a/desktop/lib/state/harness_activity.dart+++ b/desktop/lib/state/harness_activity.dart@@ -21,6 +21,18 @@ enum HarnessActivity {final String label;}+/// The same status vocabulary for native tabs and the menu bar overview.+/// Callers supply the pane's theme color, including the monochrome preference.+Map<String, Object> nativeActivityPayload(+ HarnessActivity activity, {+ int? color,+}) => {+ 'mark': activity.mark,+ 'label': activity.label,+ 'working': activity == HarnessActivity.working,+ 'color': ?color,+};+const activitySpinnerFrames = ['⠋','⠙',diff --git a/desktop/lib/state/status_menu.dart b/desktop/lib/state/status_menu.dartindex a7dbb0511..7bc1fa503 100644--- a/desktop/lib/state/status_menu.dart+++ b/desktop/lib/state/status_menu.dart@@ -9,7 +9,10 @@ import 'workspace_status.dart';/// One notification section, questions first and newest first within each kind./// Receipts travel with each row so a menu left open cannot clear newer news.-List<Map<String, Object?>> statusMenuEntries(AppNotifier app) {+List<Map<String, Object?>> statusMenuEntries(+ AppNotifier app, {+ int Function(HarnessActivity)? colorForActivity,+}) {final notifications = notificationInbox(app);if (notifications.isEmpty) return [];final names = workspaceTabNames(app);@@ -17,7 +20,7 @@ List<Map<String, Object?>> statusMenuEntries(AppNotifier app) {final rows = [for (final notification in notifications){- ..._entry(app, notification),+ ..._entry(app, notification, colorForActivity),..._location(app,notification.machineId,@@ -41,7 +44,10 @@ List<Map<String, Object?>> statusMenuEntries(AppNotifier app) {/// The same live activity as the tabs. Idle shells and waiting questions are/// not working. A session with unread news gets its one row above instead.-List<Map<String, Object?>> statusMenuWorkingEntries(AppNotifier app) {+List<Map<String, Object?>> statusMenuWorkingEntries(+ AppNotifier app, {+ int Function(HarnessActivity)? colorForActivity,+}) {final names = workspaceTabNames(app);final owners = _owners(app);final unread = notificationInbox(app).map((row) => row.id).toSet();@@ -57,6 +63,10 @@ List<Map<String, Object?>> statusMenuWorkingEntries(AppNotifier app) {'title': session.agent.displayName,'unread': false,'label': 'Working',+ 'activity': nativeActivityPayload(+ HarnessActivity.working,+ color: colorForActivity?.call(HarnessActivity.working),+ ),'startedAt': app.agentWorkingSince(session.machineId, session.agent.id)?.millisecondsSinceEpoch,@@ -108,7 +118,11 @@ Map<String, Object?> _location(};}-Map<String, Object?> _entry(AppNotifier app, InboxNotification notification) {+Map<String, Object?> _entry(+ AppNotifier app,+ InboxNotification notification,+ int Function(HarnessActivity)? colorForActivity,+) {final machineId = notification.machineId;final agentId = notification.agentId;final question = app.questionFor(machineId, agentId);@@ -119,6 +133,10 @@ Map<String, Object?> _entry(AppNotifier app, InboxNotification notification) {'detail': notification.detail,'unavailable': notification.unavailable,'unread': true,+ 'activity': nativeActivityPayload(+ notification.activity,+ color: colorForActivity?.call(notification.activity),+ ),'label': notification.kind == AlertKind.done? 'Ready for review': notification.label,diff --git a/desktop/macos/Runner/HarnessStatusMenu.swift b/desktop/macos/Runner/HarnessStatusMenu.swiftindex bd506947c..70d49b6a5 100644--- a/desktop/macos/Runner/HarnessStatusMenu.swift+++ b/desktop/macos/Runner/HarnessStatusMenu.swift@@ -8,8 +8,11 @@ final class HarnessStatusMenu: NSObject, NSMenuDelegate {private(set) var statusItem: NSStatusItem?private var entries: [[String: Any]] = []private var working: [[String: Any]] = []- private var workingExpanded = false+ private var workingExpanded = trueprivate var workingItems: [NSMenuItem] = []+ private var activityTimer: Timer?+ private var motionObserver: NSObjectProtocol?+ private var reduceMotion = falseprivate var keymap: HarnessNativeKeymap?private var keyContext = "workspace"private var menuKeys: Any?@@ -27,6 +30,10 @@ final class HarnessStatusMenu: NSObject, NSMenuDelegate {super.init()menu.autoenablesItems = falsemenu.delegate = self+ motionObserver = NSWorkspace.shared.notificationCenter.addObserver(+ forName: NSWorkspace.accessibilityDisplayOptionsDidChangeNotification, object: nil, queue: .main) {+ [weak self] _ in self?.syncActivityAnimation()+ }if installStatusItem {let item = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)statusItem = item@@ -38,11 +45,18 @@ final class HarnessStatusMenu: NSObject, NSMenuDelegate {}deinit {+ activityTimer?.invalidate()+ if let motionObserver { NSWorkspace.shared.notificationCenter.removeObserver(motionObserver) }if let menuKeys { NSEvent.removeMonitor(menuKeys) }if let statusItem { NSStatusBar.system.removeStatusItem(statusItem) }}func update(_ state: [String: Any]) {+ let nextReduceMotion = state["reduceMotion"] as? Bool == true+ if reduceMotion != nextReduceMotion {+ reduceMotion = nextReduceMotion+ syncActivityAnimation()+ }let nextEnabled = state["enabled"] as? Bool == truelet nextAvailable = state["statusMenuEntries"] != nillet nextEntries = (state["statusMenuEntries"] as? [[String: Any]] ?? [])@@ -55,7 +69,7 @@ final class HarnessStatusMenu: NSObject, NSMenuDelegate {workspaceAvailable = nextAvailableentries = nextEntriesworking = nextAvailable ? nextWorking : []- if !workspaceAvailable { workingExpanded = false }+ if !workspaceAvailable { workingExpanded = true }let count = entries.countstatusItem?.button?.image = Self.badgeImage(logo: NSImage(named: "HarnessStatusIcon"),count: workspaceAvailable ? count : nil)@@ -65,6 +79,7 @@ final class HarnessStatusMenu: NSObject, NSMenuDelegate {// Never move a conversation out from under the pointer. Stale actions are// revalidated against `entries`, even while the displayed menu stays still.if !tracking { rebuild() }+ syncActivityAnimation()if !workspaceAvailable { menu.cancelTracking() }}@@ -73,10 +88,14 @@ final class HarnessStatusMenu: NSObject, NSMenuDelegate {}func menuWillOpen(_ menu: NSMenu) {- guard menu === self.menu else { return }+ guard menu === self.menu else {+ for item in menu.items { (item.view as? HarnessStatusMenuRow)?.refreshTime() }+ return+ }if dirty { rebuild() }refreshTimes()tracking = true+ syncActivityAnimation()if menuKeys == nil {menuKeys = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { [weak self] event inguard let self, self.tracking, let item = self.menu.highlightedItem,@@ -89,6 +108,7 @@ final class HarnessStatusMenu: NSObject, NSMenuDelegate {func menuDidClose(_ menu: NSMenu) {guard menu === self.menu else { return }tracking = false+ syncActivityAnimation()if let menuKeys { NSEvent.removeMonitor(menuKeys); self.menuKeys = nil }// AppKit dispatches the selected item after closing. Rebuild on next open// or update so its receipt remains the snapshot the person selected.@@ -131,15 +151,44 @@ final class HarnessStatusMenu: NSObject, NSMenuDelegate {}}+ private var activityRows: [HarnessStatusMenuRow] {+ menu.items.flatMap { [$0] + ($0.submenu?.items ?? []) }+ .compactMap { $0.view as? HarnessStatusMenuRow }+ .filter { $0.activity?.working == true }+ }++ private func syncActivityAnimation() {+ let moving = tracking && enabled && workingExpanded && !reduceMotion &&+ !NSWorkspace.shared.accessibilityDisplayShouldReduceMotion && !activityRows.isEmpty+ guard moving else {+ activityTimer?.invalidate()+ activityTimer = nil+ for row in activityRows { row.activityFrame = 0 }+ return+ }+ for row in activityRows { row.activityFrame = harnessActivityFrame() }+ guard activityTimer == nil else { return }+ let next = (floor(Date().timeIntervalSince1970 * 10) + 1) / 10+ let timer = Timer(fire: Date(timeIntervalSince1970: next), interval: 0.1, repeats: true) { [weak self] _ in+ guard let self else { return }+ for row in self.activityRows where row.window?.isVisible == true && !row.isHiddenOrHasHiddenAncestor {+ row.activityFrame = harnessActivityFrame()+ }+ }+ activityTimer = timer+ // Tracking is itself foreground interaction, even when another app owns+ // the key window. Closing or collapsing the menu stops this local clock.+ RunLoop.main.add(timer, forMode: .common)+ }+private func rebuild() {dirty = falsemenu.removeAllItems()workingItems.removeAll()- if working.isEmpty { workingExpanded = false }menu.minimumWidth = 360let clear = add("Mark all read", "clearStatusNotifications", enabled: enabled && !entries.isEmpty)clear.representedObject = entries- clear.view = HarnessStatusMenuRow(item: clear, heading: "Notifications (\(entries.count))")+ clear.view = HarnessStatusMenuRow(item: clear, heading: "Notifications", count: entries.count)if entries.isEmpty {let empty = NSMenuItem(title: workspaceAvailable ? "No unread notifications" : "Open Harness to get started",action: nil, keyEquivalent: "")@@ -151,10 +200,10 @@ final class HarnessStatusMenu: NSObject, NSMenuDelegate {add("View all \(entries.count) notifications…", "notificationInbox", enabled: enabled)}}- if workspaceAvailable {+ if workspaceAvailable && !working.isEmpty {menu.addItem(.separator())let toggle = add("Working (\(working.count))", "toggleWorking", enabled: !working.isEmpty)- toggle.view = HarnessStatusMenuRow(item: toggle, expanded: workingExpanded)+ toggle.view = HarnessStatusMenuRow(item: toggle, heading: "Working", count: working.count, expanded: workingExpanded)for entry in working.prefix(5) {workingItems.append(addSession(entry, to: menu))}@@ -212,6 +261,7 @@ final class HarnessStatusMenu: NSObject, NSMenuDelegate {// Expand the already displayed snapshot. New arrivals and their receipts// stay deferred until the next opening, just like the notification rows.for row in workingItems { row.isHidden = !workingExpanded }+ syncActivityAnimation()menu.update()case "openStatusHarness":guard enabled, let receipt = item.representedObject as? [String: Any],@@ -239,7 +289,14 @@ final class HarnessStatusMenu: NSObject, NSMenuDelegate {private func compact(_ text: String) -> String {let line = text.components(separatedBy: .newlines).joined(separator: " ")- return line.count > 56 ? String(line.prefix(55)) + "…" : line+ // Bound native title measurement too; the custom row keeps the full name+ // for drawing/VoiceOver without letting it widen the entire menu.+ var prefix = String(line.prefix(80))+ let font = NSFont.menuFont(ofSize: 0)+ while !prefix.isEmpty && (prefix as NSString).size(withAttributes: [.font: font]).width > 250 {+ prefix.removeLast()+ }+ return prefix == line ? line : prefix + "…"}/// A single template mask lets AppKit tint the logo and badge together for@@ -292,22 +349,30 @@ private final class HarnessStatusMenuRow: NSView {private weak var item: NSMenuItem?private let entry: [String: Any]?private let heading: String?+ private let count: Int+ let activity: HarnessNativeActivity?private var time = ""var highlighted = false { didSet { needsDisplay = true } }var expanded: Bool? { didSet { updateAccessibility(); needsDisplay = true } }+ var activityFrame = 0 {+ didSet { if oldValue != activityFrame { setNeedsDisplay(activityRect) } }+ }override var isFlipped: Bool { true }- init(item: NSMenuItem, entry: [String: Any]? = nil, heading: String? = nil, expanded: Bool? = nil) {+ init(item: NSMenuItem, entry: [String: Any]? = nil, heading: String? = nil,+ count: Int = 0, expanded: Bool? = nil) {self.item = itemself.entry = entryself.heading = heading+ self.count = countself.expanded = expanded+ activity = HarnessNativeActivity(entry?["activity"] as? [String: Any])let unread = entry?["unread"] as? Bool == true- let message = entry?["message"] as? String ?? ""- let measured = (message as NSString).boundingRect(with: NSSize(width: 316, height: 1000),+ let message = unread ? entry?["message"] as? String ?? "" : ""+ let measured = (message as NSString).boundingRect(with: NSSize(width: 304, height: 1000),options: [.usesLineFragmentOrigin], attributes: [.font: NSFont.systemFont(ofSize: 13)])- let messageHeight = message.isEmpty ? 0 : min(32, ceil(measured.height)) + 2- let height: CGFloat = entry == nil ? 32 : unread ? 64 + messageHeight : 44+ let messageHeight = message.isEmpty ? 0 : min(32, ceil(measured.height)) + 4+ let height: CGFloat = entry == nil ? 32 : unread ? 34 + messageHeight : 28super.init(frame: NSRect(x: 0, y: 0, width: 360, height: height))autoresizingMask = [.width]setAccessibilityElement(true)@@ -333,7 +398,6 @@ private final class HarnessStatusMenuRow: NSView {else if age < 3600 { time = "\(age / 60)m" }else if age < 86400 { time = "\(age / 3600)h" }else { time = "\(age / 86400)d" }- if unread && age >= 60 { time += " ago" }}}updateAccessibility()@@ -350,8 +414,10 @@ private final class HarnessStatusMenuRow: NSView {guard let item else { return }let text: Stringif let entry {- text = [entry["title"] as? String, entry["label"] as? String, entry["message"] as? String,- context, time, entry["unread"] as? Bool == true ? "Unread" : nil]+ let age = time.isEmpty ? nil : entry["unread"] as? Bool == true+ ? (time == "now" ? time : "\(time) ago") : "\(time) elapsed"+ text = [entry["title"] as? String, activity?.label ?? entry["label"] as? String,+ entry["message"] as? String, context, age, entry["unread"] as? Bool == true ? "Unread" : nil].compactMap { $0 }.filter { !$0.isEmpty }.joined(separator: ", ")toolTip = [text, entry["detail"] as? String].compactMap { $0 }.joined(separator: " · ")} else if let expanded {@@ -359,8 +425,8 @@ private final class HarnessStatusMenuRow: NSView {setAccessibilityExpanded(expanded)toolTip = expanded ? "Hide working sessions" : "Show working sessions"} else {- text = "\(heading ?? "Notifications"), Mark all read"- toolTip = "Mark these notifications as read. Pending questions stay unanswered."+ text = "\(heading ?? "Notifications") (\(count)), Mark all read"+ toolTip = "Mark all read. Pending questions stay unanswered."}setAccessibilityLabel(text)setAccessibilityEnabled(item.isEnabled)@@ -369,7 +435,11 @@ private final class HarnessStatusMenuRow: NSView {}private var clearRect: NSRect {- NSRect(x: bounds.width - 110, y: 2, width: 102, height: bounds.height - 4)+ NSRect(x: bounds.width - 44, y: 0, width: 32, height: bounds.height)+ }++ private var activityRect: NSRect {+ NSRect(x: 16, y: entry?["unread"] as? Bool == true ? 7 : 6, width: 16, height: 16)}override func draw(_ dirtyRect: NSRect) {@@ -377,56 +447,60 @@ private final class HarnessStatusMenuRow: NSView {let selected = highlighted && item.isEnabledif selected {NSColor.selectedContentBackgroundColor.setFill()- NSBezierPath(roundedRect: heading == nil ? bounds.insetBy(dx: 4, dy: 2) : clearRect,- xRadius: 5, yRadius: 5).fill()+ NSBezierPath(roundedRect: heading != nil && expanded == nil+ ? clearRect.insetBy(dx: 2, dy: 2) : bounds.insetBy(dx: 4, dy: 1), xRadius: 5, yRadius: 5).fill()}let primary: NSColor = !item.isEnabled ? .disabledControlTextColor: selected ? .selectedMenuItemTextColor : .labelColorlet secondary: NSColor = !item.isEnabled ? .disabledControlTextColor: selected ? .selectedMenuItemTextColor : .secondaryLabelColorif let heading {- text(heading, x: 16, y: 8, width: clearRect.minX - 20, height: 18,- size: 12, weight: .medium, color: .secondaryLabelColor)- text("Mark all read", x: clearRect.minX, y: 8, width: clearRect.width, height: 18,- size: 12, color: !item.isEnabled ? .disabledControlTextColor- : selected ? .selectedMenuItemTextColor : .labelColor, alignment: .center)- return- }- if let expanded {- if item.isEnabled, let icon = HarnessControlSymbols.image(expanded ? "chevron.down" : "chevron.right")?.copy() as? NSImage {- icon.lockFocus()- primary.set()- NSRect(origin: .zero, size: icon.size).fill(using: .sourceAtop)- icon.unlockFocus()- let scale = min(16 / icon.size.width, 16 / icon.size.height)- let size = NSSize(width: icon.size.width * scale, height: icon.size.height * scale)- icon.draw(in: NSRect(x: 11 + (16 - size.width) / 2, y: 8 + (16 - size.height) / 2,- width: size.width, height: size.height),- from: .zero, operation: .sourceOver, fraction: 1, respectFlipped: true, hints: nil)+ let font = NSFont.systemFont(ofSize: 12, weight: .semibold)+ let labelWidth = ceil((heading as NSString).size(withAttributes: [.font: font]).width)+ let headingInk: NSColor = selected && expanded != nil ? .selectedMenuItemTextColor : .secondaryLabelColor+ text(heading, x: 16, y: 8, width: labelWidth, height: 18,+ size: 12, weight: .semibold, color: headingInk)+ if count > 0 {+ text("\(count)", x: 16 + labelWidth + 7, y: 8, width: clearRect.minX - labelWidth - 27,+ height: 18, size: 12, color: headingInk)+ }+ if item.isEnabled {+ symbol(expanded.map { $0 ? "chevron.down" : "chevron.right" } ?? "xmark",+ in: clearRect, color: secondary)}- text(item.title, x: 34, y: 7, width: bounds.width - 50, height: 20, color: primary)return}guard let entry else { return }let unread = entry["unread"] as? Bool == truelet message = entry["message"] as? String ?? ""- if unread {- (selected ? NSColor.selectedMenuItemTextColor : NSColor.systemBlue).setFill()- NSBezierPath(ovalIn: NSRect(x: 13, y: 13, width: 6, height: 6)).fill()+ if let activity {+ HarnessNativeActivity.draw(activity.symbol(frame: activityFrame), in: activityRect,+ color: !item.isEnabled || selected ? primary : activity.color)}- text(entry["title"] as? String ?? item.title, x: 28, y: 6,- width: bounds.width - 111, height: 19, weight: unread ? .semibold : .regular, color: primary)- text(time, x: bounds.width - 78, y: 8, width: 62, height: 17,+ let titleY: CGFloat = unread ? 6 : 5+ let timeWidth = ceil((time as NSString).size(withAttributes: [.font: NSFont.systemFont(ofSize: 12)]).width)+ text(entry["title"] as? String ?? item.title, x: 40, y: titleY,+ width: bounds.width - 56 - (time.isEmpty ? 0 : timeWidth + 12), height: 19,+ weight: unread ? .semibold : .regular, color: primary)+ text(time, x: bounds.width - 16 - timeWidth, y: titleY + 2, width: timeWidth, height: 16,size: 12, color: secondary, alignment: .right)- if unread {- text(entry["label"] as? String ?? "", x: 28, y: 26, width: bounds.width - 44,- height: 17, size: 12, color: secondary)- if !message.isEmpty {- text(message, x: 28, y: 43, width: bounds.width - 44, height: 32, color: primary, multiline: true)- }+ if unread && !message.isEmpty {+ text(message, x: 40, y: 26, width: bounds.width - 56, height: 32,+ color: primary, multiline: true)}- text(context, x: 28, y: bounds.height - 20, width: bounds.width - 44, height: 17,- size: 12, color: secondary)+ }++ private func symbol(_ name: String, in rect: NSRect, color: NSColor) {+ guard let icon = HarnessControlSymbols.image(name)?.copy() as? NSImage else { return }+ icon.lockFocus()+ color.set()+ NSRect(origin: .zero, size: icon.size).fill(using: .sourceAtop)+ icon.unlockFocus()+ let scale = min(1, min(16 / icon.size.width, 16 / icon.size.height))+ let size = NSSize(width: icon.size.width * scale, height: icon.size.height * scale)+ icon.draw(in: NSRect(x: rect.midX - size.width / 2, y: rect.midY - size.height / 2,+ width: size.width, height: size.height),+ from: .zero, operation: .sourceOver, fraction: 1, respectFlipped: true, hints: nil)}private func text(_ value: String, x: CGFloat, y: CGFloat, width: CGFloat, height: CGFloat,@@ -443,12 +517,14 @@ private final class HarnessStatusMenuRow: NSView {}override func resetCursorRects() {- if item?.isEnabled == true { addCursorRect(heading == nil ? bounds : clearRect, cursor: .pointingHand) }+ if item?.isEnabled == true {+ addCursorRect(heading != nil && expanded == nil ? clearRect : bounds, cursor: .pointingHand)+ }}override func mouseUp(with event: NSEvent) {let point = convert(event.locationInWindow, from: nil)- guard (heading == nil ? bounds : clearRect).contains(point) else { return }+ guard (heading != nil && expanded == nil ? clearRect : bounds).contains(point) else { return }activate()}diff --git a/desktop/macos/Runner/SwarmTitlebar.swift b/desktop/macos/Runner/SwarmTitlebar.swiftindex b6119fb26..4bf79556a 100644--- a/desktop/macos/Runner/SwarmTitlebar.swift+++ b/desktop/macos/Runner/SwarmTitlebar.swift@@ -1704,11 +1704,13 @@ private final class SwarmVoiceLabel: NSView {/// Mirrors hn and Dart's ten-frame, 100ms Braille clock. The channel sends only/// activity changes; animation never pushes workspace snapshots through Flutter.private let harnessActivityFrames = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]-private func harnessActivityFrame(at date: Date = Date()) -> Int {+func harnessActivityFrame(at date: Date = Date()) -> Int {Int(date.timeIntervalSince1970 * 1000) / 100 % harnessActivityFrames.count}-private struct SwarmTabActivity: Equatable {+/// Shared by native tabs and notification rows. These are Harness's activity+/// glyphs, not a second set of SF Symbols. Keep the tab's original geometry.+struct HarnessNativeActivity: Equatable {let mark: Stringlet label: Stringlet working: Bool@@ -1722,6 +1724,18 @@ private struct SwarmTabActivity: Equatable {working = payload["working"] as? Bool == truecolor = statusColor(payload["color"], fallback: .labelColor)}++ func symbol(frame: Int) -> String { working ? harnessActivityFrames[frame] : mark }++ static func draw(_ mark: String, in rect: NSRect, color: NSColor) {+ let font = NSFont.monospacedSystemFont(ofSize: 13, weight: .regular)+ let paused = mark == "||"+ let marker = NSAttributedString(string: mark,+ attributes: [.font: paused ? NSFontManager.shared.convert(font, toSize: font.pointSize * 0.65) : font,+ .kern: paused ? -font.pointSize * 0.15 : 0, .foregroundColor: color])+ marker.draw(at: NSPoint(x: rect.midX - marker.size().width / 2,+ y: rect.midY - marker.size().height / 2))+ }}private final class SwarmStatusBar: NSView {@@ -2075,7 +2089,7 @@ private final class SwarmTabStrip: NSView {tab.keyboardFocus = tabsFocused && id == activeIdtab.actionsEnabled = actionsEnabledtab.attention = (row["attention"] as? Int ?? 0) > 0- tab.activity = SwarmTabActivity(row["activity"] as? [String: Any])+ tab.activity = HarnessNativeActivity(row["activity"] as? [String: Any])tab.emit = { [weak self, weak tab] method, args inguard let self, let tab, self.actionsEnabled,self.tabs.contains(where: { $0 === tab }) else { return }@@ -2404,7 +2418,7 @@ private final class SwarmTabButton: NSView, NSDraggingSource, NSMenuItemValidati}var selected = false { didSet { if selected != oldValue { invalidateLabel(); updateAccessibility() } } }var attention = false { didSet { if attention != oldValue { invalidateLabel(); updateAccessibility() } } }- var activity: SwarmTabActivity? {+ var activity: HarnessNativeActivity? {didSet { if activity != oldValue { invalidateLabel(); updateAccessibility() } }}var activityFrame = 0 {@@ -2413,7 +2427,7 @@ private final class SwarmTabButton: NSView, NSDraggingSource, NSMenuItemValidati// Keep the old question payload useful for an older Flutter fixture/runner.private var activityLabel: String? { activity?.label ?? (attention ? "Needs your input" : nil) }private var activityMark: String? {- if let activity { return activity.working ? harnessActivityFrames[activityFrame] : activity.mark }+ if let activity { return activity.symbol(frame: activityFrame) }return attention ? "?" : nil}private var titleRect: NSRect {@@ -2620,16 +2634,11 @@ private final class SwarmTabButton: NSView, NSDraggingSource, NSMenuItemValidatiwidth: titleRect.width, height: text.size().height))}if !displaysShortcut, let activityMark {- let font = NSFont.monospacedSystemFont(ofSize: 13, weight: .regular)- let paused = activityMark == "||"- let marker = NSAttributedString(string: activityMark,- attributes: [.font: paused ? NSFontManager.shared.convert(font, toSize: font.pointSize * 0.65) : font,- .kern: paused ? -font.pointSize * 0.15 : 0,- .foregroundColor: activity?.color ?? NSColor.systemOrange])NSGraphicsContext.saveGraphicsState()bounds.clip()- marker.draw(at: NSPoint(x: activityRect.midX - marker.size().width / 2,- y: contentCenterY - marker.size().height / 2))+ HarnessNativeActivity.draw(activityMark,+ in: NSRect(x: activityRect.minX, y: contentCenterY - 8, width: activityRect.width, height: 16),+ color: activity?.color ?? .systemOrange)NSGraphicsContext.restoreGraphicsState()}if displaysShortcut, let shortcut = shortcutLabel {diff --git a/desktop/test/status_menu_test.dart b/desktop/test/status_menu_test.dartindex 4bac6efbc..f6be20748 100644--- a/desktop/test/status_menu_test.dart+++ b/desktop/test/status_menu_test.dart@@ -6,6 +6,7 @@ import 'package:flutter_test/flutter_test.dart';import 'package:harness/core/models.dart';import 'package:harness/notify/alert_sounds.dart';import 'package:harness/state/app_state.dart';+import 'package:harness/state/harness_activity.dart';import 'package:harness/state/notification_inbox.dart';import 'package:harness/state/status_menu.dart';import 'package:harness/state/terminal_pane.dart';@@ -173,6 +174,7 @@ void main() {});var rows = statusMenuEntries(app);expect(rows.map((r) => r['agentId']), ['a1', 'a2', 'a0']);+ expect(rows.map((r) => (r['activity'] as Map)['mark']), ['?', '✗', '✓']);expect(rows.first['message'], 'Keep the shell running?');expect(rows.first['receivedAt'],@@ -199,6 +201,12 @@ void main() {reason: 'Live text cannot replace unread news',);expect(rows.last['readToken'], done['readToken']);+ expect(+ rows.last['activity'],+ nativeActivityPayload(HarnessActivity.done),+ reason:+ 'The mark describes the unread receipt, even during a newer turn',+ );await app.handleEventForTest('m', {'type': 'turn_summary','agentId': 'a0',@@ -258,6 +266,10 @@ void main() {reason: 'No invented elapsed time on reconnect',);expect(working.every((r) => r['unread'] == false), isTrue);+ expect(+ working.every((r) => (r['activity'] as Map)['working'] == true),+ isTrue,+ );expect(statusMenuEntries(app).map((r) => r['agentId']), ['a1', 'a3']);var changes = 0;app.addListener(() => changes++);@@ -381,6 +393,17 @@ void main() {);expect(rows(), hasLength(2));expect(updates.last['unread'], rows().length);+ Map tabActivityFor(String id) =>+ (updates.last['tabs'] as List).cast<Map>().singleWhere(+ (tab) => tab['id'] == id,+ )['activity']+ as Map;+ expect(+ rows().singleWhere((row) => row['agentId'] == 'a8')['activity'],+ tabActivityFor(resultTab),+ reason:+ 'Menu and tab share the exact status glyph, label and theme ink',+ );final stale = rows().singleWhere((r) => r['agentId'] == 'a8');app.agentUnread.mark('m', 'a8', AlertKind.failed, fresh: true);await tester.pump();@@ -447,6 +470,7 @@ void main() {.single;expect(work['agentId'], 'a8');expect(work['unread'], isFalse);+ expect(work['activity'], tabActivityFor(originalTab));expect(updates.last['unread'], 0);await select('openStatusHarness', work);expect(app.focusedPane, same(result));diff --git a/desktop/tool/status_menu_checks.swift b/desktop/tool/status_menu_checks.swiftindex ac65e381c..aab97f31c 100644--- a/desktop/tool/status_menu_checks.swift+++ b/desktop/tool/status_menu_checks.swift@@ -26,7 +26,9 @@ private func fixture(_ agent: String, project: String = "autonomous-harness","agentId": agent, "title": agent, "tabName": tabId == nil ? "Other sessions" : tabName, "unread": unread,"detail": "Office Mac · \(project)", "machineName": "Office Mac","message": "The reconnect fix is ready for you to try.",- "receivedAt": Date().timeIntervalSince1970 * 1000 - 120_000]+ "receivedAt": Date().timeIntervalSince1970 * 1000 - 120_000,+ "activity": ["mark": unread ? "✓" : "⠋", "label": unread ? "Finished · unread" : "Working",+ "working": !unread, "color": Int64(0xff11a8cd)]]row["tabId"] = tabIdif unread { row["readToken"] = token; row["label"] = "Finished" }if offline { row["unavailable"] = "Offline" }@@ -42,6 +44,33 @@ private extension HarnessStatusMenu {menu.items.first { ($0.representedObject as? [String: Any])?["agentId"] as? String == agent }!}func click(_ item: NSMenuItem) { menu.performActionForItem(at: menu.index(of: item)) }++ func checkActivityLifecycle() throws {+ let running = fixture("Running", unread: false)+ update(["enabled": true, "statusMenuEntries": [], "statusMenuWorkingEntries": [running]])+ let view = row("Running").view as! HarnessStatusMenuRow+ try check(activityTimer == nil && view.activity?.mark == "⠋", "Closed menus have the shared Working mark and no clock")+ menuWillOpen(menu)+ if !NSWorkspace.shared.accessibilityDisplayShouldReduceMotion {+ try check(activityTimer != nil, "Opening expanded Working starts the native clock")+ }+ let rect = view.frame+ let label = view.accessibilityLabel()+ for frame in 0..<10 { view.activityFrame = frame }+ try check(view.frame == rect && view.accessibilityLabel() == label,+ "Animation leaves row geometry and accessibility announcements stable")+ update(["enabled": true, "reduceMotion": true, "statusMenuEntries": [], "statusMenuWorkingEntries": [running]])+ try check(activityTimer == nil && view.activityFrame == 0, "Reduce Motion stops an open menu's animation")+ menuDidClose(menu)+ update(["enabled": true, "statusMenuEntries": [], "statusMenuWorkingEntries": [running]])+ menuWillOpen(menu)+ click(item("toggleWorking"))+ try check(activityTimer == nil && row("Running").isHidden, "Collapsing Working stops its clock")+ click(item("toggleWorking"))+ menuDidClose(menu)+ try check(activityTimer == nil, "Closing the menu releases its clock")+ update([:])+ }}_ = NSApplication.shared@@ -50,16 +79,17 @@ var reveals = 0let status = HarnessStatusMenu(installStatusItem: false, showWindow: { reveals += 1 },emit: { emitted.append(($0, $1)) })do {+ try status.checkActivityLifecycle()var rows = [fixture("General chat conversation"),fixture("DeepSeek model", project: "No Project", unread: false),fixture("Math addition inquiry", project: "No Project", tabId: nil, offline: true)]status.update(["enabled": true, "statusMenuEntries": rows])try check(status.menu.items.filter { $0.identifier?.rawValue == "openStatusHarness" }.count == 2,"One row per unread session")- try check((status.row("General chat conversation").view?.frame.height ?? 0) > 64 &&- (status.row("General chat conversation").view?.frame.height ?? 0) <= 98 &&+ try check((status.row("General chat conversation").view?.frame.height ?? 0) >= 50 &&+ (status.row("General chat conversation").view?.frame.height ?? 0) <= 70 &&status.row("General chat conversation").view?.accessibilityLabel()?.contains("reconnect fix") == true,- "Multiline rows expose the actual message to accessibility")+ "Compact rows expose the actual message to accessibility")try check(status.item("clearStatusNotifications").view?.accessibilityLabel()?.contains("Notifications (2)") == true &&!status.menu.items.contains { $0.title == "Build" }, "One notification section replaces tab headings")try check(!status.row("Math addition inquiry").isEnabled, "Offline conversations stay visible but disabled")@@ -116,7 +146,9 @@ do {try check(reveals == 3, "Show Harness remains available during a modal")status.update(["enabled": true, "statusMenuEntries": []])try check(status.menu.items.contains { $0.title == "No unread notifications" } &&- !status.item("clearStatusNotifications").isEnabled, "An empty inbox is explicit and cannot be cleared")+ !status.item("clearStatusNotifications").isEnabled &&+ !status.menu.items.contains { $0.identifier?.rawValue == "toggleWorking" },+ "An empty inbox is explicit, cannot be cleared and has no empty Working section")let open = status.menu.items.first { $0.title == "Open Harness…" }!status.click(open)try check(emitted.last?.0 == "addAgent" && reveals == 4,@@ -183,15 +215,16 @@ do {var working = (0..<7).map { fixture("Working \($0)", unread: false) }status.update(["enabled": true, "statusMenuEntries": (0..<8).map { fixture("News \($0)") },"statusMenuWorkingEntries": working])- try check(status.menu.items.filter { $0.identifier?.rawValue == "openStatusHarness" && !$0.isHidden }.count == 5 &&+ try check(status.menu.items.filter { $0.identifier?.rawValue == "openStatusHarness" && !$0.isHidden }.count == 10 &&status.item("notificationInbox").title == "View all 8 notifications…","The glance is bounded, with a route to every unread notification")let toggle = status.item("toggleWorking")- try check(toggle.title == "Working (7)" && status.row("Working 0").isHidden,- "Working starts collapsed")+ try check(toggle.title == "Working (7)" && !status.row("Working 0").isHidden,+ "Working starts expanded, including after an empty bootstrap")status.menuWillOpen(status.menu)- try check(toggle.view?.accessibilityPerformPress() == true && !status.row("Working 0").isHidden,- "Disclosure expands inline through the accessible native control")+ try check(toggle.view?.accessibilityPerformPress() == true && status.row("Working 0").isHidden,+ "Disclosure collapses inline through the accessible native control")+ _ = toggle.view?.accessibilityPerformPress()let overflow = status.item("moreWorking")try check(overflow.submenu?.items.count == 2, "Additional work stays available without flooding the overview")func keyEvent(_ code: UInt16) -> NSEvent {diff --git a/desktop/tool/status_menu_preview.swift b/desktop/tool/status_menu_preview.swiftindex 8a434e655..78630f60b 100644--- a/desktop/tool/status_menu_preview.swift+++ b/desktop/tool/status_menu_preview.swift@@ -10,7 +10,7 @@ func news(_ id: String, _ title: String, _ message: String, tab: String, machinelabel: String = "Ready for review") -> [String: Any] {["machineId": machine, "agentId": id, "title": title, "message": message,"tabId": tab, "tabName": tab, "machineName": machine, "unread": true,- "label": label, "readToken": id, "receivedAt": timestamp - age * 1000]+ "label": label, "activity": ["mark": label == "Needs input" ? "?" : "✓", "label": label, "working": false], "readToken": id, "receivedAt": timestamp - age * 1000]}let notifications = [news("hn", "hn", "Keep the shell running after detach?", tab: "TUI", machine: "M2", age: 10, label: "Needs input"),@@ -28,14 +28,24 @@ let bindings: [[String: Any]] = []let map = HarnessNativeKeymap(["version": 1, "contexts": ["workspace": bindings, "terminal": [], "picker": [], "project": []]])!-func render(_ name: String, dark: Bool, entries: [[String: Any]], work: [[String: Any]], expanded: Bool = false,+func render(_ name: String, dark: Bool, entries: [[String: Any]], work: [[String: Any]], expanded: Bool = true,highlight: Bool = false) {app.appearance = NSAppearance(named: dark ? .darkAqua : .aqua)let status = HarnessStatusMenu(installStatusItem: false, showWindow: {}, emit: { _, _ in })status.menu.appearance = app.appearancestatus.updateKeymap(map, context: "workspace")- status.update(["enabled": true, "statusMenuEntries": entries, "statusMenuWorkingEntries": work])- if expanded, let toggle = status.menu.items.first(where: { $0.identifier?.rawValue == "toggleWorking" }) {+ func styled(_ row: [String: Any], working: Bool = false) -> [String: Any] {+ var row = row+ var activity = row["activity"] as? [String: Any] ?? ["mark": "⠋", "label": "Working", "working": true]+ let mark = activity["mark"] as? String+ activity["color"] = mark == "?" ? (dark ? 0xffe5e510 : 0xff4d2d00)+ : working ? (dark ? 0xff11a8cd : 0xff1b7c83) : (dark ? 0xff0dbc79 : 0xff116329)+ row["activity"] = activity+ return row+ }+ status.update(["enabled": true, "statusMenuEntries": entries.map { styled($0) },+ "statusMenuWorkingEntries": work.map { styled($0, working: true) }])+ if !expanded, let toggle = status.menu.items.first(where: { $0.identifier?.rawValue == "toggleWorking" }) {_ = toggle.view?.accessibilityPerformPress()}var captured = false@@ -77,10 +87,10 @@ func render(_ name: String, dark: Bool, entries: [[String: Any]], work: [[Stringrender("notification-overview-light", dark: false, entries: notifications, work: working)render("notification-overview-dark", dark: true, entries: notifications, work: working)-render("notification-overview-working", dark: false, entries: notifications, work: working, expanded: true)+render("notification-overview-collapsed", dark: false, entries: notifications, work: working, expanded: false)render("notification-overview-empty", dark: false, entries: [], work: [])let long = news("long", String(repeating: "Long session title ", count: 6),- String(repeating: "A lengthy question that must wrap and then truncate without covering its tab and machine context. ", count: 8),+ String(repeating: "A lengthy question that must wrap and then truncate without covering its time or status mark. ", count: 8),tab: "Desktop with an unusually long tab name", machine: "Office Mac with a long machine name", age: 180, label: "Needs input")var offline = notifications[1]offline["unavailable"] = "Offline"diff --git a/desktop/tool/swarm_titlebar_checks.swift b/desktop/tool/swarm_titlebar_checks.swiftindex 800a4db12..e4f97a856 100644--- a/desktop/tool/swarm_titlebar_checks.swift+++ b/desktop/tool/swarm_titlebar_checks.swift@@ -140,7 +140,7 @@ private extension SwarmTabButton {}try checkTitlebar(pictures.count == 10, "All ten Braille frames render distinctly")for (mark, label) in states {- activity = SwarmTabActivity(payload(mark, label))+ activity = HarnessNativeActivity(payload(mark, label))layoutSubtreeIfNeeded()try checkTitlebar(preferredWidth == width && (mark.isEmpty || activityRect == rect),"\(label) preserves tab width and visible marks share their inline cell")@@ -174,7 +174,7 @@ private extension SwarmTabButton {func checkShortNamesFit() throws {for name in ["desktop", "device", "swarm", "daemons", "web", "tui", "mobile"] {displayLabel = name- activity = SwarmTabActivity(["mark": "", "label": "Idle", "color": Int64(0xff999999)])+ activity = HarnessNativeActivity(["mark": "", "label": "Idle", "color": Int64(0xff999999)])frame.size.width = preferredWidthlet available = titleRect.widthtry checkTitlebar(available >= max(label.size().width, emphasizedLabel.size().width),@@ -342,7 +342,7 @@ private extension SwarmTabButton {symbol.renderedBitmap().colorAt(x: 1, y: 1)!.alphaComponent == 0,"Symbols emphasize their ink on hover without changing weight or adding a background")shortcutHint = "⌘2"- activity = SwarmTabActivity(["mark": "⠋", "label": "Working", "color": Int64(0xff64d2ff)])+ activity = HarnessNativeActivity(["mark": "⠋", "label": "Working", "color": Int64(0xff64d2ff)])layoutSubtreeIfNeeded()let width = preferredWidthlet resting = renderedPixels()@@ -395,7 +395,7 @@ private extension SwarmTabButton {name = "1: Release planning"displayLabel = nameshortcutHint = "⌘2"- activity = SwarmTabActivity(["mark": "⠋", "label": "Working", "color": Int64(0xff64d2ff)])+ activity = HarnessNativeActivity(["mark": "⠋", "label": "Working", "color": Int64(0xff64d2ff)])layoutSubtreeIfNeeded()let title = titleRect, close = closeButton.frame, width = preferredWidthtry checkTitlebar(closeButton.isHidden && !displaysShortcut,