Skip to content

ui-react: record the accepted destination crossfade and its D54 exception, and file its implementation briefs #2604

Open

Description

@schlessera

Context

Changing destination is instant. Chat, Graph and Activity (labelled "Actions" in the phone tab bar, packages/ui-react/src/components/layout/mobile-tab-bar.tsx:94-103) are views that the store swaps with no transition:

  • setActiveView (packages/ui-react/src/stores/ui-state.ts:240) and pressDestination (ui-state.ts:254-265) do the swap.
  • Graph and Activity are lazy chunks behind an empty Suspense fallback (packages/ui-react/src/lazy-pages.tsx:18-26).

The panel destinations (Files, Settings and the others) are Overlay panels. They already have entry-only motion: a sheet, panel or fade keyframe chosen by overlay variant, under prefers-reduced-motion: no-preference only (packages/ui-kit/src/tokens.css:2477-2490). Their close is instant by D54 (docs/decisions/design-kit/overlays.md:9-16).

document.startViewTransition is not used anywhere.

Guide ui-behaviors/same-document-transitions wraps the DOM update in document.startViewTransition(). React needs flushSync inside the callback so the update commits synchronously. The guide also says: "DO respect user preferences for reduced motion using the prefers-reduced-motion media query."

Support: Chrome Android 111, Samsung 22, Firefox Android 144 (MDN browser-compat-data). Without support, the change stays instant.

Binding decisions:

  • D22's "one ambient animation" (docs/decisions/design-kit/components-and-interactions.md:122). The ruling classifies the transition as responsive rather than ambient motion; the decision note records that.
  • D54's "Closing is instant" (docs/decisions/design-kit/overlays.md:14). Pressing Chat while a panel is open closes that panel. The ruling amends D54 for view-change closes only (below).

Accepted motion policy (maintainer, 2026-10-22)

The maintainer ruling selects a 120ms ease-out crossfade of the main view region only. Navigation chrome remains still. An open panel leaves with the old view’s snapshot while being removed from the live DOM at t=0; this explicitly amends D54’s instant-close rule for view-change closes only. Esc, Back, ✕, scrim and panel-to-panel closes stay instant. The proposal’s skip-when-overlay-open condition is superseded.

The rest of the supplied brief stands: responsive rather than ambient motion under D22; cuts for unresolved chunks, current destination, cold/hash changes, unsupported browsers and reduced motion (no startViewTransition call). Focus/input are live immediately and must be proven in real browsers, including composer interaction 50ms after a Chat press. The accepted follow-up order is decision note plus D54 amendment, kit snapshot styles, one app changeView helper, then optional independent idle prefetch of Graph/Activity.

This issue owns the durable accepted specification and scoped follow-up briefs; it does not implement the transition. No motion choice or amendment approval remains outstanding.

Scope

The motion choice is accepted (the 120 ms crossfade of the main view region above); this issue records it and prepares the implementation. It produces:

  • The decision note: the crossfade, its cuts, D22's responsive-motion classification, and the D54 amendment for view-change closes only, with Esc, Back, ✕, scrim and panel-to-panel closes staying instant.
  • Follow-up implementation issues in the accepted order, attached to Epic: layout and type adapt to the phone's viewport, keyboard and text size #2596: kit snapshot styles; one app changeView helper around the store update (startViewTransition plus flushSync, behind "startViewTransition" in document, with no call under reduced motion); then the optional, independent idle prefetch of Graph/Activity.

Delivery of the transition is gated on those implementation issues, not on closing this one.

Out of scope

  • Transition implementation; it belongs in the follow-ups even though the design is accepted.
  • Cross-document transitions: the app is one document.
  • Animating ordinary overlay closes. Only the explicitly approved view-change snapshot exception is allowed; record its D54 amendment.
  • In-view transitions such as list reorders and card arrival.

Acceptance criteria

  • The maintainer accepted the 120ms crossfade and view-change-only D54 exception.
  • Record the accepted decision note and D54 amendment; file the scoped implementation follow-ups under native parent Epic: layout and type adapt to the phone's viewport, keyboard and text size #2596 with the ruled timing, focus, reduced-motion and lazy-chunk criteria.
  • The D54 amendment is explicitly approved; no pending decision label is needed.
  • The helper follow-up tests that a panel is gone from the live DOM at t=0 while its old snapshot fades, and that a composer tap at 50ms succeeds.
  • Any follow-up's acceptance criteria require all of the following:
    • a real-browser test that the transition runs under no-preference and is skipped under reduce
    • a test that a browser without startViewTransition still changes view
    • a test that focus lands where pressDestination puts it today

