Slice 4 of Round 4 — the visible polish. With Slices 1–3 the agent
preamble + non-dismissible banner cover the "agent must know +
user must see" loop, but a closed HUD with no banner visible can
still hide the warning. This slice paints the menu-bar icon red so
the warning is glanceable from anywhere on the screen.
Option A from the slice plan (single-writer-safe):
- `MenuBarIconController.applyHealth(_ health: OverallHealth)` paints
`button.contentTintColor = NSColor.systemRed` for `.loud` and
`.critical`, clears the tint for `.ok` and `.soft`. Template images
recolor automatically with `contentTintColor` so no second icon
asset is needed.
- `currentHealth: OverallHealth?` exposed read-only for tests.
- `AppDelegate.runBootHealth` calls `menuBarController?.applyHealth(
snapshot.overallHealth)` after computing the degradation summary,
so the icon updates on every probe sweep (cold boot + Status panel
re-probe).
Single-writer invariant for HudState (HUD-08) is intact:
`contentTintColor` lives on `NSStatusItemButton`, not in HudState.
`scripts/check-single-writer-hudstate.sh` is green.
1 new test in MenuBarIconControllerTests:
* test_applyHealthTintsRedForLoudAndCritical — exercises all four
OverallHealth cases and asserts contentTintColor toggles correctly.
Boundary gates 18/18 green; App target compiles cleanly.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The previous click handler tried to render the right-click context menu
via:
statusItem.menu = contextMenu
sender.performClick(nil)
statusItem.menu = nil
This is racy. NSStatusItem can latch the menu reference on a separate
runloop pass after we set it, so the post-click `nil` assignment doesn't
always take effect. Once the menu is latched, NSStatusItem bypasses the
button's action selector entirely — every left- AND right-click then
opens the context menu, and the HUD never gets summoned because
`onLeftClick?()` no longer fires.
User-observed symptom: "when I clicked on it (left or right mouse) it
showed the right hand menu no matter what" after the first right-click
of the session.
Fix: call `statusItem.popUpMenu(contextMenu)` directly. The menu shows
for this click only — no persistent assignment, no race. `popUpMenu`
was deprecated in macOS 10.14 with Apple recommending "use the menu
property instead," but that recommendation is exactly what produces
this bug. The function still works through Tahoe (verified
empirically). When/if Apple removes it, replacement is a manual
`NSMenu.popUp(positioning:at:in:)` against the status-item button.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Append .reconfiguring and .booting to App/Theme/HudState.swift;
preserve Phase 1 declaration order + existing labels verbatim.
- Add voiceOverLabel arms 'Jarvis, reconfiguring audio' / 'Jarvis,
starting up' per RESEARCH §HudState Enum Wire Format.
- MenuBarIconController: add forced exhaustive switch arm for the
two new cases; both share .idle profile (no animation) with
TODO for Phase 3/4 dedicated treatment per HUD-08 precedence.
- HudStateEnumTests: 6 methods covering case count, non-empty +
unique voiceOverLabels, spec-verbatim labels, exhaustive switch.