Files
orca/config
OrcaWinandm4air 8db8905fac perf(switch): do less work in the workspace-switch frame (#35185)
* perf(i18n): cache option-free translations per language and resource version

A workspace switch re-renders chrome that resolves hundreds of static strings
through i18next (~3 ms per switch). Option-free lookups only change with the
language or the loaded resources, so cache them keyed on both.

* perf(file-search): skip file search state writes that change nothing

Every workspace switch cancels the outgoing workspace's idle search, which wrote
an identical state object and re-notified every store subscriber.

* perf(sidebar): keep unchanged worktree cards and project headers memoized across switches

A plain press replaces the sidebar selection, and the selection-keyed gesture
callbacks plus the shared selectedWorktrees array were passed to every card, so
every card and its menus re-rendered on each workspace switch. Gesture callbacks
now read the latest selection from a ref, only selected rows receive the
selection, and project header actions are memoized.

* test(terminal): bound toast translations from above now that static strings are cached

* perf(terminal): stop re-rendering hidden panes and retained tab strips on workspace switches

Hidden panes re-measured their title-overlay rects on every switch, forcing a
layout and clearing the rects, which re-rendered the pane once on hide and again
on show. Hidden overlays are display:none, so they keep their last rects until
shown. Retained tab strips subscribed to the active repo and worktree for a
Windows-only shell menu, re-rendering every strip; those reads are gated like
the project maps beside them.

* perf(app-shell): let root overlays skip the App render a workspace switch causes

App re-renders on every switch (its chrome layout tracks the active worktree),
and it handed fresh floating-workspace and onboarding objects to the root
overlays, re-rendering every overlay and dialog. Both objects are memoized,
AppRootSurfaces and the floating toggle button are memo components, and the
toggle callback is stable.

* perf(worktrees): switch the active repo and worktree in one store write

Activating a worktree in another project wrote activeRepoId and then the
active worktree separately, so every store subscriber re-ran its selector twice
(~1 ms per switch). The repo change now rides along as a state transition of the
same setActiveWorktree write, as the SSH server-copy activation already does.

* perf(app-shell): stop App re-rendering on workspace switches

App subscribed to the raw active worktree and tab ids through the chrome layout
and three sync hooks, so every switch re-rendered the whole app shell. The
layout now exposes booleans, shortcut dispatch and the titlebar expand button
read the active ids when they fire, and the git-status polling, web session tab
sync and review refresh reporting hooks run in a null gate component under
AppBackgroundServices.

* perf(worktrees): fold visit recency and nav history into the activation write

A switch wrote the active worktree, then the leave/enter recency stamps and the
nav-history entry as separate store writes, each re-running every subscriber's
selector. The stamps (resolved against the post-activation selection, as
markVisited did) and the history entry now ride in the same setActiveWorktree
state transition as the repo follow.

* perf(terminal): present instead of clearing the shared glyph atlas on worktree reveal

The settled reveal reset predates xterm's per-renderer page-layout versioning
(renderers now rebuild their model when a shared atlas page changes), so a
healthy atlas no longer needs re-rasterizing on every worktree switch. DPR
repair and system wake keep the full reset.

* fix(worktrees): keep fresh visit stamps when the activation's history entry is de-duplicated

* fix(app-shell): repaint memoized shell controls on a language change

* test(floating-terminal): stub the language subscription in the toggle button's hook harness

---------

Co-authored-by: m4air <m4air@Mac.localdomain>
2026-10-28 09:08:11 -07:00
..