Verification

# For the follow-ups; this issue is verified by the recorded ruling.
node scripts/visual.mjs --project=rail-fine --filter=desktop-navigation
node scripts/visual.mjs --project=rail-coarse --filter=phone-navigation

Contract impact

  • This touches the integration contract, so it needs the contract label, a CONTRACT: commit prefix, and the doc updated in the same commit.
  • This changes a published package's behaviour, so it needs a changeset.

None: this issue produces a design ruling.

2026-10-24: retitled and retyped as documentation (type: docs); rewrote Scope to the accepted branch (it still offered "a crossfade, a directional slide, or nothing"); made the implementation issues the delivery gate; removed the superseded 2026-10-22 readiness notes (they are in the comments).

Activity

  1. added
    type: feat
    area: ui-react
    priority: p3
    needs: design
    on Oct 22, 2026
  2. schlessera commented on Oct 22, 2026

    @schlessera
    OwnerAuthor

    Design needed: should moving between Chat, Graph and Activity animate?

    Some motion is already settled. Panels animate on entry and close instantly (D54), reduced motion removes entry motion, and D22 allows one ambient animation. The open question is whether the three view destinations get a transition at all. If they do, it needs a shape, a direction, a duration and a lazy-load behaviour that sit next to the existing panel slide without making the app feel slower. That is a judgement about feel. The code can do any of the options, and a "no" is as valid as any of them.

    You are deciding whether brain-kit's PWA animates changes between its view destinations (Chat, Graph, Activity), and designing that motion if so. brain-kit is a React PWA; the design kit is in packages/ui-kit and the app is in packages/ui-react.
    
    Read first
    - The issue this prompt is posted on, and its epic. Both are in schlessera/brain-kit; the epic is "Epic: layout and type adapt to the phone's viewport, keyboard and text size".
    - docs/decisions/design-kit/components-and-interactions.md: D22 at :100, and "one ambient animation" at :122. Also :60: reduced motion drops `breathe` to a static dot.
    - docs/decisions/design-kit/overlays.md:9-16: D54, "entry-only motion. Closing is instant." The swipe addendum is at :90.
    - docs/decisions/design-kit/navigation.md: D37, five destinations everywhere.
    - docs/decisions/design-kit/loading.md:53-59: ghost text is a loading state, not ambient motion.
    - packages/ui-kit/src/tokens.css:2477-2490: the existing overlay entry keyframes (sheet 200ms, panel 300ms, fade 120-150ms, all ease-out, no-preference only).
    - packages/ui-react/src/stores/ui-state.ts:240 (`setActiveView`) and :254-265 (`pressDestination`). Pressing the current destination does not change view; it scrolls to the start and moves focus.
    - packages/ui-react/src/lazy-pages.tsx:18-26: Graph and Activity are lazy chunks with an empty Suspense fallback.
    - Google's guide "ui-behaviors/same-document-transitions" and "ui-behaviors/directional-navigation-transitions" (https://github.com/GoogleChrome/modern-web-guidance).
    
    The problem
    Today a destination change is a hard cut. On a phone, the bottom tab bar switches Chat → Actions (the Activity view) with no sense of direction. The panel destinations (Files, Settings and the others) already have entry motion, so two kinds of destination now move differently. View Transitions are available in Chrome Android 111+, Samsung 22+ and Firefox Android 144+.
    
    Design: answer each question
    1. Animate at all? Answer yes or no, and give the reason in terms of how fast the app feels on a mid-range Android phone.
    2. If yes, which shape: a crossfade, or a directional slide that follows the phone tab bar's order? The order is Chat, Sessions, Actions (the Activity view), Files, More, and Graph is reached through More. Give the duration and easing, in relation to the 120-300ms entry motions already in tokens.css.
    3. What persists across the change? For example, the tab bar and side rail stay still via view-transition-name and do not cross-fade.
    4. Panel interplay: a view changes while a panel closes. For example, pressing Chat with Settings open closes Settings instantly under D54. Does the view still animate, and does the panel's close stay a cut?
    5. Lazy chunk: the first visit to Graph suspends for a frame or more. Does the transition wait for the chunk, or cut?
    6. Pressing the current destination: confirm that there is no transition.
    7. Reduced motion: confirm that "reduce" means an instant change.
    
    Requirements to hold
    - D54: no overlay close animation. If your answer needs one, say so explicitly: it amends D54 and needs a maintainer ruling.
    - D22: one ambient animation. A transition must be a response to a press and must end. Nothing loops.
    - Focus lands exactly where pressDestination puts it today, and no transition may delay focus.
    - Browsers without startViewTransition change view instantly.
    - No transition may delay the composer becoming typeable on Chat.
    - Odysseus is the only example world in any mock.
    
    Deliverable
    - A recommendation with the answers to 1-7, written as a short design-kit decision note.
    - ASCII storyboards at 390px (phone tab bar) and 1280px (side rail): three frames each for Chat → Activity and Activity → Chat.
    - If animating: the follow-up implementation issues, in landing order.
    - Acceptable outcome: "No: destination changes stay instant". Give the reason. That closes the issue.
    
  3. added
    type: spike
    agent-ready
    and removed
    type: feat
    needs: design
    on Oct 22, 2026
  4. schlessera commented on Oct 22, 2026

    @schlessera
    OwnerAuthor

    2026-10-22 triage at main aa8c8966b59f031f054f4876dbca84048b40ae4f: the complete brief produces a design answer and follow-up issues, not transition implementation. Classify it as type: spike, remove the circular needs: design prerequisite and add agent-ready. Its proposal still requires maintainer acceptance; D54 instant close, focus, reduced-motion and the documented-no outcome remain binding. Verified current destination/store and overlay motion source; native parent #2596 and explicit p3 are preserved. No animation choice or implementation is approved.

  5. schlessera commented on Oct 22, 2026

    @schlessera
    OwnerAuthor

    Design brief: should changing destination animate?

    Recommendation: use a 120 ms crossfade of the main region only, and only when nothing else is moving. Otherwise the change stays a cut, exactly as today.
    Runner-up: "No", destination changes stay instant. Rejected: a directional slide.

    Answers

    1. Animate at all? Yes, barely.
      • On a phone, switching from Chat's transcript to Actions' list is a hard cut between two unrelated layouts. A short crossfade tells the eye the content changed in place, while the bar stays put.
      • 120 ms is the shortest entry duration already in tokens.css (the fade overlay), so this adds no new tempo.
      • It costs no responsiveness. The store update commits inside the startViewTransition callback with flushSync, so the DOM, focus and the composer are live at t=0. Only the painted snapshot fades.
      • "No" loses only on polish. If the maintainer wants zero added motion, "No" is a clean answer and closes the issue.
    2. Shape: a crossfade.
      • Old and new fade together over 120 ms with ease-out, the same duration and easing as the existing fade entry.
      • A slide is rejected for three reasons:
        • The phone bar mixes views (Chat, Actions) with panels (Sessions, Files) that already have their own sheet or panel entry.
        • Graph has no position: it sits in More and the palette.
        • The rail at ≥900 px is vertical.
      • A slide would claim a spatial order the app does not have. It would also add a second direction vocabulary next to the 200 ms and 300 ms panel motions.
    3. What persists:
      • Only the main view region gets a view-transition-name. The root snapshot is turned off.
      • The tab bar, the rail, the safe-area strip and any open toast never fade.
      • The amber slot moves at t=0, with no slide or fade of its own.
    4. Panel interplay: skip the transition whenever any overlay is open at press time.
      • Example: pressing Chat with Settings open over Activity. The panel closes instantly (D54) and the view cuts.
      • A crossfade there would fade the panel out with the old snapshot. That is a close animation, so skipping keeps D54 intact with no amendment.
      • Graph from More works as expected. The sheet closes first, and the view change runs in onAfterClose, after the sheet has already been cut. So the crossfade runs on its own.
    5. Lazy chunk: cut, never wait.
      • If the Graph or Activity chunk is not resolved, change instantly.
      • Waiting would delay focus and freeze input. Crossfading into the empty Suspense fallback would fade to blank and then pop.
      • Follow-up 3 prefetches both chunks at idle, so the cut case becomes rare.
    6. Pressing the current destination: no transition. pressDestination records a destinationPress and changes no view (N3).
    7. Reduced motion: under reduce, change instantly. The helper does not call startViewTransition at all, so no snapshot is taken.

    Also covered:

    Decision note (for components-and-interactions.md, next to D22)

    Dxx: Destination changes crossfade. A change between views (Chat, Actions, Graph) crossfades the main region over 120 ms ease-out. It is responsive motion: it answers a press and ends, so it does not count against D22's one ambient animation. Navigation chrome never moves. There is no transition when an overlay is open at press time (D54 stays: closing is instant), when the target chunk is not loaded, when the destination is already shown, under prefers-reduced-motion: reduce, or without startViewTransition. Focus and input never wait for the transition.

    Storyboard: 390 px, Chat → Actions

     t=0 (press)              t=60 ms                  t=120 ms (done)
    ┌──────────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐
    │ Ithaca return      ⋯ │ │ Ith░ca ▒etu▒n      ⋯ │ │ Actions              │
    │──────────────────────│ │░░░░░░░░░░░░░░░░░░░░░░│ │──────────────────────│
    │ you  file the log    │ │ y░u ▒ Needs you · 2  │ │ Needs you · 2        │
    │ ◆ Filed voyage/      │ │ ◆ ░i▒ Approve note-… │ │ ▸ Approve note-filer │
    │   ithaca-return.md   │ │   ░t▒ Runs           │ │ Runs                 │
    │                      │ │      ▒ note-filer 06…│ │ ▸ note-filer   06:40 │
    │ [Ask the brain…    ⏎]│ │ [A░k▒the…          ]│ │                      │
    ├──────────────────────┤ ├──────────────────────┤ ├──────────────────────┤
    │▣Chat Sess  Act Files⋯│ │ Chat Sess ▣Act Files⋯│ │ Chat Sess ▣Act Files⋯│
    └──────────────────────┘ └──────────────────────┘ └──────────────────────┘
     amber moves at t=0;      old 50% / new 50%;       focus is where
     bar never fades          new DOM already live     pressDestination put it
    

    Storyboard: 390 px, Actions → Chat

     t=0 (press)              t=60 ms                  t=120 ms (done)
    ┌──────────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐
    │ Actions              │ │ Act░on▒ Ithaca ret…⋯ │ │ Ithaca return      ⋯ │
    │──────────────────────│ │░░░░░░░░░░░░░░░░░░░░░░│ │──────────────────────│
    │ Needs you · 2        │ │ Nee░s▒you  file the… │ │ you  file the log    │
    │ ▸ Approve note-filer │ │ ▸ A░p▒◆ Filed voyag… │ │ ◆ Filed voyage/      │
    │ Runs                 │ │ Run░ ▒  ithaca-retu… │ │   ithaca-return.md   │
    │ ▸ note-filer   06:40 │ │ ▸ n░t▒               │ │                      │
    │                      │ │ [A░k▒the brain…   ⏎]│ │ [Ask the brain…    ⏎]│
    ├──────────────────────┤ ├──────────────────────┤ ├──────────────────────┤
    │ Chat Sess ▣Act Files⋯│ │▣Chat Sess  Act Files⋯│ │▣Chat Sess  Act Files⋯│
    └──────────────────────┘ └──────────────────────┘ └──────────────────────┘
                              composer typeable now    (N3 addendum: focus stays
                              (DOM committed at t=0)    on the tab on a phone)
    

    Storyboard: 1280 px, Chat → Actions (Actions → Chat is the same frames reversed)

     t=0                                      t=60 ms                                  t=120 ms
    ┌────┬────────────┬──────────────────┐   ┌────┬───────────────────────────────┐   ┌────┬───────────────────────────────┐
    │RAIL│ Sessions   │ Ithaca return    │   │RAIL│ Se░s▒ons │ Ith▒ca  Actions     │   │RAIL│ Actions                       │
    │▣Cht│ ▸ Ithaca…  │ you  file the log│   │ Cht│ ░ I▒ha…  │ yo▒  Needs you · 2  │   │ Cht│ Needs you · 2                 │
    │ Ses│ ▸ Cyclops  │ ◆ Filed voyage/… │   │ Ses│ ░ C▒cl…  │ ◆ ▒  ▸ Approve note…│   │ Ses│ ▸ Approve note-filer          │
    │ Act│            │                  │   │▣Act│          │      Runs           │   │▣Act│ Runs                          │
    │ Fil│            │ [Ask the brain… ]│   │ Fil│          │ [A▒k ▸ note-filer   │   │ Fil│ ▸ note-filer           06:40  │
    │ Set│            │                  │   │ Set│          │                     │   │ Set│                               │
    └────┴────────────┴──────────────────┘   └────┴───────────────────────────────┘   └────┴───────────────────────────────┘
     rail never fades; at ≥1280 the Sessions pane belongs to Chat's main region, so it fades with it
    

    Follow-up issues, in landing order

    1. docs: record the decision note above. It is part of this ruling.
    2. ui-kit: view-transition styles for the main region.
      • ::view-transition-old/new(<main>) at 120 ms ease-out, only under no-preference.
      • Root snapshot off, so chrome never fades.
      • Byte-identical visual baselines, because nothing runs without a transition.
    3. ui-react: one changeView helper wraps setActiveView and pressDestination view changes.
      • It uses startViewTransition plus flushSync, behind "startViewTransition" in document.
      • It skips the transition when reduced motion is on, an overlay is open, the chunk is unresolved, the destination is already shown, or the change is driven by a hash or a cold launch.
      • Acceptance criteria, as required here:
        • A real-browser test that it runs under no-preference and is skipped under reduce.
        • A test that a browser without startViewTransition still changes view.
        • A test that focus lands where pressDestination puts it today.
        • Also: a tap on the composer 50 ms after pressing Chat focuses it.
    4. ui-react: prefetch the Graph and Activity chunks at idle after first paint, so the lazy cut case is rare. This is independent and can land at any point.

    For the maintainer

    • Crossfade or "No"? Everything above is ready either way.
    • Skip-when-a-panel-is-open (keeps D54) or amend D54 so the panel fades with the view? I recommend skip.
    • Duration: 120 ms (matches fade) or 150 ms (the upper end of the existing fades)?
  6. added
    type: feat
    needs: decision
    and removed
    type: spike
    agent-ready
    on Oct 22, 2026
  7. schlessera commented on Oct 22, 2026

    @schlessera
    OwnerAuthor

    2026-10-22 concurrent-state reconciliation: the requested design proposal arrived while triage readback was running. Folded its link, unapproved status and three remaining maintainer choices into the body, replacing the now-completed design-production scope note. Preserve the concurrent needs: decision/type: feat change and absence of agent-ready. This supersedes the earlier readiness-only spike note without approving motion or changing D54.

  8. schlessera commented on Oct 22, 2026

    @schlessera
    OwnerAuthor

    Maintainer ruling

    1. Animate: yes, as a crossfade of the main view region only. The tab bar, rail and safe-area strip stay still.
    2. Panel open at press time: the panel fades out with the view. This amends D54 (docs/decisions/design-kit/overlays.md:14, "Closing is instant"). The panel's close is instant except when the close is part of a view change. Then it leaves with the old snapshot in the same 120 ms crossfade. Every other close (Esc, Back, ✕, scrim tap, switching between panels) stays a cut.
    3. Duration: 120 ms, ease-out, matching the existing fade entry.

    The rest of the brief stands as written (#2604 (comment)). That covers what persists, the lazy chunk (cut, never wait), the current destination (no transition), reduced motion (instant, with no startViewTransition call) and unsupported browsers (instant). One change follows from ruling 2: the "skip when an overlay is open" condition is dropped from the helper and from the decision note.

    Updated decision note

    Dxx: Destination changes crossfade. A change between views (Chat, Actions, Graph) crossfades the main region over 120 ms ease-out. It is responsive motion: it answers a press and ends, so it does not count against D22's one ambient animation. Navigation chrome never moves. A panel open at the moment of the change leaves with the old view in the same crossfade. This is the one exception to D54's instant close (D54 amended). There is no transition when the target chunk is not loaded, when the destination is already shown, under prefers-reduced-motion: reduce, or without startViewTransition. Focus and input never wait for the transition.

    D54 amendment (overlays.md)

    Closing is instant, except when the close is caused by a view change (Dxx). Then the panel is part of the old view's snapshot and fades with it over 120 ms. Under reduced motion it stays instant.

    Follow-ups (landing order)

    1. docs: add Dxx and amend D54 in the same commit.
    2. ui-kit: add the view-transition styles for the main region. Panels sit inside the captured region (or join it) so they fade with the old view.
    3. ui-react: add the changeView helper, with the acceptance criteria from the brief. Add one test that a panel open at press time is gone from the DOM at t=0 (focus is not trapped in it) while its snapshot fades.
    4. ui-react: prefetch the Graph and Activity chunks at idle.
  9. added
    agent-ready
    and removed
    needs: decision
    on Oct 22, 2026
  10. schlessera commented on Oct 22, 2026

    @schlessera
    OwnerAuthor

    2026-10-22 readiness reconciliation: folded the maintainer ruling into the body, replacing the unresolved-choice specification and aligning scope/criteria with the accepted branch. The remaining work is explicitly scoped; add agent-ready. Preserve priority, native parent, assignment and release attribution. This is issue preparation, not implementation, runtime proof or delivery.

  11. changed the title [-]ui-react: decide whether changing destination animates[/-] [+]ui-react: record the accepted destination crossfade and its D54 exception, and file its implementation briefs[/+] on Oct 24, 2026
  12. added
    type: docs
    and removed
    type: feat
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: ui-reactpriority: p3type: docs

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions