Skip to content

refactor(ui): adopt React canary ViewTransition for the session switch - #313

Merged
AprilNEA merged 6 commits into
masterfrom
xuan/code-469
Jul 29, 2026
Merged

refactor(ui): adopt React canary ViewTransition for the session switch#313
AprilNEA merged 6 commits into
masterfrom
xuan/code-469

Conversation

@AprilNEA

Copy link
Copy Markdown
Member

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 lanestartTransition 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 (chore(deps): bump ws from 7.5.11 to 8.21.1 #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 feat(workbench,ui): matched-geometry view transition on session switch #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

@linear-code

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

CODE-469

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b63b4c476

ℹ️ 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".

Comment thread packages/presentation/ui/src/shell/sidebar/thread-row.tsx Outdated
Comment thread packages/client/workbench/src/surface/use-workbench-sessions.ts
@AprilNEA
AprilNEA merged commit 2a977ab into master Jul 29, 2026
10 checks passed
@AprilNEA
AprilNEA deleted the xuan/code-469 branch July 29, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants