fix(widget): turning the widget on no longer squeezes the panel into a pill

AD
4d ago
+7-2

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.$compactMode and nav.$compactExpanded sinks in PanelController call applyCompactLayout() through DispatchQueue.main.async. @Published sinks fire in willSet, and the Widget toggle sets compactMode and then compactExpanded, 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 live NSPanel. 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:

  1. In Settings, switch Widget off, then on again.
  2. The panel stays open at full size, with a normal frame and no pill-sized window.
  3. Press the hotkey twice. It hides, then shows the full panel.
  4. 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.