refactor(desktop): remove the notch-era window modes and hover machinery

Merged
DA
10d ago
+76-578

Follows #1926 (merged). Dean asked: "We also still have a similar weird notch behavior for sign-in. Let's have that workspace clean up all old notch interactions." #1926 replaces the sign-in slot. This PR removes the notch-era window-mode and hover/leave machinery that no longer means anything in an ordinary window.

Why it was safe: in a normal window pointerInside starts true, and the only place that sets it false is onHitRegionLeave, which every caller reaches only after checking !pointerInside(). So the hover-leave / settle / receded chain could never run. The window-mode act always answered "expanded".

Removed

IPC and main process

  • ACT_KIND.WINDOW_SET_EXPANDED (window.setExpanded): its schema, router row, and testing fixture
  • WindowMode (packages/surface/src/geometry.ts, plus re-exports in @sidecar/surface and shared/messages/session.ts)
  • PanelManager: setMode, modeFor, initialMode, diagnostic, onWindowFactsChanged. Also the "mode:expanded" lifecycle send.
  • AppWindowFacts.mode and .display, plus DisplayDiagnostic. The snapshot guard now checks only the role.
  • The second launch's --expanded branch (window-service.ts), and the flag in scripts/evidence.sh and docs/PLANNING.md. A plain second launch already reconciles and focuses the window.
  • The setPointerInterception bridge entry and its setIgnoreMouseEvents(…, { forward: true }) report. Nothing called it.

Renderer

  • use-panel-presentation.ts, the whole file: hover timers, onHitRegionLeave, panelReceded, changeAskEngagement, settle, changeMode, applyAuthoritativeMode, the planning-call hold. Replaced by one useStateWithRef<PanelPresentation> in App.
  • LEAVE_DELAY_MS and SETTLE_DELAY_MS (panel-state.ts)
  • App: the greeting effect that "opened the panel" on a gated launch, the onLifecycle subscription (mode:expanded, and tab:settings, which nothing sends), the planningHeld / feedbackHeld refs, and the effect that released a call's hold on the pointer
  • The Escape ladder's last rung (changeMode(false), "close the panel"). Escape on the new-plan page now does nothing.
  • The settings-search engagement chain (onEngagedChange → onSearchEngaged → onSettingsSearchEngaged), which only held the panel open against the pointer
  • PanelEntrySurface / use-panel-entry.ts: pointerInside, onReleasedWhileAway, cancelHover, settle, heldRef, and the post-send settle branch
  • Three WINDOW_FOCUS_PANEL calls on focus (settings search, select rows, shortcut recorders). They worked around a notch panel that could show without being the key window.
  • planningCallHoldsPanel renamed to planningCallInProgress; nothing holds a panel any more
  • use-panel-presentation.ts taken off effect-edges.json's rawAsyncPrimitives

Kept on purpose

  • The voice window (renderer/voice/) and WingFace: both live.
  • The feedback slot and its plumbing (PANEL_PRESENTATION.FEEDBACK, usePanelEntry, .panel-surface, .desktop-scrim, data-presentation, panelOpen): the feedback-composer redo (another workspace) is replacing them with a dialog. Whichever of us merges second deletes what is then dead.
  • The notch geometry and caption choreography CSS in base.css (--capsule-*, --peek-*, --voice-band-*, --slot-*, .panel-surface), which desktop.css mostly overrides. It is tangled with the feedback sheet, so it goes in a follow-up once the feedback redo lands.
  • The caption's hover hold (strip-hold.ts): it still works in a window, keeping a reply up while the pointer rests on it.
  • WINDOW_FOCUS_PANEL itself: #1926 uses it to bring the window back after the browser sign-in.

Tests

  • bridge.test.ts: a snapshot whose window carries only its role is accepted (the old guard refused it), and one with no role is refused.
  • act-router.test.ts: the cases that used window.setExpanded as a sample valued act now use microphone.request.
  • No other behaviour a user can observe changes, so the rest is deletion covered by the existing suites.

./scripts/check.sh exits 0.

Mac verification: CI builds nothing for the Mac and could not verify this. ./scripts/verify.sh was not run (this was built on a Linux VM). The scripts/evidence.sh edit only drops a flag the first launch never read. LUKE-159 is the manual Mac pass.

šŸ¤– Generated with Claude Code