Files
orca/config
Neil a3b472d050 refactor(renderer): decompose App.tsx into an app-shell module (#14607)
* refactor(renderer): decompose App.tsx into an app-shell module

App.tsx was 2831 lines behind an `eslint-disable max-lines` and a
grandfathered entry in the max-lines ratchet baseline. It is now 92 lines:
a root element, the shared providers, and three children.

The body is split by concern into src/renderer/src/app-shell/:

- use-app-chrome-layout — titlebar/sidebar/workbench layout derivations
- use-floating-workspace-panel — overlay open state, persistence, return focus
- use-app-startup-hydration — the boot chain (order preserved verbatim)
- use-app-session-persistence — session writer + shutdown checkpoint
- use-persisted-ui-writer / use-document-appearance /
  use-runtime-graph-sync / use-window-visibility-effects
- use-onboarding-and-feature-tips — first-run education gating
- use-global-keybindings + app-command-handlers — window shortcut dispatch
- use-app-shell-services — app-level subscriptions that outlive any surface
- AppWorkspaceShell / AppRootSurfaces / AppBackgroundServices / titlebar parts

Two startup branches that no longer needed to sit inline moved to
src/renderer/src/startup/: startup-ssh-connection-restore and
startup-degraded-recovery.

No behavior change. Sibling order of root overlays and modals is preserved
so stacking is unchanged; the sidebar's virtualized scroll refs still live
above the sidebar's remount boundary.

The source-assertion tests in app-startup-routing.test.ts follow the code to
its new files. The one that claimed to check "first-window startup services
before terminal reconnect" was matching the degraded-recovery block, not the
success path; it now asserts the success path, and the degraded ordering
keeps its own dedicated test.

Removes the disable comment and drops App.tsx from
config/max-lines-baseline.txt.

* refactor(renderer): move app-shell ref writes out of render

React Doctor's changed-lines purity gate flags three render-phase ref
writes in the new app-shell files. The patterns predate the split, but
moving them into new files brings them into the gate.

- use-app-chrome-layout: the terminal-workbench latch becomes state set
  during render (the pattern use-lazy-modal-mounts already uses). The
  `canMountTerminalWorkbenchNow ||` term keeps the current render correct,
  so the latch only has to be visible to the next one.
- use-app-startup-hydration: the onboarding callback ref syncs in an effect
  declared before the boot chain, so it lands first on mount. The callback
  is a `useCallback([])`, so its identity never actually changes.
- use-global-keybindings: the shortcut-state mirror syncs in useLayoutEffect,
  which commits before any key event can read it. Key events are discrete,
  so handlers always observe committed state.

All three now hold committed state only, so nothing can leak from a render
React discards — the behavior the gate is protecting.

pnpm run check:react-doctor:changed: 0 errors (was 3).
2026-08-14 17:46:44 -07:00
..
2026-08-05 12:09:24 -07:00