Skip to content

chore(NavigationStack): preview the draft record (not for merge) - #12002

Draft
vjeux wants to merge 15 commits into
meta:mainfrom
vjeux:preview/navigation-stack-spec-demos
Draft

vjeux wants to merge 15 commits into
meta:mainfrom
vjeux:preview/navigation-stack-spec-demos

Conversation

@vjeux

@vjeux vjeux commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Preview only — not for merge.

Primary intent

Preview only — do not merge. A prototype of the options in NavigationStack's draft record, so each behavior can be tried in a browser before the decision. No other template fits a change that will never merge.

User or maintainer impact

  • The decider and reviewers try each proposed behavior in this pull request's preview deployment, on a phone or in a browser's phone emulation.
  • Takes on a physical iPhone, for the record's iOS timing claims, load the sandbox pages below from this preview.
  • Nobody else: this never merges, and the build follows the decision.

Problem and solution fit

A phone navigator's motion, focus and hit testing are hard to judge from prose. Each demo isolates one proposed behavior:

  • Cut with keyboard: New chat pushes with transition: 'cut' and focuses the field in the same tap. A chat's Fork takes its place in one cut through pathTransition, so Back then opens the list.
  • Retained screens: retainPopped={2}. A reopened chat keeps its scroll and draft, and a retained screen stays laid out. Delete chat evicts it.
  • Prepared push: each row uses useNavigationLink. A press renders the chat ahead; a scroll drops it.
  • Content scroller: scroll="content", with the chat's own scroller and a docked composer.
  • Bar hidden root: isBarHidden on the root, which keeps its own header; the chat's bar arrives with the push.
  • Hidden screens take no input: a retained chat stays after the root in the DOM, and taps and hit tests still reach the root.

Six sandbox pages, at /sandbox/pages/<page>/ in the preview, each fill the page. Five hold the stack, and motion-start-clock holds one card. The five measuring pages put a readout at the bottom. It links the page's arms and prints a line per change, on the page clock.

  • navstack-current-proposed: one chat app, with today's stack and with the proposed options (?mode=current or ?mode=proposed), switched at the top.
  • navstack-press: a 2,200-row windowed list. A row pushes a heavy screen, with the row preparing it at the press (?prepare=on) or not (?prepare=off).
  • navstack-inert-cost: a transcript over a covered windowed list. Run times setting and removing inert, pointer-events: none and aria-hidden on each screen. ?mode=settle times one flip at a pop's settle instead. Each take slides the transcript out on a Web Animation. In the task where it finishes, the covered list's inert comes off, its pointer-events come back, or nothing changes, in turn. The readout gives each flip's time and the longest wait between frames after it. For a film, a corner square changes colour in that task. Beside it, a bar moves each frame and a strip moves on a Web Animation.
  • navstack-kept-layout: chats with long transcripts. The readout names each push fresh, retained or prepared. It gives the time from the commit that applies the push to its first moved frame, and from the lift.
  • navstack-heavy-commit: a push and a pop with 300 ms of extra work in the commit (?work=commit) or from the first frame (?work=frame). A ruler of travel marks sits over the stack.
  • motion-start-clock: a card that a tap slides in and Back slides out on the push spring, as one Web Animation per change. It starts each motion one of three ways. With ?start=next-frame, script sets the start at the first frame after the tap's task, as the stack does today. With ?start=presented, the animation is made two frames after the tap. With ?start=browser, the browser dates it. &work=300 adds 300 ms of work to the tap's task. &hold=<ms> holds the curve's first value that long before it moves. ?compare=<ms> shows two cards side by side, one with no hold and one with that hold, each with its own rows and Back.

Authority

NavigationStack's draft record, in the spec pull request #12005.

Change and evidence

Scope

Components: NavigationStack (Lab), Storybook, Sandbox

  • This PR has one primary intent.
  • Independently removable deltas were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

All runs are on one Linux box, and every number is test data.

At a423fc7197, the film ruler and the first-move watch move into navigationStackCells.tsx, and navstack-heavy-commit and motion-start-clock import both. motion-start-clock adds hold and compare:

  • Strict lint of the four changed files passes. The sandbox typecheck reports no error in this pull request's files.
  • The sandbox build with its /sandbox base passes, with all 865 routes checked. Its node tests: 75 passed.
  • In Chromium's phone profile, a script drove every page once against that build, and every readout printed. navstack-heavy-commit reads as before: a pop at 14% and a push at 8% of their travel at their first moved frame.
  • With hold=33, the first moved frame comes about 33 ms later than without, at the same 15% of the travel. In compare=33, each side prints its own line.

At 21c0f02fd9, which adds motion-start-clock and changes no other page:

  • Strict lint of the new page and its registration passes. The sandbox typecheck reports no error in this pull request's files.
  • The sandbox build with its /sandbox base passes, with all 865 routes checked. Its node tests: 75 passed.
  • In Chromium's phone profile, a script drove every page once against that build, and every readout printed. On motion-start-clock, each start printed a start time and a first moved frame for a push and a pop. So did next-frame with 300 ms of work.

At dd76ddc2a3, which adds the kept-layout readout's commit time, the Current/Proposed composer fix and the bar strip change above:

  • Strict lint of the five pages, their shared parts and NavigationStack.tsx passes, and so does the root build. The lab and sandbox typechecks report no error in this pull request's files.
  • NavigationStack's unit tests: 60 passed. Its interaction specs: 73 passed in Chromium, and 64 passed and 9 skipped in WebKit, in a container.
  • The Storybook build passes, and so does the sandbox build with its /sandbox base and all 864 routes checked.
  • In Chromium's phone profile, a script drove each page once against that build, and every readout printed, kept-layout's with the commit time.
  • On Proposed, New chat and All chats each take a tap at their center, and New chat's composer has focus after the tap.

At 439b4acf35, the head before it:

  • pnpm preflight --browser, strict: 8 of its 11 checks pass. They are the build, typecheck, the UI unit tests, knowledge, Changesets, the Storybook build, the a11y specs and 1,918 Chromium interaction specs. The UI unit tests include NavigationStack's 60.
  • Three of its checks fail, each on the prototype's own code. The build the record describes redoes each one.
    • lint, packages/core/src/internal/touch.ts:129: the usePressTracker re-export, which this prototype's links use, sits outside the press recipes the press feedback record allows. The rule came with main's merge. The build goes through one of those recipes.
    • vitest node, apps/storybook/.storybook/story-tree.test.ts: the title "Lab/NavigationStack/Spec demos" nests three levels deep, where the test allows two. The build has no Storybook demos, since the sandbox pages above carry them.
    • review:pre, packages/lab/src/NavigationStack/NavigationStack.tsx:595: the stack keeps the content scroller's DOM node in React state (architecture:react-component-runtime INV1). The build owns the node through a ref.
  • WebKit, in a container: the NavigationStack interaction specs, 64 passed and 9 skipped.
  • The sandbox's static export builds with its /sandbox base, and all 864 of its routes check out. In Chromium's phone profile, a script drove each new page once against that build, and each readout printed. Its node tests: 75 passed.

A prototype of the options NavigationStack's draft record proposes, for
a demo per behavior: a cut change, retained screens with eviction, a
screen prepared at a press, content that owns its scroller, a screen
with no bar, rich title content and a change that keeps focus.

Storybook's "Lab/NavigationStack/Spec demos" holds the demos. Unit
tests cover each option, and a browser spec in Chromium and WebKit
proves that a retained screen takes no input and that the screen on
view acts on its own state after a re-push.
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 24, 2026 10:10am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2026
@astracat-bot

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 24, 2026, 10:23 AM UTC

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This preview needs an engineering owner's decision before any of it can merge. NavigationStack has no current record on main, so retained screens with evict(), the transition: 'cut' and focus: 'keep' options, prepare()/drop() with useNavigationLink, scroll="content", isBarHidden, titleContent and the per-card layering all wait on that record; an engineering owner records the decision by commenting /approve-spec with the full head SHA on the pull request that carries NavigationStack's record, and the author may do so as an engineering owner.

