feat(workbench,ui): matched-geometry view transition on session switch - #299
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 245bcf36ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
lucas77778
self-requested a review
July 29, 2026 11:42
lucas77778
approved these changes
Jul 29, 2026
This was referenced Jul 29, 2026
AprilNEA
added a commit
that referenced
this pull request
Jul 29, 2026
#313) ## Summary Replaces the imperative View Transition stopgap that #299 shipped (manual `startViewTransition`, generation guard, DOM name pairing) with React's official `<ViewTransition>` component, per the decision to allow the canary channel. Four commits: 1. **`chore(deps)`** — catalog react/react-dom → `19.3.0-canary-96fcba90-20260728` (web/desktop renderers only; mobile pins its own react — the stale catalog comment claiming otherwise is fixed). The canary export is **unprefixed** `ViewTransition` (stable-track; canary is the channel Next.js ships in production). `minimumReleaseAgeExclude` entries added; drop back to latest once 19.3 goes stable. 2. **`refactor(workbench,ui,desktop)`** — the declarative rewrite, shaped by two source-verified facts: - **Pairing is strictly mount/unmount-based** (react-dom's appearing-map × deletions walk — a persisting boundary never pairs). So the row title's boundary *unmounts when its row becomes active* (a plain span takes over, visually seamless) while the header's boundary remounts keyed by session — giving forward *and* return flights for free. - **zustand rides `useSyncExternalStore`, which never enters a transition lane** — `startTransition` around a store write does nothing. One `useDeferredValue(selectedId)` in `useWorkbenchSessions` bridges the render path into the lane (a documented ViewTransition trigger), and puts the row unmount + header mount in the same deferred commit, which the pairing requires. - `@linkcode/ui` gains a typed named re-export via an in-module `declare module 'react'` augmentation (@types/react tracks stable). The whole stopgap module + its 7 unit tests are deleted; interruption/coalescing is now React's own. 3. **`fix(assets)`** — drive-by: the committed pi closure manifest was stale since the ws 7→8 bump (#289) nested `ws@8.21.0` copies under the pi closure; `closure.test.ts` was already red on master. Regenerated. 4. **`refactor(webview)`** — extends the boundary to the web shell's title (the render point #299's follow-up commit 8e5b485 covered with the now-removed data attribute). Motion pacing moves to `::view-transition-group(*)` on `--motion-normal`; the app-level reduce-motion preference silences snapshot animations via CSS (the root-attached pseudos are out of reach of the `.reduce-motion *` reset). ## Verification - Drive probe against the built desktop app (isolated daemon + two real pi threads): 4 sidebar switches → 3 `document.startViewTransition` invocations (the rapid double-fire coalesced by React), zero console errors. - react-dom canary pairing semantics read from the installed production build, not guessed. - `biome` / `eslint` (serial — the concurrency OOM is CODE-468) / `tsc` green; full vitest suite 2056 passed, including the previously-red closure test. - Hand-feel needs the usual manual pass (switch, rapid clicks, reduce-motion on/off). Closes CODE-469
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Apple-grade UI Details batch 3: clicking a thread row now runs the switch inside a same-document View Transition — the row's title travels continuously to the conversation header instead of the content snapping (Chromium 148 native API, no library).
applySessionSwitchTransition(packages/client/workbench/src/surface/session-switch-transition.ts) wraps the sidebar'sselectpath: capability check, reduce-motion gate (appearance store), and a plain-apply fallback when the clicked row isn't in the DOM (palette selection of an off-screen thread, history traversal).view-transition-name— the clicked row's title (data-thread-title, cleared inside the update callback) in the old snapshot, the header title (data-conversation-title, cleared onfinished) in the new one. A duplicate name in either snapshot would make the browser silently skip the whole transition, which is also why the sidebar's N rows are never statically named.flushSync(suppressed lint with reason: the browser captures the new snapshot when the callback returns).MainChromeTitleand the shared defaultTitleStrip(webview gets the transition for free; non-Chromium browsers fall back via the capability check).::view-transition-group(thread-title)and the root crossfade at--motion-normal(250ms).Verification
pnpm check:ci+pnpm test(1944 passed) green.Closes CODE-457