fix(widget): turning the widget on no longer squeezes the panel into a pill
Summary
Turning Widget on in Settings could leave the panel squeezed into a pill-sized window around the full panel, after which the hotkey toggled from the broken state. The two layout sinks now run on the next run-loop turn.
Changes
nav.$compactModeandnav.$compactExpandedsinks inPanelControllercallapplyCompactLayout()throughDispatchQueue.main.async.@Publishedsinks fire inwillSet, and the Widget toggle setscompactModeand thencompactExpanded, so the second sink laid out pill mode against the stale expanded flag.- Callers that set a flag and call
applyCompactLayout()themselves are unaffected. - No unit test: the sinks live in
PanelController's setup and need a liveNSPanel. Verified by hand (below).
Testing
Automated: ./build.sh (no new warnings), make test-without-xcode (1447 tests, 0 failures), make typecheck-tests.
Manual, after make reload:
- In Settings, switch Widget off, then on again.
- The panel stays open at full size, with a normal frame and no pill-sized window.
- Press the hotkey twice. It hides, then shows the full panel.
- Click the pill (after collapsing it with
M) and confirm it expands to the full panel.
Related issues
None.
🤖 Generated with Claude Code
Summary by cubic
Fixes the widget toggle squeezing the panel into a pill-sized window.
The Widget toggle sets compactMode and then compactExpanded, and both layout sinks ran inline in @Published's willSet, so the second sink laid out pill mode against the stale expanded flag. Both sinks now run on the next run-loop turn, once the values have landed. Callers that set a flag and call applyCompactLayout() themselves are unaffected.