Fixes needed in the preview itself:

  • Delete chat leaves the chat retained, because evict() runs before the pop takes the chat off the path, so a reopened chat still shows its deleted draft (NavigationStack.tsx:1890-1899, NavigationStackSpecDemos.stories.tsx:182-183).
  • After a scroll cancels a row's press, that press's window pointerup listener stays registered and drops the next row's prepared screen on release (useNavigationLink.ts:49-61).
  • The stack's layout Effect that copies getKey, renderScreen and retainLimit into refs should use useCommittedRef from @astryxdesign/core/internal/committed-ref instead (NavigationStack.tsx:1836-1842).
  • The cards' render order is read from cardOrderRef, which only an Effect writes, so keep that order in the view state instead (NavigationStack.tsx:2066, :2074-2076).

The per-option first-load gzip deltas that the import-boundaries rule asks for are also missing; the module grows by about 1.27 KB gzip for a stack that uses none of the options.

Claims and files checked

Review mode: full; reason: no-earlier-review

Claims:

  • Preview only, not for merge: consistent with the draft state and title.
  • Cut with keyboard pushes with a cut and focuses the field in the same tap: verified (story NewChatButton; its unit test passes).
  • Retained screens keep a reopened chat's scroll and draft: verified (unit test; a Chromium capture keeps the draft after Back).
  • Delete chat evicts the chat: false (a reproduction test and a Chromium capture keep it mounted and retained).
  • Prepared push renders a chat ahead at a press, and a scroll drops it: verified for one row; the next row's press after a cancelled press loses its screen.
  • Content scroller with the chat's own scroller and a docked composer: verified (story and unit test).
  • Bar-hidden root keeps its own header, and the chat's bar arrives with the push: verified at rest (unit test and capture); the motion was not captured.
  • Hidden screens take no tap or hit test: verified from code (hidden, no pointer events, inert); the browser spec was not run.
  • The changed files are the stack, a new hook, Lab exports and the demo stories: verified.
  • Every option sits in the stack's module, and the record's first-load rule needs separate imports: verified (about 1.27 KB gzip added).
  • 11 new unit tests, one or more per demoed option, 50 passing with the existing suites: verified (50 of 50).
  • Browser spec results in Chromium and WebKit, and the earlier commit's runs: not verified (not run here; that commit is not in this history).
  • No internal context in public text: verified.

Files:

  • apps/storybook/stories/NavigationStackSpecDemos.stories.tsx: Delete chat finding.
  • packages/lab/src/NavigationStack/NavigationStack.keep.test.tsx: clear (no test for titleContent or focus: 'keep').
  • packages/lab/src/NavigationStack/NavigationStack.tsx: eviction, ref-copy Effect and card-order findings.
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHidden.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/index.ts: clear.
  • packages/lab/src/NavigationStack/useNavigationLink.ts: leftover listener finding.
  • packages/lab/src/index.ts: clear.

Automated review (maintainer link)

Review fixes for the preview's prototype.

- evict() in the same handler as a pop holds: the view remembers the
  key until the pop lands, and retention skips it.
- useNavigationLink gives each press an AbortController, so a press a
  scroll cancels leaves no window listener behind.
- getKey, renderScreen and the retain limit go through useCommittedRef.
- The card order is part of the view state, so render reads no ref.

Three new unit tests failed before these changes.
A push or a programmatic pop from rest passed the animator an explicit
start time, read before the commit. A heavy commit then cut its first
part from the curve: in WebKit, a 300 ms block before the first frame
showed a push already 95% of its way. Such a change now passes no
start, so the animator starts it at its commit. A finger's release
keeps its own start, and a retarget continues by the animator's rule.

NavigationStackHeavyCommit's two browser tests failed in WebKit before.
- pathTransition: 'cut' lands a path change the app makes directly in
  its render. A cut that replaces the top entry retains the screen it
  leaves, as a fork needs.
- A retained screen stays laid out, hidden and inert, so it shows again
  with no style or layout work. Only covered screens deeper on the path
  skip their layout.
- The cut demo gets a Fork button.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This preview needs an engineering owner to provide its governing spec before any of it can merge: NavigationStack has no current record on main and its draft record in #12005 is not approved, so the record has to settle transition: 'cut' with the new pathTransition, focus: 'keep', retained screens with evict(), prepare()/drop() with useNavigationLink, scroll="content", isBarHidden, titleContent, useNavigationScreen, the per-card layering, and this head's change that starts every push and pop from rest at the browser's commit. An engineering owner records that decision by commenting /approve-spec with the full head SHA on the pull request that carries NavigationStack's record, and the author may do so as an engineering owner. The four fixes from the last review hold.

Fix still needed in the preview:

  • Miss: useNavigationLink tracks its press with its own window pointerup listener and pointercancel handler (useNavigationLink.ts:50-75) instead of Core's press tracker (createPressTracker/usePressTracker), which already reports press down, release inside or outside, and a scroll's cancel; expose it through @astryxdesign/core/internal/touch and drive prepare and drop from its events.

The per-option first-load gzip deltas that the import-boundaries rule asks for are still missing, while the module grows by about 1.49 KB gzip for a stack that uses none of the options.

Claims and files checked

Review mode: full; reason: over-500-lines

