feat(workbench,ui): matched-geometry view transition on session switch - #299
feat(workbench,ui): matched-geometry view transition on session switch#299AprilNEA wants to merge 1 commit into
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".
| } | ||
| headerTitle()?.style.removeProperty('view-transition-name'); | ||
| source.style.setProperty('view-transition-name', PAIR_NAME); | ||
| const transition = document.startViewTransition(() => { |
There was a problem hiding this comment.
Serialize overlapping session-switch transitions
When two session selections occur before the first View Transition update callback runs, both calls retain the same rendered currentLocation, leave multiple source titles temporarily named thread-title, and queue separate apply callbacks. This can make Chromium skip the matched transition because the old snapshot has duplicate names, while navigation history records the stale origin twice so Back skips the intermediate thread. Rapid consecutive clicks or shortcut/palette selections can trigger this; cancel or serialize the pending switch and ensure history is recorded with the selection that actually applies.
Useful? React with 👍 / 👎.
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