Claims:

  • Preview only, not for merge: consistent with the draft state and title.
  • New chat pushes with a cut and focuses its field in the same tap: verified (unit test).
  • Fork takes the chat's place in one cut through pathTransition, and Back then opens the list: verified (unit test; in Chromium, Back reads "Chats").
  • A reopened chat keeps its scroll and draft, and a retained screen stays laid out: verified (unit test; in Chromium the retained screen is hidden, inert and laid out, and the draft survives).
  • Delete chat evicts the chat: verified (two unit tests; in Chromium only the root stays mounted and the reopened draft is empty).
  • A press renders a chat ahead, and a scroll drops it: verified (unit tests).
  • Content scroller with the chat's own scroller and a docked composer: verified (unit test and story).
  • Bar-hidden root keeps its own header, and the chat's bar arrives with the push: verified on a touch screen; with a mouse the bar's surface appears at the push's start.
  • Hidden screens take no tap or hit test: verified from code and Chromium (no pointer events, hidden, inert); the browser spec was not run.
  • Review fixes (eviction in a pop's own handler, cancelled press, committed refs, card order in state): verified.
  • A push or programmatic pop from rest starts at its commit, so a heavy commit delays it and skips none: verified from code (no start time is passed, so the animator starts it at the commit); the browser spec was not run.
  • An animated same-depth change still behaves as on main: verified (it takes the unchanged fallback branch).
  • Every option sits in the stack's module, and the record's first-load rule needs separate imports: verified (about 1.49 KB gzip added).
  • 15 new unit tests, 54 passing with the existing suites: verified (54 of 54); the three failures at the earlier commit were not rerun.
  • Browser spec results in Chromium and WebKit: not verified (not run).
  • No internal context in public text: verified.

Files:

  • apps/storybook/stories/NavigationStackSpecDemos.stories.tsx: clear.
  • packages/lab/src/NavigationStack/NavigationStack.keep.test.tsx: clear (no test for titleContent or focus: 'keep').
  • packages/lab/src/NavigationStack/NavigationStack.tsx: non-blocking notes (bar surface on a mouse, focus: 'keep' on an animated pop, evict doc, comments).
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHeavyCommit.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHidden.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/index.ts: clear.
  • packages/lab/src/NavigationStack/useNavigationLink.ts: press-tracking finding.
  • packages/lab/src/index.ts: clear.

Automated review (maintainer link)

Comment on lines +2199 to +2202
{rendered.find(model => model.key === topKey)?.element.props
.isBarHidden === true ? null : (
<div aria-hidden {...stylex.props(styles.barBackground)} />
)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking: topKey is the pushed screen from the push's first frame, so on a fine pointer the bar's surface and rule appear at once over a bar-hidden root's own header. In Chromium at 1280 wide with a mouse, 30 ms after the click the white 44 px bar is drawn while the chat card is still at x = 976. A coarse pointer's transparent background hides it. Show the background with the pushed bar's own motion, or only once the push lands.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed: with a mouse, the pushed bar's surface paints at once over the root's own header. The demos are for a phone, where the clear bar hides it. The build draws the surface with the pushed bar's own motion, as the record's FR11 requires.

if (under != null) {
settle(under, 'top');
pendingFocusRef.current = {popped: top, revealed: under};
if (transition.keepFocus !== true || !focusIsIn(under)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking: during an animated pop every card is inert (isCovered while view.leaving is set), and this check runs before the commit that clears leaving. Nothing in under can hold focus here, so focus: 'keep' never keeps focus on an animated pop; focus always moves to the opener.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, and here that follows the record. focus: 'keep' keeps focus only if it is already in the new top screen. This prototype keeps the revealed screen inert until the pop settles, so nothing in it can hold focus yet. Under FR17 it takes input once the pop looks done, and the build checks keep after that.

useNavigationLink drives prepare and drop from Core's press tracker, as
a control tracks its press: touchDown prepares, and touchUpOutside or
touchCancel drops. Its own window listener is gone. Core's internal
touch entry re-exports usePressTracker for it.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This preview still needs an engineering owner's decision on NavigationStack's record before any of it can merge. main has no current NavigationStack record and the draft record in #12005 is not approved, so the record has to settle transition: 'cut' with pathTransition, focus: 'keep', retained screens with evict(), prepare()/drop() with useNavigationLink, scroll="content", isBarHidden, titleContent, useNavigationScreen, the per-card layering, and the change that starts every push and pop from rest at the browser's commit. An engineering owner records that decision by commenting /approve-spec with the full head SHA on the pull request that carries the record, and the author may do so as an engineering owner.

The press-tracking fix holds: the links now prepare and drop from Core's shared press tracker, and a held finger or mouse button, a scroll and a release off the row all behave as described in Chromium.

Fix needed in the preview:

  • packages/core/src/internal/touch.ts now ships a change in @astryxdesign/core with no Changeset naming that package, which the release process requires for published package source and the repository's coverage check rejects; add one that states the internal touch entry re-exports usePressTracker for Lab.

Also needed before approval:

  • Report each option's first-load gzip delta for a page that renders NavigationStack without it, since each option may add at most 0.3 KB and the options together add about 1.4 KB gzip to such a page today.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none

Claims:

  • Preview only, not for merge: consistent with the draft state and title.
  • New chat pushes with a cut and focuses its field in the same tap: verified (unit test).
  • Fork replaces the chat in one cut through pathTransition, and Back then opens the list: verified (unit test).
  • A reopened chat keeps its scroll and draft, and a retained screen stays laid out: verified (unit test; the retained card uses visibility, not content-visibility).
  • Delete chat evicts the chat: verified (two unit tests).
  • Each row uses useNavigationLink; a press renders the chat ahead and a scroll drops it: verified (unit tests; Chromium with a finger and with a mouse).
  • Content scroller with its own scroller and a docked composer: verified (unit test and story).
  • Bar-hidden root keeps its own header, and the chat's bar arrives with the push: verified on a touch screen; with a mouse the bar's surface shows from the push's start.
  • Hidden screens take no tap or hit test: verified from code (no pointer events, hidden, inert); the browser spec was not run.
  • Review fixes (an eviction in a pop's own handler, the cancelled press, committed refs, card order in state): verified.
  • Links track their press with Core's press tracker, which Core's internal touch entry re-exports: verified (code, unit tests, Chromium).
  • A push or programmatic pop from rest starts at its commit, so a heavy commit delays it and skips none: verified from code; the browser spec was not run.
  • pathTransition's cut and laid-out retained screens implement the draft record's requirements: not checked against the draft, which is not approved.
  • An animated same-depth change still behaves as on main: verified (unchanged fallback branch).
  • Every option sits in the stack's module, and the record's first-load rule needs separate imports: verified (about 1.4 KB gzip added).
  • 54 unit tests pass with the existing suites: verified (54 of 54); the three failures at an earlier commit were not rerun.
  • The runs were made at a commit that differs from the head in two test comments only: not verifiable (that commit is not in the pull request's history).
  • Core's touch entry test and the bundle guard pass with the re-export: verified (12 and 16 tests).
  • Browser spec results in Chromium and WebKit: not verified (not run).
  • No internal context in public text: verified.
  • Release notes: the pull request adds no Changeset; Core's source change needs one (coverage check fails).

Files:

  • apps/storybook/stories/NavigationStackSpecDemos.stories.tsx: clear.
  • packages/core/src/internal/touch.test.ts: clear.
  • packages/core/src/internal/touch.ts: missing Changeset for Core.
  • packages/lab/src/NavigationStack/NavigationStack.keep.test.tsx: clear (the press tests drive a finger only; no test for focus: 'keep' or titleContent).
  • packages/lab/src/NavigationStack/NavigationStack.tsx: non-blocking notes (bar surface with a mouse, focus: 'keep' on an animated pop, evict doc, array identity, keyOf index, comments).
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHeavyCommit.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHidden.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/index.ts: clear.
  • packages/lab/src/NavigationStack/useNavigationLink.ts: clear (the press-tracking finding is fixed).
  • packages/lab/src/index.ts: clear.
  • scripts/touch-support-bundle.test.mjs: clear.

Automated review (maintainer link)

Comment thread packages/core/src/internal/touch.ts Resolved

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This preview still needs an engineering owner's decision on NavigationStack's record before any of it can merge. main has no current NavigationStack record and the draft record in #12005 is not approved, so the record has to settle transition: 'cut' with pathTransition, focus: 'keep', retained screens with evict(), prepare()/drop() with useNavigationLink, scroll="content", isBarHidden, titleContent, useNavigationScreen, the per-card layering, and the change that starts every push and pop from rest at the browser's commit. An engineering owner records that decision by commenting /approve-spec with the full head SHA on the pull request that carries the record, and the author may do so as an engineering owner.

The Changeset fix holds: it names @astryxdesign/core for the internal touch entry's new re-export, and the release coverage check now passes.

Also needed before approval:

  • Report each option's first-load gzip delta for a page that renders NavigationStack without it, since each option may add at most 0.3 KB and the options together add about 1.4 KB gzip to such a page today.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none

Claims:

  • Preview only, not for merge: consistent with the draft state and title.
  • New chat pushes with a cut and focuses its field in the same tap: verified (unit test; Chromium, the field holds focus in the tap's commit).
  • Fork replaces the chat in one cut through pathTransition, and Back then opens the list: verified (unit test).
  • A reopened chat keeps its scroll and draft, and a retained screen stays laid out: verified (unit test; Chromium, the draft survives Back and a reopen, and the hidden card keeps its layout).
  • Delete chat evicts the chat: verified (two unit tests; Chromium, a reopened chat starts empty).
  • Each row uses useNavigationLink; a press renders the chat ahead and a scroll drops it: verified (unit tests).
  • Content scroller with its own scroller and a docked composer: verified (unit test and story).
  • Bar-hidden root keeps its own header, and the chat's bar arrives with the push: verified on a touch screen; with a mouse the bar's surface shows from the push's start.
  • Hidden screens take no tap or hit test: verified from code (no pointer events, hidden, inert); the browser spec was not run.
  • Review fixes (an eviction in a pop's own handler, the cancelled press, committed refs, card order in state): verified.
  • Links track their press with Core's press tracker, which Core's internal touch entry re-exports, with a Changeset naming Core: verified (code, unit tests, the release coverage check passes).
  • A push or programmatic pop from rest starts at its commit, so a heavy commit delays it and skips none: verified from code; the browser spec was not run.
  • pathTransition's cut and laid-out retained screens implement the draft record's requirements: not checked against the draft, which is not approved.
  • An animated same-depth change still behaves as on main: verified (unchanged fallback branch).
  • Every option sits in the stack's module, and the record's first-load rule needs separate imports: verified (about 1.4 KB gzip added).
  • 54 unit tests pass with the existing suites: verified (54 of 54); the three failures at an earlier commit were not rerun.
  • The runs were made at a commit that differs from the head in two test comments and a Changeset only: not verifiable (that commit is not in the pull request's history).
  • Core's touch entry test and the bundle guard pass with the re-export: verified (12 and 16 tests).
  • Browser spec results in Chromium and WebKit: not verified (not run).
  • No internal context in public text: verified.
  • Changeset: names @astryxdesign/core as a patch; the internal entry re-exports usePressTracker for Lab as it does useActionGroupTracking for TabBar, and the package entry point does not export it: verified (code, bundle guard, Changeset checks).

Files:

  • .changeset/internal-touch-press-tracker.md: clear.
  • apps/storybook/stories/NavigationStackSpecDemos.stories.tsx: clear.
  • packages/core/src/internal/touch.test.ts: clear.
  • packages/core/src/internal/touch.ts: clear (the Changeset now covers it).
  • packages/lab/src/NavigationStack/NavigationStack.keep.test.tsx: clear (the press tests drive a finger only; no test for focus: 'keep' or titleContent).
  • packages/lab/src/NavigationStack/NavigationStack.tsx: non-blocking notes (bar surface with a mouse, focus: 'keep' on an animated pop, evict doc, array identity, keyOf index, comments).
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHeavyCommit.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHidden.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/index.ts: clear.
  • packages/lab/src/NavigationStack/useNavigationLink.ts: clear.
  • packages/lab/src/index.ts: clear.
  • scripts/touch-support-bundle.test.mjs: clear.

Automated review (maintainer link)

Five raw sandbox pages, for a physical phone and for trying the draft
record's options:

- navstack-current-proposed: one chat app with today's stack and with
  the proposed options, switched at the top.
- navstack-press: a long windowed list whose row pushes a heavy screen,
  with and without the row preparing it at the press.
- navstack-inert-cost: times inert, pointer-events: none and
  aria-hidden on a covered long list and on a transcript.
- navstack-kept-layout: a fresh push, a retained screen's re-push and a
  prepared push.
- navstack-heavy-commit: a push and a pop with extra work in the commit
  or from the first frame, under a ruler of travel marks.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This preview still needs an engineering owner's decision on NavigationStack's record before any of it can merge, and five defects need fixing once that decision is made.

main has no current NavigationStack record and the draft record in #12005 is not approved, so the record has to settle transition: 'cut' with pathTransition, focus: 'keep', retained screens with evict(), prepare()/drop() with useNavigationLink, scroll="content", isBarHidden, titleContent, useNavigationScreen and the per-card layering. An engineering owner records that decision by commenting /approve-spec with the full head SHA on the pull request that carries the record, and the author may do so as an engineering owner.

Blocking:

  • Miss: a root with isBarHidden cannot take taps in its top 44 px, because the stack's empty bar container (NavigationStack.tsx:2363, z-index: 1) still takes hit tests, so the sandbox page's New chat and All chats buttons never receive a tap.
  • Regression: internal/touch.ts:129 re-exports usePressTracker for useNavigationLink, which the press feedback record and the component runtime record on main now rule out (the press tracker keeps only its listed direct users), so drive prepare/drop from the press feedback engine or have that record name the link, then drop the re-export.
  • Miss: NavigationStack.tsx:595 keeps the content scroller's element in React state, which the component runtime record's INV1 forbids, so own the node through a ref and keep only whether it is attached in state.
  • navstack-current-proposed/page.tsx:177 queries [data-navigation-screen="New chat"] input, but the card is named screen-New chat, so New chat never focuses its composer and no keyboard rises.
  • Miss: the story title Lab/NavigationStack/Spec demos nests three levels, which the story tree test rejects in the Storybook build, so use a two-level title and update the browser specs' story ids.

Also needed before approval:

  • Report each option's first-load gzip delta for a page that renders NavigationStack without it, since each option may add at most 0.3 KB and the options together add about 1.5 KB gzip to such a page today.
Claims and files checked

Review mode: full; reason: over-500-lines

Claims:

  • Preview only, not for merge: consistent with the draft state and title.
  • New chat in the Cut With Keyboard story pushes with a cut and focuses the field in the same tap: verified (browser: the Message field holds focus after the tap).
  • Fork replaces the chat in one cut through pathTransition, and Back then opens the list: verified (unit test).
  • A reopened chat keeps its draft and scroll, a retained screen stays laid out, and Delete chat evicts it: verified (unit tests).
  • A row's press prepares its chat and a scroll drops it: verified (unit tests).
  • The content scroller story has its own scroller and a docked composer: verified (unit test and story).
  • A bar-hidden root keeps its own header, and the chat's bar arrives with the push: false in part (the header renders, but its top 44 px takes no taps).
  • Hidden screens take no taps or hit tests: verified from code and unit tests; the browser spec was not run.
  • Five sandbox pages fill the page with the stack, and the four measuring pages print a readout that links their arms: verified (browser captures of all five).
  • The Current and Proposed page switches one chat app between today's stack and the proposed options: false in part (the Proposed New chat cannot be tapped and would not focus its composer).
  • The press, kept-layout, heavy-commit and inert-cost pages behave as described: verified (code; browser readouts on the kept-layout and inert-cost pages).
  • The pages join the sandbox page list, the export route list and the pages that read the query before hydrating: verified (code; the route manifest test passes).
  • Main is merged in, and its own start of a change from rest replaces the prototype's: verified (merge history; the prototype's start-time change is gone from the diff).
  • Review fixes (eviction in a pop's handler, the cancelled press, committed refs, card order in state, links on Core's press tracker with a Changeset): verified (code and unit tests).
  • pathTransition's cut and laid-out retained screens implement the draft record's requirements: not checked against the draft, which is not approved.
  • An animated same-depth change still behaves as on main: verified (unchanged fallback branch).
  • Every option sits in the stack's module, so a stack that uses none still loads them: verified (about 1.5 KB gzip added).
  • Three preflight checks fail on the prototype's code (lint at the re-export, the story tree test, the pre-review check on the scroller state): verified (each is a blocking finding above).
  • The other preflight checks, the WebKit specs, the static export and its route count: not verified (not run).
  • NavigationStack's unit tests pass: verified (73 tests across the stack's suites and Core's touch entry test).
  • No internal context in public text: verified.
  • Changeset: names @astryxdesign/core as a patch; the internal touch entry re-exports usePressTracker for Lab as it does useActionGroupTracking for TabBar, and the package entry point does not export it: verified (code, bundle guard, Changeset check).

Files:

  • .changeset/internal-touch-press-tracker.md: clear while the re-export stays; goes with it.
  • apps/sandbox/scripts/next-export-routes.json: clear.
  • apps/sandbox/src/app/(raw)/navigationStackCells.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-current-proposed/page.tsx: New chat selector finding; also meets the bar strip finding.
  • apps/sandbox/src/app/(raw)/pages/navstack-heavy-commit/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-inert-cost/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-kept-layout/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-press/page.tsx: clear.
  • apps/sandbox/src/app/sandboxPages.ts: clear.
  • apps/sandbox/src/hydration-policy.ts: clear.
  • apps/storybook/stories/NavigationStackSpecDemos.stories.tsx: story title finding.
  • packages/core/src/internal/touch.test.ts: clear while the re-export stays.
  • packages/core/src/internal/touch.ts: press tracker re-export finding.
  • packages/lab/src/NavigationStack/NavigationStack.keep.test.tsx: clear.
  • packages/lab/src/NavigationStack/NavigationStack.tsx: bar strip and scroller state findings; non-blocking notes on the bar surface with a mouse, focus: 'keep' on an animated pop, the evict doc, array identity, keyOf's index and two comments.
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHeavyCommit.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHidden.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/index.ts: clear.
  • packages/lab/src/NavigationStack/useNavigationLink.ts: depends on the press tracker re-export.
  • packages/lab/src/index.ts: clear.
  • scripts/touch-support-bundle.test.mjs: clear.

Automated review (maintainer link)

export type {ActionGroupTrackingOptions} from '../hooks/useActionGroupTracking';

// Lab's NavigationStack links track their press with the shared press tracker.
export {usePressTracker} from '../gestures/usePressTracker';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Regression: since the merge of main, architecture:react-component-runtime INV13 says press feedback timing is reached "through architecture:press-feedback's engine and profiles, not directly", and architecture:press-feedback's INV1 gap keeps the press tracker to "its current direct users (Switch, Slider, the SegmentedControl lens, Lightbox)". ESLint's @astryx/press-through-recipes flags this line. Drive useNavigationLink's prepare/drop from the press feedback engine, or have the record's owner add the link to the tracker's direct users; then drop this line, its test and its Changeset.

);
const isLarge = props.titleDisplayMode === 'large' && !isContentScroll;
// The content's own scroller, once it attaches (scroll: 'content').
const [contentScroller, setContentScroller] = useState<HTMLElement | null>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Miss: this keeps the content scroller's element in React state, which architecture:react-component-runtime INV1 forbids: "DOM nodes and whole DOM collections MUST NOT be stored in React state; store only the minimal rendering key or own the node through a ref." Keep the node in a ref and only whether it is attached in state, so the edge effect still turns on when the scroller attaches.

import {rtlStyles} from '@astryxdesign/core/utils';

const meta: Meta<typeof NavigationStack> = {
title: 'Lab/NavigationStack/Spec demos',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Miss: this title nests three levels, and apps/storybook/.storybook/story-tree.test.ts ("never nests a component deeper than /") rejects any third segment under a component, so CI's Storybook build fails on it, as the description reports. Use a two-level title and update the story ids the two browser specs open.

The kept-layout page's readout adds the time from the commit that
applies a push to the push's first moved frame, beside the lift's. The
Current/Proposed page's New chat finds its composer by the card's name.
The bar's empty strip took hit tests, so a top screen with isBarHidden
lost the taps in its top 44 px. The strip now passes them through, and
the bar's background, its layers and the back button take them.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This preview still needs an engineering owner's decision on NavigationStack's record before any of it can merge, and four defects need fixing once that decision is made. The bar-hidden root's header now takes taps, and the sandbox page's New chat opens with its composer focused.

main has no current NavigationStack record and the draft record in #12005 is not approved, so the record has to settle transition: 'cut' with pathTransition, focus: 'keep', retained screens with evict(), prepare()/drop() with useNavigationLink, scroll="content", isBarHidden, titleContent, useNavigationScreen and the per-card layering. An engineering owner records that decision by commenting /approve-spec with the full head SHA on the pull request, and the author may do so as an engineering owner.

Blocking:

  • Regression: internal/touch.ts:129 re-exports usePressTracker for useNavigationLink, which the press feedback record and the component runtime record on main rule out (the press tracker keeps only its listed direct users), so drive prepare/drop from the press feedback engine or have that record name the link, then drop the re-export.
  • Miss: NavigationStack.tsx:602 keeps the content scroller's element in React state, which the component runtime record's INV1 forbids, so own the node through a ref and keep only whether it is attached in state.
  • Miss: the story title Lab/NavigationStack/Spec demos nests three levels, which the story tree test rejects in the Storybook build, so use a two-level title and update the browser specs' story ids.
  • Miss: a pushed screen with isBarHidden still gets the stack's back control (NavigationStack.tsx:2390-2398), which paints over its own header's first control and takes its taps, so render the back control only while the top screen shows its bar.

Also needed before approval:

  • Report each option's first-load gzip delta for a page that renders NavigationStack without it, since each option may add at most 0.3 KB and the options together add about 1.5 KB gzip to such a page today.
Claims and files checked

Review mode: incremental; reason: none

Claims:

  • Preview only, not for merge: consistent with the draft state and title.
  • New chat in the Cut With Keyboard story pushes with a cut and focuses the field in the same tap: verified in the browser earlier; that code is unchanged.
  • Fork replaces the chat in one cut through pathTransition, and Back then opens the list: verified (unit test).
  • A reopened chat keeps its draft and scroll, a retained screen stays laid out, and Delete chat evicts it: verified (unit tests).
  • A row's press prepares its chat and a scroll drops it: verified (unit tests).
  • The content scroller story has its own scroller and a docked composer: verified (unit test and story).
  • A bar-hidden root keeps its own header, and the chat's bar arrives with the push: verified (browser: the header's buttons take their hit tests, the pushed chat shows its bar and Back pops).
  • Hidden screens take no taps or hit tests: verified from code and unit tests; the browser spec was not run.
  • Five sandbox pages fill the page with the stack, and the four measuring pages print a readout that links their arms: verified in the browser earlier; since then only the kept-layout readout gained a commit-to-first-frame figure.
  • The Current and Proposed page switches one chat app between today's stack and the proposed options: verified (browser: the Proposed New chat opens with its composer focused).
  • The pages join the sandbox page list, the export route list and the pages that read the query before hydrating: verified (code).
  • Main is merged in, and its own start of a change from rest replaces the prototype's: verified (merge history).
  • Review fixes (eviction in a pop's handler, the cancelled press, committed refs, card order in state, links on Core's press tracker with a Changeset): verified (code and unit tests).
  • pathTransition's cut and laid-out retained screens implement the draft record's requirements: not checked against the draft, which is not approved.
  • An animated same-depth change still behaves as on main: verified (unchanged fallback branch).
  • Every option sits in the stack's module, so a stack that uses none still loads them: verified (about 1.5 KB gzip added).
  • Three preflight checks fail on the prototype's code (lint at the re-export, the story tree test, the pre-review check on the scroller state): verified (each is a blocking finding above).
  • The other preflight checks, the WebKit specs, the static export and its route count: not verified (not run).
  • NavigationStack's unit tests pass: verified (73 tests across the stack's suites and Core's touch entry test, at this head).
  • No internal context in public text: verified.
  • Changeset: names @astryxdesign/core as a patch for the internal touch entry's re-export, which the package entry point does not export: verified (code and the bundle guard's Lab-only list).

Files:

  • .changeset/internal-touch-press-tracker.md: clear while the re-export stays; goes with it.
  • apps/sandbox/scripts/next-export-routes.json: clear.
  • apps/sandbox/src/app/(raw)/navigationStackCells.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-current-proposed/page.tsx: clear (the New chat selector is fixed).
  • apps/sandbox/src/app/(raw)/pages/navstack-heavy-commit/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-inert-cost/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-kept-layout/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-press/page.tsx: clear.
  • apps/sandbox/src/app/sandboxPages.ts: clear.
  • apps/sandbox/src/hydration-policy.ts: clear.
  • apps/storybook/stories/NavigationStackSpecDemos.stories.tsx: story title finding.
  • packages/core/src/internal/touch.test.ts: clear while the re-export stays.
  • packages/core/src/internal/touch.ts: press tracker re-export finding.
  • packages/lab/src/NavigationStack/NavigationStack.keep.test.tsx: clear.
  • packages/lab/src/NavigationStack/NavigationStack.tsx: scroller state and back control findings; non-blocking notes on the bar surface with a mouse, focus: 'keep' on an animated pop, the evict doc, array identity, keyOf's index and two comments.
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHeavyCommit.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHidden.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/index.ts: clear.
  • packages/lab/src/NavigationStack/useNavigationLink.ts: depends on the press tracker re-export.
  • packages/lab/src/index.ts: clear.
  • scripts/touch-support-bundle.test.mjs: clear.

Automated review (maintainer link)

<div {...stylex.props(styles.bar)}>
<div aria-hidden {...stylex.props(styles.barBackground)} />
{rendered.find(model => model.key === topKey)?.element.props
.isBarHidden === true ? null : (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Miss: a top screen with isBarHidden skips the bar's background and its own bar layer here, but the BackControl below (:2390-2398) still renders whenever the top screen has a back label. With a bar-hidden screen pushed on a root, the 44 px back circle paints over the screen's own header and takes the taps on its first control. Render the back control only while the top screen shows its bar, as navigationBarHidden, which the prop's doc names, hides the back button with the bar.

motion-start-clock slides a card in and out on the push spring as one
Web Animation per change, started three ways: from script at the first
frame after the tap's task, two frames after the tap, or by the
browser. Each runs with or without 300 ms of work in the tap's task.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This preview still needs an engineering owner's decision on NavigationStack's record before any of it can merge, and seven defects need fixing once that decision is made. The new motion-start-clock page works as described: every arm prints a start and a first moved frame for a push and a pop.

main has no current NavigationStack record and the draft record in #12005 is not approved, so the record has to settle transition: 'cut' with pathTransition, focus: 'keep', retained screens with evict(), prepare()/drop() with useNavigationLink, scroll="content", isBarHidden, titleContent, useNavigationScreen and the per-card layering. An engineering owner records that decision by commenting /approve-spec with the full head SHA on the pull request, and the author may do so as an engineering owner.

Blocking:

  • Regression: internal/touch.ts:129 re-exports usePressTracker for useNavigationLink, which the press feedback record and the component runtime record on main rule out (the press tracker keeps only its listed direct users), so drive prepare/drop from the press feedback engine or have that record name the link, then drop the re-export.
  • Miss: NavigationStack.tsx:602 keeps the content scroller's element in React state, which the component runtime record's INV1 forbids, so own the node through a ref and keep only whether it is attached in state.
  • Miss: the story title Lab/NavigationStack/Spec demos nests three levels, which the story tree test rejects in the Storybook build, so use a two-level title and update the browser specs' story ids.
  • Miss: a pushed screen with isBarHidden still gets the stack's back control (NavigationStack.tsx:2390-2398), which paints over its own header's first control and takes its taps, so render the back control only while the top screen shows its bar.
  • motion-start-clock/page.tsx copies the ruler from navstack-heavy-commit (:34, :61-76, :105-113) and re-implements shownX and watchFirstMove (:134-165) that navigationStackCells.tsx already exports for these pages, so move the ruler into the shared cells, let the watch take an element, and import both in each page.
  • motion-start-clock/page.tsx:182-187 sets the card's starting translate in a mount Effect, which the card's ref callback can do when it attaches, so move it there and drop the Effect.
  • The description says four measuring pages put a readout at the bottom, but motion-start-clock does too, so say five.

Also needed before approval:

  • Report each option's first-load gzip delta for a page that renders NavigationStack without it, since each option may add at most 0.3 KB and the options together add about 1.5 KB gzip to such a page today.
Claims and files checked

Review mode: incremental; reason: none

Claims:

  • Preview only, not for merge: consistent with the draft state and title.
  • New chat in the cut demo pushes with a cut and focuses the field in the same tap, and Fork replaces the chat in one cut so Back opens the list: verified earlier (browser and unit test); that code is unchanged.
  • A reopened chat keeps its draft and scroll, a retained screen stays laid out, and Delete chat evicts it: verified (unit tests); unchanged.
  • A row's press prepares its chat and a scroll drops it: verified (unit tests); unchanged.
  • The content scroller demo has its own scroller and a docked composer: verified (unit test and story).
  • A bar-hidden root keeps its own header and the chat's bar arrives with the push: verified earlier (browser); unchanged.
  • Hidden screens take no taps or hit tests: verified from code and unit tests; the browser spec was not run.
  • Six sandbox pages fill the page, five hold the stack and the start-clock page holds one card: verified (code; browser for the start-clock page).
  • The four measuring pages put a readout at the bottom: false, five pages do (blocking finding above).
  • Each readout links its page's arms and prints a line per change: verified for the start-clock page (browser) and earlier for the others.
  • The start-clock page's three starts and its 300 ms of work in the tap's task: verified (code, and a browser run of five arms).
  • The pages join the sandbox page list, the export route list and the pages that read the query before hydrating: verified (code and the sandbox's route manifest test).
  • The bar strip no longer takes hit tests, while the bar's background, layers and back button do: verified earlier (browser); unchanged.
  • Main is merged in, and its own start of a change from rest replaces the prototype's: verified (merge history; the stack's tap starts in the first frame after the tap's task).
  • Review fixes (eviction in a pop's handler, the cancelled press, committed refs, card order in state, links on Core's press tracker with a Changeset): verified (code and unit tests).
  • The cut through pathTransition and laid-out retained screens implement the draft record's requirements: not checked against the draft, which is not approved.
  • An animated same-depth change still behaves as on main: verified (unchanged fallback branch).
  • Every option sits in the stack's module, so a stack that uses none still loads them: verified (about 1.5 KB gzip added).
  • At this head, strict lint of the new page and its registration passes: verified (no warnings).
  • At this head, the sandbox typecheck reports no error in this pull request's files: verified for the new page; the other sandbox pages were not checked.
  • At this head, the sandbox build with its base passes with 865 routes checked: the route list holds 865 routes; the build was not run.
  • At this head, the sandbox's node tests pass (75): verified (75 passed).
  • At this head, a script drove every page in Chromium's phone profile and every readout printed, including the start-clock page's push and pop for each start and with 300 ms of work: verified for the start-clock page (five arms); the other pages were not rerun.
  • Earlier heads' results (unit and interaction specs, WebKit, the Storybook build, the static export, the preflight run): the unit tests were verified earlier; the rest were not run.
  • Three preflight checks fail on the prototype's code (lint at the re-export, the story tree test, the pre-review check on the scroller state): verified (each is a blocking finding above).
  • No internal context in public text: verified.
  • Changeset: names Core as a patch for the internal touch entry's re-export, which the package entry point does not export: verified (code and the bundle guard's Lab-only list).

Files:

  • .changeset/internal-touch-press-tracker.md: clear while the re-export stays; goes with it.
  • apps/sandbox/scripts/next-export-routes.json: clear.
  • apps/sandbox/src/app/(raw)/navigationStackCells.tsx: clear; the shared owner the start-clock page should use.
  • apps/sandbox/src/app/(raw)/pages/motion-start-clock/page.tsx: copied ruler and first-move watch, mount Effect.
  • apps/sandbox/src/app/(raw)/pages/navstack-current-proposed/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-heavy-commit/page.tsx: clear; the ruler's other copy.
  • apps/sandbox/src/app/(raw)/pages/navstack-inert-cost/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-kept-layout/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-press/page.tsx: clear.
  • apps/sandbox/src/app/sandboxPages.ts: clear.
  • apps/sandbox/src/hydration-policy.ts: clear; non-blocking note on its header comment.
  • apps/storybook/stories/NavigationStackSpecDemos.stories.tsx: story title finding.
  • packages/core/src/internal/touch.test.ts: clear while the re-export stays.
  • packages/core/src/internal/touch.ts: press tracker re-export finding.
  • packages/lab/src/NavigationStack/NavigationStack.keep.test.tsx: clear.
  • packages/lab/src/NavigationStack/NavigationStack.tsx: scroller state and back control findings; non-blocking notes.
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHeavyCommit.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHidden.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/index.ts: clear.
  • packages/lab/src/NavigationStack/useNavigationLink.ts: depends on the press tracker re-export.
  • packages/lab/src/index.ts: clear.
  • scripts/touch-support-bundle.test.mjs: clear.

Automated review (maintainer link)

Comment thread apps/sandbox/src/hydration-policy.ts Resolved
The cells module exports the film ruler, and its first-move watch takes
an element as well as a stack card's key. The heavy-commit and
motion-start-clock pages import both, and motion-start-clock sets its
card's start as the card attaches.
motion-start-clock takes ?hold=<ms>: the curve holds its first value
that long before it moves. It covers the frames a compositor runs
before the screen first shows a new animation.
motion-start-clock takes ?compare=<ms>: two cards side by side, one
with no hold and one holding its first value that long, each with its
own rows and Back, so a person can try both. The card is one component,
and its tap handler now reads the hold it was given.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This preview still needs an engineering owner's decision on NavigationStack's record before any of it can merge, and four defects need fixing once that decision is made. The new hold and compare arms on motion-start-clock work as described, and this push fixes the copied ruler and first-move watch, the mount Effect and the measuring-page count.

main has no current NavigationStack record and the draft record in #12005 is not approved, so the record has to settle transition: 'cut' with pathTransition, focus: 'keep', retained screens with evict(), prepare()/drop() with useNavigationLink, scroll="content", isBarHidden, titleContent, useNavigationScreen and the per-card layering. An engineering owner records that decision by commenting /approve-spec with the full head SHA on the pull request, and the author may do so as an engineering owner.

Blocking:

  • Regression: internal/touch.ts:129 re-exports usePressTracker for useNavigationLink, which the press feedback record and the component runtime record on main rule out (the press tracker keeps only its listed direct users), so drive prepare/drop from the press feedback engine or have that record name the link, then drop the re-export.
  • Miss: NavigationStack.tsx:602 keeps the content scroller's element in React state, which the component runtime record's INV1 forbids, so own the node through a ref and keep only whether it is attached in state.
  • Miss: the story title Lab/NavigationStack/Spec demos nests three levels, which the story tree test rejects in the Storybook build, so use a two-level title and update the browser specs' story ids.
  • Miss: a pushed screen with isBarHidden still gets the stack's back control (NavigationStack.tsx:2391-2398), which paints over its own header's first control and takes its taps, so render the back control only while the top screen shows its bar.

Also needed before approval:

  • Report each option's first-load gzip delta for a page that renders NavigationStack without it, since each option may add at most 0.3 KB and the options together add about 1.5 KB gzip to such a page today.
Claims and files checked

Review mode: incremental; reason: none

Changed rules since the last review: changed rules (0): none.

Claims:

  • Preview only, not for merge: consistent with the draft state and title.
  • New chat in the cut demo pushes with a cut and focuses the field in the same tap, and Fork replaces the chat in one cut so Back opens the list: verified earlier (browser and unit test); that code is unchanged.
  • A reopened chat keeps its draft and scroll, a retained screen stays laid out, and Delete chat evicts it: verified (unit tests); unchanged.
  • A row's press prepares its chat and a scroll drops it: verified (unit tests); unchanged.
  • The content scroller demo has its own scroller and a docked composer: verified (unit test and story).
  • A bar-hidden root keeps its own header and the chat's bar arrives with the push: verified earlier (browser); unchanged.
  • Hidden screens take no taps or hit tests: verified from code and unit tests; the browser spec was not run.
  • Six sandbox pages fill the page, five hold the stack and the start-clock page holds one card: verified (code).
  • Five measuring pages put a readout at the bottom: verified (press, inert cost, kept layout, heavy commit, start clock).
  • Each readout links its page's arms and prints a line per change: verified for the start-clock and heavy-commit pages (browser) and earlier for the others.
  • The start-clock page's three starts, its work in the tap's task, its hold and its side-by-side compare: verified (code, and a browser run of the next-frame, hold and compare arms).
  • The pages join the sandbox page list, the export route list and the pages that read the query before hydrating: verified (code and the sandbox's route manifest test).
  • The bar strip no longer takes hit tests, while the bar's background, layers and back button do: verified earlier (browser); unchanged.
  • Main is merged in, and its own start of a change from rest replaces the prototype's: verified (merge history).
  • Review fixes (eviction in a pop's handler, the cancelled press, committed refs, card order in state, links on Core's press tracker with a Changeset): verified (code and unit tests).
  • The cut through pathTransition and laid-out retained screens implement the draft record's requirements: not checked against the draft, which is not approved.
  • An animated same-depth change still behaves as on main: verified (unchanged fallback branch).
  • Every option sits in the stack's module, so a stack that uses none still loads them: verified (about 1.5 KB gzip added).
  • At this head, the ruler and the first-move watch move into the shared cells, and the heavy-commit and start-clock pages import both: verified (code).
  • At this head, strict lint of the four changed files passes: verified (no warnings).
  • At this head, the sandbox typecheck reports no error in this pull request's files: verified, with Lab built.
  • At this head, the sandbox build with its base passes with 865 routes checked: the route list holds 865 routes; the build was not run.
  • At this head, the sandbox's node tests pass (75): verified (75 passed).
  • At this head, a script drove every page in a phone profile and every readout printed, with heavy commit reading a pop at 14% and a push at 8%: the start-clock arms and heavy commit printed their lines; heavy commit read a push at 14% and a pop at 11% in this run, as headless frame timing varies; the other pages were not rerun.
  • A 33 ms hold moves the first moved frame about 33 ms later at the same 15% of the travel, and the 33 ms compare prints a line per side: verified (about 28 ms to about 62 ms, 15% each; one line per side).
  • Earlier heads' results (unit and interaction specs, WebKit, the Storybook build, the static export, the preflight run): the unit tests were verified earlier; the rest were not run.
  • Three preflight checks fail on the prototype's code (lint at the re-export, the story tree test, the pre-review check on the scroller state): verified (each is a blocking finding above).
  • No internal context in public text: verified.
  • Changeset: names Core as a patch for the internal touch entry's re-export, which the package entry point does not export: verified (code and the bundle guard's Lab-only list).

Files:

  • .changeset/internal-touch-press-tracker.md: clear while the re-export stays; goes with it.
  • apps/sandbox/scripts/next-export-routes.json: clear.
  • apps/sandbox/src/app/(raw)/navigationStackCells.tsx: clear; non-blocking note on two stale doc comments.
  • apps/sandbox/src/app/(raw)/pages/motion-start-clock/page.tsx: clear; the copies and the mount Effect are gone.
  • apps/sandbox/src/app/(raw)/pages/navstack-current-proposed/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-heavy-commit/page.tsx: clear; uses the shared ruler.
  • apps/sandbox/src/app/(raw)/pages/navstack-inert-cost/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-kept-layout/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-press/page.tsx: clear.
  • apps/sandbox/src/app/sandboxPages.ts: clear.
  • apps/sandbox/src/hydration-policy.ts: clear; its header now names the start-clock page.
  • apps/storybook/stories/NavigationStackSpecDemos.stories.tsx: story title finding.
  • packages/core/src/internal/touch.test.ts: clear while the re-export stays.
  • packages/core/src/internal/touch.ts: press tracker re-export finding.
  • packages/lab/src/NavigationStack/NavigationStack.keep.test.tsx: clear.
  • packages/lab/src/NavigationStack/NavigationStack.tsx: scroller state and back control findings; non-blocking notes.
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHeavyCommit.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHidden.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/index.ts: clear.
  • packages/lab/src/NavigationStack/useNavigationLink.ts: depends on the press tracker re-export.
  • packages/lab/src/index.ts: clear.
  • scripts/touch-support-bundle.test.mjs: clear.

Automated review (maintainer link)

Comment on lines +55 to +56
/** The x the card of `key` shows now, in px, or null with no card. */
/** A stack card's key, or the moving element itself. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking: these two doc comments now both sit on MovingTarget, so shownX (:63) has none, and the first still names "the card of key". Move it onto shownX with "the target" in place of "the card of key", and make the same change in watchFirstMove's doc (:83-84).

The navstack-inert-cost page times warm, repeated toggles. `?mode=settle`
times one flip at a pop's settle instead. Each take slides the transcript
out on a Web Animation. In the task where it finishes, the covered list's
`inert` comes off, its `pointer-events` come back, or nothing changes, in
turn (`?shape=` pins one). The readout gives each flip's time, with style
and layout forced around it, and the longest wait between frames after it,
with the medians per shape.

The page slides the card itself, so the stack makes no flip of its own. A
corner square changes colour in the settle's task. Beside it, a bar moves
each frame and a strip moves on a Web Animation, so a film counts frozen
frames. The default mode does not change.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This preview still needs an engineering owner's decision on NavigationStack's record before any of it can merge, and five defects need fixing once that decision is made. The new settle arm on navstack-inert-cost adds no stack option and reads as described, though its default readout has no link to it yet.

main has no current NavigationStack record and the draft record in #12005 is not approved, so the record has to settle transition: 'cut' with pathTransition, focus: 'keep', retained screens with evict(), prepare()/drop() with useNavigationLink, scroll="content", isBarHidden, titleContent, useNavigationScreen and the per-card layering. An engineering owner records that decision by commenting /approve-spec with the full head SHA on the pull request, and the author may do so as an engineering owner.

Blocking:

  • Regression: internal/touch.ts:129 re-exports usePressTracker for useNavigationLink, which the press feedback record and the component runtime record on main rule out (the press tracker keeps only its listed direct users), so drive prepare/drop from the press feedback engine or have that record name the link, then drop the re-export.
  • Miss: NavigationStack.tsx:602 keeps the content scroller's element in React state, which the component runtime record's INV1 forbids, so own the node through a ref and keep only whether it is attached in state.
  • Miss: the story title Lab/NavigationStack/Spec demos nests three levels, which the story tree test rejects in the Storybook build, so use a two-level title and update the browser specs' story ids.
  • Miss: a pushed screen with isBarHidden still gets the stack's back control (NavigationStack.tsx:2390-2398), which paints over its own header's first control and takes its taps, so render the back control only while the top screen shows its bar.
  • Miss: NavigationScreenContext and NavigationScrollerContext (NavigationStack.tsx:211, :226) are plain createContext objects, so a swizzled NavigationStack never reaches screen content that calls the package's useNavigationScreen or useNavigationScroller; create them with createSharedContext, as Lab's MediaPlayerContext does.

Also needed before approval:

  • Report each option's first-load gzip delta for a page that renders NavigationStack without it, since each option may add at most 0.3 KB and the options together add about 1.5 KB gzip to such a page today.
Claims and files checked

Review mode: incremental; reason: none

Changed rules since the last review: changed rules (0): none.

Claims:

  • Preview only, not for merge: consistent with the draft state and title.
  • New chat in the cut demo pushes with a cut and focuses the field in the same tap, and Fork replaces the chat in one cut so Back opens the list: verified earlier (browser and unit test); that code is unchanged.
  • A reopened chat keeps its draft and scroll, a retained screen stays laid out, and Delete chat evicts it: verified (unit tests); unchanged.
  • A row's press prepares its chat and a scroll drops it: verified (unit tests); unchanged.
  • The content scroller demo has its own scroller and a docked composer: verified (unit test and story).
  • A bar-hidden root keeps its own header and the chat's bar arrives with the push: verified earlier (browser); unchanged.
  • Hidden screens take no taps or hit tests: verified from code and unit tests; the browser spec was not run.
  • Six sandbox pages fill the page, five hold the stack and the start-clock page holds one card: verified (code).
  • Five measuring pages put a readout at the bottom that links the page's arms and prints a line per change: verified, except that the inert-cost default readout does not link the new settle arm (non-blocking).
  • The inert-cost settle arm slides the transcript out on a Web Animation, flips the covered list's inert or pointer-events or nothing in turn where it finishes, and reports each flip's time and the longest frame gap, with a corner square, a per-frame bar and an animated strip for filming: verified (code); the page's own animation stands in for a pop, and no take ran in this review.
  • The other pages' descriptions (current and proposed, press, kept layout, heavy commit, start clock): verified earlier; their code is unchanged.
  • The pages join the sandbox page list, the export route list and the pages that read the query before hydrating: verified (code; the route list holds 865 routes).
  • The bar strip no longer takes hit tests, while the bar's background, layers and back button do: verified earlier (browser); unchanged.
  • Main is merged in, and its own start of a change from rest replaces the prototype's: verified (merge history).
  • Review fixes (eviction in a pop's handler, the cancelled press, committed refs, card order in state, links on Core's press tracker with a Changeset): verified (code and unit tests).
  • The cut through pathTransition and laid-out retained screens implement the draft record's requirements: not checked against the draft, which is not approved.
  • An animated same-depth change still behaves as on main: verified (unchanged fallback branch).
  • Every option sits in the stack's module, so a stack that uses none still loads them: verified (about 1.5 KB gzip added).
  • Earlier heads' results (lint, typecheck, the sandbox build and its routes, node tests, phone-profile script runs, unit and interaction specs, WebKit, the Storybook build, preflight): carried from earlier reviews where they were checked; nothing could run in this review.
  • Three preflight checks fail on the prototype's code (lint at the re-export, the story tree test, the pre-review check on the scroller state): verified (each is a blocking finding above).
  • No internal context in public text: verified.
  • Changeset: names Core as a patch for the internal touch entry's re-export, which the package entry point does not export: verified (code and the bundle guard's Lab-only list).

Files:

  • .changeset/internal-touch-press-tracker.md: clear while the re-export stays; goes with it.
  • apps/sandbox/scripts/next-export-routes.json: clear.
  • apps/sandbox/src/app/(raw)/navigationStackCells.tsx: clear; non-blocking note on two stale doc comments.
  • apps/sandbox/src/app/(raw)/pages/motion-start-clock/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-current-proposed/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-heavy-commit/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-inert-cost/page.tsx: clear; non-blocking note on the missing settle link.
  • apps/sandbox/src/app/(raw)/pages/navstack-kept-layout/page.tsx: clear.
  • apps/sandbox/src/app/(raw)/pages/navstack-press/page.tsx: clear.
  • apps/sandbox/src/app/sandboxPages.ts: clear; its entry now names the settle arm.
  • apps/sandbox/src/hydration-policy.ts: clear.
  • apps/storybook/stories/NavigationStackSpecDemos.stories.tsx: story title finding.
  • packages/core/src/internal/touch.test.ts: clear while the re-export stays.
  • packages/core/src/internal/touch.ts: press tracker re-export finding.
  • packages/lab/src/NavigationStack/NavigationStack.keep.test.tsx: clear.
  • packages/lab/src/NavigationStack/NavigationStack.tsx: scroller state, back control and shared context findings; non-blocking notes.
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHeavyCommit.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/__tests__/NavigationStackHidden.interaction.browser.spec.ts: clear (not run).
  • packages/lab/src/NavigationStack/index.ts: clear.
  • packages/lab/src/NavigationStack/useNavigationLink.ts: depends on the press tracker re-export.
  • packages/lab/src/index.ts: clear.
  • scripts/touch-support-bundle.test.mjs: clear.

Automated review (maintainer link)


const NavigationStackContext = createContext<NavigationStackApi | null>(null);

const NavigationScreenContext = createContext<NavigationScreenState>('top');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Miss: this context and NavigationScrollerContext (:226) are module-local createContext objects, and the public useNavigationScreen (:244-246) and useNavigationScroller (:234-236) read them. A swizzled NavigationStack provides its own objects, so a screen whose content imports these hooks from @astryxdesign/lab reads the defaults: every screen reports top, and a scroll="content" screen's scroller never attaches, so the bar's edge effect stays off and the content gets no bar inset. spec:AST-110 FR3 keeps "a context that connects a provider to its consumers" under a versioned key: use createSharedContext('NavigationScreenContext', 1, 'top') and createSharedContext('NavigationScrollerContext', 1, null) from @astryxdesign/core/internal/shared-context, as Lab's MediaPlayerContext does.

Comment on lines +206 to +209
links={[
{label: '2,200 rows, 100 turns', href: PAGE},
{label: '500 rows', href: `${PAGE}?rows=500`},
]}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking: this readout links only the row counts, so on a phone the new settle arm is reached by editing the address. Add a settle link here (${PAGE}?mode=settle), as the settle readout links back to toggles (:484-487).

This branch was successfully deployed

1 active deployment
Preview — dde2ab87 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant