Skip to content

feat(AppShell): under a finger, the pinned touch header is an iOS 26 bar with its scroll edge effect - #8142

Draft
vjeux wants to merge 1369 commits into
meta:mainfrom
vjeux:uikit/c16-scroll-edge
Draft

vjeux wants to merge 1369 commits into
meta:mainfrom
vjeux:uikit/c16-scroll-edge

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #8320 (on #8076) and #8066. Review only this PR's change: vjeux/astryx@4f519b0...4fe659b

Carries #8562 (Core's internal entries) as a dependency; if the entries land differently, this follows her decision.

User need

AppShell's pinned header is opaque; an iOS 26 bar paints nothing until content is 10 pt under it, then fades a veil in.

Problem and solution fit

Under a finger (spec:AST-094 FR13), when the page scrolls; measured on iOS 26.2 (motion/uikit/bars.ts):

  • No background or divider.
  • The veil switches at 10 px under the header: a finger's scroll and momentum fade it on UIKit's springs (in 0.294 s, out 0.514 s); a programmatic scroll (scrollTo, a status-bar tap) switches it.
  • Denser than UIKit's (0.95, edge at the header's bottom): the title keeps WCAG 1.4.3's 4.5:1 (UIKit's: 2.58:1).
  • Reduce Motion: a 200 ms cross-fade (DR2); Reduce Transparency: an opaque band.

A mouse keeps today's bar.

Current specification

No AppShell record.

Owner decisions (proposed; pending owner review):

  1. Under a finger the header is transparent, without divider.
  2. The veil takes each variant's general background token (iOS samples the content behind).

Per #8257 (spec:AST-094 DEC-11), the springs and the veil's shape stay internal constants.

Public delta and caller burden

None: no theme key, CSS variable or export.

Design and alternatives

An IntersectionObserver watches a 10 px sentinel. useFingerScroll (#8320) says whose scroll it is: a finger's until scrollend. Fill and divider follow (pointer: coarse) in CSS: a server render suits either pointer. Rejected: scroll-driven animation, backdrop-filter, a pseudo-element transition.

Size (INV6, analyze-pr, gzip, base → head): AppShell's import 59,757 → 84,253 B of JavaScript; its CSS 11,922 → 12,260 B.

Evidence

iOS 26.2 Safari, main (top) and this branch (bottom):

P2: a programmatic scroll switches at 10 px, both ways

P4: a finger drags the page under the bar and back

This branch: 1/4-speed springs (P3), a 300 ms block (P5), Reduce Motion (P6):

P3 P5 P6

Android 15, Chromium 158 (emulator), mask off:

Android: a finger drag

WebKit defect (iOS 26.2), worked around: a composited layer under a sticky header drops its items for ~2 frames when the program scrolls back to the top (reduction in Testing). The veil is composited only from a finger's landing until its scroll ends (or 200 ms after its last scroll, without scrollend); the program's switch writes none: 2/2/2 blank frames → 0/0/0. Remaining: scrollTo during a finger's fade (1/1/1).

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run packages/core/src/{motion,AppShell,gestures,theme,hooks,internal,Layout} packages/core/src/utils/touchPresentation.test.ts: 126 files, 3394 tests pass, motion/uikit/tableImports.test.ts included (AppShell imports the bars table and hands its springs and registerBarsTable to the hook). New jsdom cases:
    • a finger's scroll fades in and out on the two springs, turning around mid-fade; a programmatic scroll switches at once, also right after a finger's fade, and writes no will-change (fails before the fix: the old switch left will-change: opacity);
    • the layer is composited from a finger's landing until its scroll ends, momentum included, in the page and in a scroll container; a tap that lifts without scrolling drops it at once; a mouse never composites it;
    • the finger cases declare a coarse primary pointer, since the shared gesture host listens only there (spec:AST-094 FR19, FR24); with a mouse a finger never composites the veil;
    • the hook watches the page's or the scroll container's finger scrolls through useFingerScroll, only while it runs; a mouse observes and watches nothing;
    • the bar's rules apply under the coarse pointer only; with a mouse each variant keeps its own fill (an augmented one none: failed at ae06884, which painted it surface);
    • the section divider stays in the markup and a coarse-pointer rule hides it, so a server render's header is the same whatever defaultIsMobile guesses (failed at ae06884, which dropped it through the guess);
    • where the browser sends no scrollend, the layer drops 200 ms after the finger's last scroll event, past the finger-scroll watch's 150 ms; each shell keeps one document listener, scrollend or else scroll (both failed at ae06884);
    • the veil literals are recomputed from bars.ts, its denser contrast values included;
    • @astryxdesign/core/internal/motion hands Lab useScrollEdgeEffect, bars and registerBarsTable by name, the same values Core imports by path (failed before the re-exports).
  • pnpm exec vitest run --project node packages/cli/test: 309 pass, no golden change (the bars table lists no roles).
  • pnpm test:interaction AppShellScrollEdge gestures.browser against a fresh pnpm storybook:build: 49 pass in Chromium; 39 pass and 10 Chromium-only skips in WebKit (official Playwright image), the gesture host's watcher spec included. A finger's scroll is a finger resting on the content while the page scrolls, or a real touch drag in Chromium. New cases: a programmatic scroll switches with no animation; a finger's fade, then a programmatic switch; a mouse keeps the opaque bar. Every mouse case, unit and browser, first asserts that its pointer is fine.
  • iOS 26.2 simulator (iPhone 17 Pro, Safari): the recordings above (from before the fix, which changes only when the veil is composited, not a pixel). Blank-header frames per recording (main / this branch): P2 0/0, P4 0/0, P5 –/0, P6 –/0. At 886619e (this PR's commits before the latest base merge), 3 runs each: programmatic return to the top 0/0/0, with no animation (2/2/2 before the fix); finger drag 0/0/0 (18–22 animated frames); a scrollTo right after a swipe 1/1/1 (the remaining case above). At an earlier head with the same effect: flick crossing during the momentum 0/0/0, quick back-and-forth 0/0/0. Reduce Motion was set through idb. The mid-fade turnaround is covered by the specs (the simulator's injected swipes come about 0.5 s apart, longer than the fade).
  • The WebKit reduction (plain HTML, no Astryx: a sticky header over a child layer, scrollTo 120 px and back to 0), blank frames per take: no layer 0 in 5; will-change: opacity on the child, never switching, 3/1/2/1/3; will-change added with the switch and removed 500 ms later (what the animator's promotion did) 2/2/1; a position: fixed child outside the header 2/3/2; the layer dropped in the same task as the scroll 0 in 6.
  • Android 15 emulator (recording lease, real finger drag with no rest before the move). At 886619e, Chromium 158, 6 takes: the veil fades in and out, and the page's frames lose none at the fade start or through the fade-out; the emulator drops one frame as each drag starts, before the fade (6 of 6), as it does with no veil (feat(lab): under a finger, NavigationStack's bar takes the iOS 26 look #8396's traces). At the previous head (the same effect), Chrome 124, 6 takes: none lost at the fade start (7 of 12 when the layer was created as the fade started), and a ~50 ms compositor gap at the fade-out start in 4 of 6, which a CDP trace puts in the GPU process (SkiaOutputSurfaceImplOnGpu::SwapBuffers, 78 ms) with nothing of ours waiting: the emulator's software-GL swap. A composited veil makes it more frequent there (9 of 13 takes with will-change throughout, 4 of 10 without), and a hidden veil removes it (0 of 5).
  • Title contrast, Chromium, over the story's scrolled tiles: worst case 10.65:1 light, 5.41:1 dark.
  • scripts/touch-support-bundle.test.mjs › "is absent from the root entry" is red: AppShell's touch bar imports the gesture host statically, as INV13 prescribes, so the test's whole-root claim can't hold; F1's per-component bundle test, test(core): a touch component's import carries its gesture code, and nothing else does #8671, lists AppShell as a gesture user.
  • pnpm a11y:audit -- --components AppShell: 0 violations. Root pnpm typecheck after pnpm build (CI's order): 0 errors. check:changesets, the CI duration guard, internalModulesNotExperimental, scripts/lab-core-imports.test.mjs, scripts/core-internal-entries.test.mjs, eslint, prettier and the pre-commit checks pass.

@vercel

vercel Bot commented Oct 24, 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 Oct 27, 2026 1:41pm UTC

Request Review

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 24, 2026
@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Oct 30, 2026, 5:30 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This needs an engineering owner's decision before it can be approved. No current spec covers AppShell's touch header becoming a transparent iOS 26-style bar for every touch height="auto" shell, and draft spec:AST-094, which narrows the theme-tokens architecture for touch motion, is not approved. An engineering owner can record that decision by commenting /approve-spec b1344d389e3fd89b82cf2d900d45eb3ab6ee6b3f (the author can, if they are one), naming or adding the record that governs the header and updating theme-tokens for FR4. These need fixing whatever the decision:

  • test-ui and pr-a11y fail: document --_app-shell-scroll-edge-fill in AppShell.doc.mjs, and give the TouchBarOverContent story a keyboard stop in its scroll region.
  • useScrollEdgeEffect keeps the sentinel element in React state, which architecture:react-component-runtime INV1 forbids, and the veil's zIndex: -1 needs an isolation: isolate owner on the header (spec:AST-027 FR2).
  • WebKit does not recognize prefers-reduced-transparency, so the changeset's Reduce Transparency band needs iOS Safari evidence or a narrower claim, and header text over scrolled content needs contrast evidence.
  • At about 15,000 authored lines the stack is far over the 2,000-line limit; landing #8043–#8067 first leaves this change at 1,464 lines.

[Automated review]

root,
}: UseScrollEdgeEffectOptions): UseScrollEdgeEffectResult {
const {ref: layerRef, animator} = useAnimator({initial: {opacity: 0}});
const [sentinel, setSentinel] = useState<HTMLElement | null>(null);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This keeps the sentinel element in React state, which architecture:react-component-runtime INV1 forbids ("DOM nodes … MUST NOT be stored in React state; store only the minimal rendering key or own the node through a ref"). Own the node through the callback ref instead: create and disconnect the observer there (INV6 node replacement), or hold it in a ref and key the effect on enabled.

default: 'calc(100% + 54.8px)',
'@media (prefers-reduced-transparency: reduce)': '100%',
},
zIndex: -1,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

zIndex: -1 orders this layer behind the header's content, but no style on the header declares isolation: isolate, which spec:AST-027 FR2 requires for every local stacking relationship. It works today only because the sticky header's zIndex: 1 forms a stacking context. Add isolation: 'isolate' to the header surface that holds the layer.

Comment thread packages/core/src/AppShell/AppShell.tsx Outdated
},
},
scrollEdgeFillBody: {
'--_app-shell-scroll-edge-fill': colorVars['--color-background-body'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

--_app-shell-scroll-edge-fill is not listed in AppShell.doc.mjs (theming.vars[] plus a derived[] entry), so derivedVarRegistry.test.ts › "AppShell: all source vars are in doc file" fails (CI test-ui (1/4)).

'@astryxdesign/core': patch
---

[feat] AppShell: on a touch screen whose page scrolls (`height="auto"`, or `height="adaptive"` on a touch device), the pinned header looks like an iOS 26 bar. It paints no background of its own and draws no divider. Once the content has moved more than 10px under it, a veil of the header's colour fades in at its top on iOS's measured spring (0.29 s): strongest at the top, gone just below the header. It fades out (0.51 s) when the content comes back. Under Reduce Transparency the veil is an opaque band ending at the header's bottom edge. With a mouse nothing changes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The Reduce Transparency band keys on prefers-reduced-transparency, which Playwright's WebKit does not recognize (neither reduce nor no-preference matches), and the PR's evidence is Chromium emulation only. spec:AST-013 FR10 needs iOS Safari evidence for this claim; otherwise limit the note to engines that support the feature.

* colour fades in at the top of the screen, and it fades out when they come
* back. With a mouse the header stays opaque.
*/
export const TouchBarOverContent: Story = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

pr-a11y flags a new serious scrollable-region-focusable violation here. With a mouse, adaptive resolves to fill and the main region scrolls with only non-focusable tiles in it. Give it a keyboard stop, as AdaptiveHeight does with its action.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

AppShell (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) 785B 785B 0B
Lines of Code 608 721 -
Complexity Very High Very High (130) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/AlertDialog 56.9KB 57.2KB +294B 12.4KB 12.4KB 0B
core/AppShell 57.9KB 82.3KB +24.4KB ⚠️ 11.6KB 12.0KB +338B
core/AvatarGroupOverflow 39.9KB 40.2KB +303B 6.4KB 6.4KB 0B
core/Banner 47.8KB 48.1KB +289B 9.9KB 9.9KB 0B
core/BaseTypeahead 54.3KB 54.6KB +251B 9.9KB 9.9KB 0B
core/BreadcrumbItem 66.4KB 66.6KB +297B 11.0KB 11.0KB 0B
core/Button 43.3KB 43.5KB +273B 9.2KB 9.2KB 0B
core/Calendar 54.9KB 55.2KB +290B 10.0KB 10.0KB 0B
core/Carousel 50.2KB 50.5KB +316B 10.2KB 10.2KB 0B
core/ChatComposer 60.6KB 60.9KB +270B 10.8KB 10.8KB 0B
core/ChatComposerInput 55.7KB 56.0KB +264B 10.1KB 10.1KB 0B
core/ChatComposerTokenElement 55.7KB 56.0KB +264B 10.1KB 10.1KB 0B
core/ChatDictationButton 46.5KB 46.8KB +264B 9.5KB 9.5KB 0B
core/ChatLayout 48.8KB 49.1KB +273B 9.9KB 9.9KB 0B
core/ChatLayoutScrollButton 46.4KB 46.6KB +255B 9.6KB 9.6KB 0B
core/ChatSendButton 45.8KB 46.1KB +265B 9.2KB 9.2KB 0B
core/CheckboxInput 49.9KB 50.2KB +273B 9.3KB 9.3KB 0B
core/CheckboxListItem 54.0KB 54.3KB +244B 10.5KB 10.5KB 0B
core/ClickableCard 12.8KB 13.1KB +289B 6.9KB 6.9KB 0B
core/CodeBlock 60.5KB 60.8KB +278B 10.7KB 10.7KB 0B
core/Collapsible 11.7KB 12.0KB +291B 4.2KB 4.2KB 0B
core/CommandPalette 50.9KB 51.2KB +281B 11.8KB 11.8KB 0B
core/CommandPaletteItem 8.4KB 8.7KB +280B 3.5KB 3.5KB 0B
core/ComplexSelector 55.8KB 56.1KB +318B 10.6KB 10.6KB 0B
core/ContextMenu 77.7KB 78.0KB +275B 14.6KB 14.6KB 0B
core/ContextMenuItem 16.6KB 16.8KB +280B 5.2KB 5.2KB 0B
core/DateInput 99.9KB 100.1KB +243B 14.8KB 14.8KB 0B
core/DateRangeInput 69.4KB 69.6KB +266B 11.2KB 11.2KB 0B
core/DateTimeInput 110.1KB 110.3KB +248B 15.2KB 15.2KB 0B
core/DialogHeader 48.8KB 49.1KB +280B 9.8KB 9.8KB 0B
core/DrawerHeader 48.9KB 49.2KB +249B 11.2KB 11.2KB 0B
core/DropdownMenu 72.7KB 73.0KB +278B 14.7KB 14.7KB 0B
core/DropdownMenuCheckboxItem 16.1KB 16.4KB +284B 5.6KB 5.6KB 0B
core/DropdownMenuItem 15.4KB 15.7KB +287B 5.2KB 5.2KB 0B
core/DropdownMenuRadioItem 16.2KB 16.5KB +275B 5.6KB 5.6KB 0B
core/DropdownMenuSubMenu 58.1KB 58.3KB +270B 9.5KB 9.5KB 0B
core/FileInput 54.1KB 54.4KB +262B 10.3KB 10.3KB 0B
core/IconButton 43.3KB 43.6KB +273B 9.2KB 9.2KB 0B
core/Item 11.4KB 11.6KB +273B 4.7KB 4.7KB 0B
core/LayerProvider 63.3KB 63.6KB +288B 10.1KB 10.1KB 0B
core/Lightbox 51.2KB 51.4KB +249B 9.8KB 9.8KB 0B
core/Link 43.5KB 43.8KB +288B 7.6KB 7.6KB 0B
core/ListItem 53.5KB 53.7KB +268B 10.5KB 10.5KB 0B
core/Markdown 144.5KB 144.7KB +247B 17.4KB 17.4KB 0B
core/MobileNav 51.0KB 51.3KB +264B 10.1KB 10.1KB 0B
core/MobileNavToggle 46.2KB 46.5KB +259B 9.4KB 9.4KB 0B
core/MoreMenu 72.9KB 73.2KB +278B 14.7KB 14.7KB 0B
core/MultiSelector 76.2KB 76.4KB +270B 14.6KB 14.6KB 0B
core/NumberInput 55.7KB 56.0KB +278B 10.7KB 10.7KB 0B
core/Outline 28.6KB 28.9KB +290B 4.0KB 4.0KB 0B
core/Pagination 87.7KB 88.0KB +263B 15.3KB 15.3KB 0B
core/Popover 49.8KB 50.1KB +238B 12.1KB 12.1KB 0B
core/PowerSearch 155.1KB 155.3KB +263B 18.6KB 18.6KB 0B
core/RadioListItem 52.1KB 52.4KB +286B 9.7KB 9.7KB 0B
core/SegmentedControlItem 8.6KB 8.9KB +285B 3.9KB 3.9KB 0B
core/SelectableCard 12.8KB 13.1KB +294B 7.1KB 7.1KB 0B
core/Selector 79.1KB 79.4KB +268B 15.0KB 15.0KB 0B
core/SelectorOption 14.5KB 14.8KB +251B 5.1KB 5.1KB 0B
core/SideNav 58.0KB 58.3KB +272B 10.6KB 10.6KB 0B
core/SideNavCollapseButton 46.6KB 46.9KB +242B 9.5KB 9.5KB 0B
core/SideNavHeading 54.7KB 55.0KB +248B 10.1KB 10.1KB 0B
core/SideNavItem 54.5KB 54.8KB +266B 10.1KB 10.1KB 0B
core/Step 32.4KB 32.7KB +279B 5.3KB 5.3KB 0B
core/Stepper 47.4KB 47.7KB +265B 9.6KB 9.6KB 0B
core/Switch 48.4KB 48.7KB +285B 9.3KB 9.3KB 0B
core/Tab 9.7KB 10.0KB +294B 4.1KB 4.1KB 0B
core/TabMenu 51.6KB 51.9KB +276B 10.0KB 10.0KB 0B
core/Table 84.0KB 84.2KB +253B 15.1KB 15.1KB 0B
core/TableCell 78.8KB 79.1KB +267B 14.8KB 14.8KB 0B
core/TableHeaderCell 78.6KB 78.8KB +272B 14.8KB 14.8KB 0B
core/TableSelectionToolbar 52.4KB 52.6KB +278B 11.2KB 11.2KB 0B
core/TextInput 53.5KB 53.8KB +281B 10.5KB 10.5KB 0B
core/Thumbnail 50.7KB 50.9KB +274B 11.0KB 11.0KB 0B
core/TimeInput 86.8KB 87.1KB +266B 13.8KB 13.8KB 0B
core/Timestamp 27.5KB 27.5KB -1B 9.5KB 9.5KB 0B
core/Toast 59.8KB 60.1KB +258B 9.7KB 9.7KB 0B
core/ToggleButton 44.1KB 44.4KB +243B 9.3KB 9.3KB 0B
core/Token 29.6KB 29.9KB +289B 4.5KB 4.5KB 0B
core/Tokenizer 64.8KB 65.1KB +306B 11.7KB 11.7KB 0B
core/TopNav 51.9KB 52.1KB +277B 10.4KB 10.4KB 0B
core/TopNavHeading 54.2KB 54.4KB +231B 9.9KB 9.9KB 0B
core/TopNavItem 9.0KB 9.3KB +283B 3.8KB 3.8KB 0B
core/TopNavMegaMenu 54.2KB 54.4KB +268B 10.8KB 10.8KB 0B
core/TopNavMegaMenuItem 9.1KB 9.4KB +281B 4.1KB 4.1KB 0B
core/TopNavMenu 53.6KB 53.8KB +258B 10.1KB 10.1KB 0B
core/TreeList 32.5KB 32.8KB +274B 4.7KB 4.7KB 0B
core/Typeahead 61.5KB 61.7KB +268B 11.3KB 11.3KB 0B

Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included.

⚠️ Touch-only size budget

These components grew past the touch-only budget (2 KB gzip JavaScript or 1 KB gzip CSS per component). If the growth runs only on a coarse pointer, load its JavaScript lazily so the import does not carry it, or justify the cost in the pull request description; CSS stays in the package stylesheet, so justify it.

Component JavaScript CSS
core/AppShell +24.4KB ⚠️ +338B

Bundle Size Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/core 4.9KB 1.2KB 1.2KB 0B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 34.6KB 34.8KB +268B

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

55 of 502 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
RichTextEditor Markdown parity: side by side probe dark 558,840
RichTextEditor Markdown parity: side by side probe light 540,756
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
AppShell With Mobile Nav probe light 217,010
AppShell With Mobile Nav probe dark 216,960
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
AppShell Playground neutral dark 65,198
AppShell Playground neutral light 63,788
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232

and 35 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@vjeux
vjeux force-pushed the uikit/c16-scroll-edge branch from b1344d3 to 9a29be3 Compare October 24, 2026 09:20

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This needs an engineering owner's decision before it can be approved: no current spec covers AppShell's touch header becoming a transparent iOS 26-style bar for every touch height="auto" shell, and draft spec:AST-094, which narrows the theme-tokens architecture for touch motion, is not approved. An engineering owner settles that by naming or adding the record that governs the header and commenting /approve-spec 9a29be3744a362a650bf1512eed1a77389d0ad11 on this pull request; the author may do so if they are an engineering owner. These need fixing whatever the decision:

  • useScrollEdgeEffect keeps the sentinel element in React state, which architecture:react-component-runtime INV1 forbids, and the veil's zIndex: -1 needs an isolation: isolate owner on the header (spec:AST-027 FR2).
  • Safari has not shipped prefers-reduced-transparency, so the changeset's Reduce Transparency band needs iOS Safari evidence or a narrower claim, and header text over scrolled content needs WCAG 1.4.3 evidence (the white title meets scrolled text at 3.79:1 in dark mode).
  • At about 15,000 authored lines the stack is far over the 2,000-line limit; landing #8043-#8067 first leaves this change at about 1,460 lines.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

Parts of this PR re-implement behavior that already exists, or is being specified, as a shared part of core. Converging keeps one implementation per behavior:

  • Touch gating. core/src/AppShell/AppShell.tsx:454 writes its own (pointer: coarse) check. This conflicts with AST-012 FR2 (touch is resolved once, through the closed adaptation vocabulary) and public-component-api INV16. Resolve through the shared touch resolver key so behavior matches the spec. If this behavior genuinely can't be expressed through the resolver, please raise it here as a spec question instead of shipping a separate check.

This is about where the behavior lives, not about the PR's intent.

@vjeux

vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: one implementation.

  • Touch gating: the bar look stops writing AppShell's own (pointer: coarse) check and keys on the resolver's touch presentation (useTouchPresentation() in script, the resolver's touch key in styles), the same on every touch device (Android included); a mouse keeps today's header.
  • Reduce Motion goes through the animator's policy; the hook keeps no motion constant of its own.

Both land in the next push of this PR.

@vjeux
vjeux force-pushed the uikit/c16-scroll-edge branch from 9a29be3 to 407c5e9 Compare October 25, 2026 01:21
@vjeux
vjeux requested a review from potatowagon as a code owner October 25, 2026 01:21
@vjeux vjeux changed the title feat(AppShell): the touch header is an iOS 26 bar with a scroll edge effect feat(AppShell): under a finger, the pinned touch header is an iOS 26 bar with its scroll edge effect Oct 25, 2026
@vjeux

vjeux commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 407c5e9: touch reads through the resolver (useTouchPresentation() in script; in styles the literal @media (pointer: coarse), pinned to the resolver's constant by #8331's spelling test, because the StyleX build gives an imported at-rule key a different priority). Reduced motion goes through the animator's policy, with no local constant, and whether a scroll is a finger's comes from the shared gesture host (#8336).

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This needs an engineering owner's decision before it can be approved: the current AppShell spec says each variant paints the header's background and section divides it from the content (FR7) and lists the root's children (FR1), while this change makes the touch header transparent with a veil, drops the divider and adds a sentinel for every touch height="auto" shell, with no opt-out. An engineering owner settles it by amending those claims in packages/core/src/AppShell/AppShell.spec.md, or ruling the touch bar out, and recording approval by commenting /approve-spec b110fb4d583bd5dcb97edc7ddebbb549b361dca8 (or the full SHA of a later head that carries the amendment); the author may do so as an engineering owner, and the same decision covers draft spec:AST-094, whose FR4 forbids the theme-settable springs this change adds. Whatever the decision, these need changes:

  • Land #8076, #8331, #8336 and #8066 first and rebase: the diff carries about 36,000 authored lines against a 2,000-line limit, while this change alone is about 1,860.
  • Augmented AppShellVariantMap values on height="auto" now get a surface-coloured header even with a mouse (AppShell.tsx:721-726); keep their previous path or treat them as elevated.
  • astryx docs motion still says no shipped component reads motion roles (motion.doc.mjs:151), AppShell's dense doc limits the bar to iOS (AppShell.doc.mjs:376), and the description reports no public delta although two role ids are added.

[Automated review]

Comment thread packages/core/src/AppShell/AppShell.tsx Outdated
Comment on lines +721 to +726
const barFillsWithBody = variant === 'wash' || variant === 'elevated';
const headerAreaStyle = isAuto
? barFillsWithBody
? styles.navAreaWashTouchBar
: styles.navAreaSurfaceTouchBar
: navAreaStyle;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Every variant other than wash and elevated lands on navAreaSurfaceTouchBar, so a module-augmented AppShellVariantMap value on height="auto" now gets a header painted --color-background-surface even with a mouse, where the previous navAreaStyle ?? (isAuto && variant === 'section' ? styles.navAreaSurface : undefined) painted nothing over the elevated frame. Apply the touch-bar styles only to the four built-in variants (or treat augmented values as elevated), so "With a mouse nothing changes" holds.

Comment thread packages/cli/assets/docs/motion.doc.mjs Outdated
content: [
{
type: 'prose',
text: 'Touch motion has a table of springs, durations and curves measured on iPhone and iPad. Each value is a motion role named by its table path, such as `springs.sheetPresent` or `timing.curves.easeInOut`. A theme retunes a role through `motion.springs`, `motion.durations` or `motion.curves`, at its root or in an adaptation rule; a role it leaves alone keeps its measured default. No shipped component reads these roles yet.',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"No shipped component reads these roles yet" stops being true with this pull request: AppShell's touch header plays bars.scrollEdgeEffect.appear and .disappear, which the animator resolves against the element's theme (motion/animator.ts:1535). Name AppShell as the first reader here and in the changeset.

banner: 'slot for system-wide announcements above topNav',
height:
'fill=viewport 100dvh w/ independent scroll; auto=content-driven w/ sticky nav',
'fill=viewport 100dvh w/ independent scroll; auto=content-driven w/ sticky nav; adaptive=fill w/ mouse, auto on touch (page scroll); root data-scroll-owner=content|document; iOS touch+page scroll: header has no background, iOS 26 scroll-edge veil fades in past 10px of content under it (elsewhere opaque)',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"iOS touch+page scroll" narrows the bar to iOS, but the code applies it under any coarse primary pointer (useTouchPresentation() and @media (pointer: coarse)), Android included, as the verbose doc says. Say "coarse pointer" here.

@vjeux
vjeux force-pushed the uikit/c16-scroll-edge branch from b110fb4 to 36d2fbe Compare October 25, 2026 04:16
vjeux added 4 commits October 27, 2026 03:57
…ntries and internal/motion

Main's resolveSnapPoint test (meta#8663) keeps the release policy internal:
not on the package root, not in a barrel, and no package export naming
motion. The last check also caught ./internal/motion, Core's internal
entry for Astryx's own packages (architecture:react-component-runtime
INV13), which re-exports no release policy. The export check now covers
the public keys only, and a new assertion keeps the claim as strong:
internal/motion must not re-export resolveSnapPoint either.

On this branch with main the test failed on ./internal/motion; it now
passes, and it fails when internal/motion re-exports resolveSnapPoint.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
vjeux added 3 commits October 27, 2026 05:05
… a mouse press

At the document, an event from inside an open shadow root is retargeted to
the shadow host, and so is a touch's target, so the host looked for
participants from the shadow host and found none inside the root: the
browser then sent its own mousedown and click. Both cases, a finger and a
mouse, attach a tap to an element in the shadow root. Fail until the host
resolves targets through the composed path.
…composed path

Inside an open shadow root the document's listeners see the shadow host,
in event.target and in a touch's target alike, so a recognizer on an
element in the root never got its finger, and nothing claimed it. landedOn
takes the composed path's first element for the event's own target and for
a touch whose target is the event's (another finger keeps its own): a
touch's start, a pointer's press and its pairing, the last touch a scroll
reads, a cancelled pointer's touch and hover.
…he host resolves targets through the composed path) into meta#8320

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval waits on an owner decision: under a finger this pull request makes AppShell’s pinned header transparent, drops the section divider and fades in a 0.95-alpha veil on springs played as constants, which AppShell’s current record (FR7, variant backgrounds) and AST-094 FR4 (motion roles) do not provide for. An engineering owner needs to decide whether component:AppShell adopts this touch presentation and records its springs as roles, and records that decision by commenting /approve-spec ae0688418231a9eabdbefa7591effdb9b248a819 on this pull request; the author may do so as an engineering owner. Whatever the decision, these need changes:

  • Land the stacked bases separately so the bar (2,146 of 27,423 authored lines) is reviewed on its own.
  • scripts/touch-support-bundle.test.mjs fails on this head because AppShell’s import of the scroll edge hook brings 12 gesture modules (about 47 KB) into the root-entry bundle it measures.
  • Augmented variants now paint a surface header with a mouse, and a server render with defaultIsMobile drops the section divider.
  • The scroll edge hook adds a document scrollend listener per shell and keeps its layer promoted where no scrollend fires, and its WebKit workaround names no removal condition.

[Automated review]

Comment thread packages/core/src/AppShell/AppShell.tsx Outdated
Comment on lines +734 to +739
const barFillsWithBody = variant === 'wash' || variant === 'elevated';
const headerAreaStyle = isAuto
? barFillsWithBody
? styles.navAreaWashTouchBar
: styles.navAreaSurfaceTouchBar
: navAreaStyle;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Every variant other than wash and elevated lands on navAreaSurfaceTouchBar, whose default arm paints surface, so a module-augmented variant’s header goes from unpainted over the elevated frame to rgb(255, 255, 255) for mouse users. AppShell’s record says an augmented value paints the elevated frame background, and AST-017 FR59 keeps fine-pointer appearance as it was; keeping the previous fine-pointer default and adding only the coarse-pointer transparent arm would avoid it.

Comment thread packages/core/src/AppShell/AppShell.tsx Outdated
<LayoutHeader padding={0} hasDivider={navHasDividers && hasTopNav}>
<LayoutHeader
padding={0}
hasDivider={navHasDividers && hasTopNav && !isTouchBar}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

isTouchBar comes from useTouchPresentation seeded with mobileNav.defaultIsMobile, so a server render with that hint has no divider (no data-divider in the markup) and a fine-pointer client adds it back after hydration. AST-094 FR13 wants the server and hydrating renders to produce the pointer presentation; a (pointer: coarse) style, as the background uses, conforms (DEC-6).

Comment on lines +1043 to +1049
{isAuto && (
<div
aria-hidden="true"
ref={scrollEdge.sentinelRef}
{...stylex.props(styles.scrollEdgeSentinel)}
/>
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The sentinel becomes the root’s first child, ahead of the skip link, in every auto shell; AppShell FR1 orders the root as the skip link, the Layout frame, then any drawer. It is absolutely positioned, so rendering it after the skip link keeps it where it is.

Comment on lines +238 to +239
const onScrollEnd = () => queueMicrotask(updatePromotion);
doc.addEventListener('scrollend', onScrollEnd, PASSIVE_CAPTURE);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This adds a capture scrollend listener on the document for every shell, which AST-094 FR24’s verification fails (“a per-instance document or window listener”). It is also the only end-of-scroll signal updatePromotion gets: where no scrollend fires, fingerScroll.ts ends the finger scroll on its 150 ms fallback without notifying, so the layer keeps will-change: opacity after the lift, the layer the header above says blanks the sticky header on a programmatic scroll back to the top.

* momentum is still running: `useFingerScroll`, over the gesture host,
* which ends at the scroller's `scrollend`). A scroll the program starts
* (`scrollTo`, a status-bar tap) switches it at once, with no compositing
* layer. That is a WebKit engine workaround: on iOS 26.2, while a composited

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AST-013 FR6 allows a narrow engine workaround “only for a reproduced defect with a regression fixture and a review or removal condition”; this one describes the iOS 26.2 repro but names no review or removal condition, and its tests pin the workaround in jsdom rather than reproduce the engine defect.

vjeux added 3 commits October 27, 2026 06:02
…s its divider with a coarse-pointer rule, and drops its layer where no scrollend fires

Review findings on meta#8142:

- With a mouse, a variant added by module augmentation painted a surface
  header. A page-scrolling shell now keeps each variant's own fill (none for
  an augmented one) and adds only the coarse-pointer transparent rule.
- The section divider was dropped through the resolver's guess, so a server
  render with `defaultIsMobile` lost it. It stays in the markup, and a
  coarse-pointer rule takes its width away on the touch bar.
- Where the browser sends no `scrollend`, the layer stayed promoted after a
  fling (re-checked only at a finger change). The scroller's scroll events
  now time a re-check 200 ms after the last one, past the finger-scroll
  watch's 150 ms spell.
- One document listener per effect: `scrollend`, or `scroll` where the
  browser sends none. This base has no shared input stream (it arrives with
  meta#8665's line); the effect moves onto it there.
- The WebKit workaround names its removal condition.

Red first: the five new cases fail on ae06884.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
…) into the NavigationStack bar look

# Conflicts:
#	packages/core/src/AppShell/AppShell.tsx
#	packages/core/src/AppShell/AppShellScrollEdge.test.tsx
#	packages/core/src/hooks/useScrollEdgeEffect.ts
#	packages/core/src/motion/useScrollEdgeEffect.test.tsx

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval waits on an engineering owner's decision. Under a finger, this pull request makes AppShell's pinned header transparent with no divider and fades in a veil on two springs. The current AppShell spec does not allow that (FR7's header fill and divider, FR1's root children), and spec:AST-094 leaves it to AppShell's own record. An engineering owner can settle it by updating packages/core/src/AppShell/AppShell.spec.md or ruling the touch bar out, and records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. The decision covers the touch header, its veil and denser alpha, its springs as roles, and whether existing callers keep a way back.

Whatever the decision, these need changes:

  • Land the stacked pull requests (#8320, #8336, #8076, #8066, #8562) on their own first: this diff carries 27,682 authored lines, and the touch bar alone is 2,346.
  • scripts/touch-support-bundle.test.mjs › "is absent from the root entry" fails on this head and needs amending here.
  • Replace the per-shell document listener in useScrollEdgeEffect (AST-094 FR24), and fix the changeset's theme-colour claim and the dense doc's iOS-only wording.
  • Add real-device iOS Safari and Android Chrome evidence for the WebKit workaround, and commit its fixture.

[Automated review]

updatePromotion();
}, PROMOTION_RECHECK_MS);
};
doc.addEventListener(scrollType, onScrollEvent, PASSIVE_CAPTURE);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Each instance of this hook adds its own capture listener on document, which spec:AST-094 FR24's check fails ("a per-instance document or window listener"). The shared finger-scroll watch already detects the end of a finger's scroll; taking that end through the gesture host would keep one listener however many shells mount.

'@astryxdesign/core': patch
---

[feat] AppShell: under a finger (one touch model on every touch device), when the page scrolls (`height="auto"`, or `height="adaptive"` on a touch device), the pinned header looks like an iOS 26 bar. It paints no background of its own and draws no divider. Once the content has moved more than 10px under it, a veil of the header's colour fades in at its top on iOS's measured spring (0.29 s): strongest at the top, gone just below the header. It fades out (0.51 s) when the content comes back. A scroll the program drives (`scrollTo`, a status-bar tap) switches the veil at once instead: on iOS 26.2 a fade that starts on such a scroll makes WebKit drop the header's items for a frame or two. Under Reduce Motion the fades are the animator's 200 ms cross-fade. Where the browser supports `prefers-reduced-transparency` (Safari 26.2 does not yet), Reduce Transparency makes the veil an opaque band ending at the header's bottom edge. With a mouse nothing changes. The springs and the veil's shape are internal measured constants; the veil takes the header's theme colour.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"the veil takes the header's theme colour" does not hold: the veil paints --color-background-body or --color-background-surface. A theme that paints app-shell-header, such as the probe theme, keeps an opaque header under a finger and gets a body-colour band below it.

banner: 'slot for system-wide announcements above topNav',
height:
'fill=viewport 100dvh w/ independent scroll; auto=content-driven w/ sticky nav',
'fill=viewport 100dvh w/ independent scroll; auto=content-driven w/ sticky nav; adaptive=fill w/ mouse, auto on touch (page scroll); root data-scroll-owner=content|document; iOS touch+page scroll: header has no background, iOS 26 scroll-edge veil fades in past 10px of content under it (elsewhere opaque)',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"iOS touch+page scroll … (elsewhere opaque)" limits the bar to iOS, but it applies under any coarse primary pointer, Android included, as the verbose height doc says. "coarse pointer + page scroll" would match.

Comment on lines +807 to +818
const scrollEdgeLayer = isAuto ? (
<div
aria-hidden="true"
ref={scrollEdge.layerRef}
{...stylex.props(
styles.scrollEdge,
barFillsWithBody
? styles.scrollEdgeFillBody
: styles.scrollEdgeFillSurface,
)}
/>
) : null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This veil is a decorative element with no role, and it renders in every auto shell, where it stays display: none with a mouse. architecture:component-style-authoring INV7 puts such decoration in a pseudo-element. Painting it as the header's pseudo-element (the animator drives pseudo-elements) and rendering the sentinel only while the bar is on would leave mouse shells' DOM unchanged.

@vjeux

vjeux commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in 4fe659b, red first (the five new cases fail at ae06884):

  • A page-scrolling shell keeps each variant's own mouse fill (none for a variant added by module augmentation) and adds only the coarse-pointer transparent rule.
  • The section divider stays in the markup, and a (pointer: coarse) rule takes its width away on the touch bar, so a server render with defaultIsMobile is right for either pointer.
  • Where no scrollend fires, the scroller's scroll events time a re-check 200 ms after the last one, past the finger-scroll watch's 150 ms, so a fling no longer leaves the layer promoted.
  • Each shell keeps one document listener: scrollend, or scroll where the browser sends none. This base has no shared input stream yet; the FR43 follow-up moves the hook onto it.
  • The header names the WebKit workaround's removal condition: once the plain-HTML repro no longer drops the header's items on a programmatic scroll over a composited layer, checked on each iOS release.

The description answers the stacked bases and the root-entry red (#8671).

@cixzhang cixzhang closed this Oct 28, 2026
@cixzhang cixzhang reopened this Oct 28, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf: closed and reopened only to restart this PR's CI on the current workflow after tonight's queue-wide cancel; nothing in the PR changed.

@vjeux
vjeux marked this pull request as draft October 29, 2026 22:31
cixzhang pushed a commit that referenced this pull request Oct 30, 2026
…nothing else does (#8671)

## Why

Every pull request that gives a component a gesture fails `test-node` once merged with main, and the failure names no component: `scripts/touch-support-bundle.test.mjs` requires Core's root and hooks entries to carry no gesture code. At least six open pull requests (#8142, #8190, #8337, #8159, #8098, #8658) fail it this way.

## What led to it

This comes from the work to make Astryx's touch components behave as native iOS ones do. Since #8465, a component that uses a gesture imports the touch modules directly (`architecture:react-component-runtime` INV13), and the root entry re-exports every component, so it carries gesture code as soon as one component does.

## Options and tradeoffs

- Exempt the root entry: unblocks everyone, but stops catching a component that pulls gesture code it does not use.
- Check each public import on its own: catches exactly that, at the cost of a list of the imports allowed to carry gesture code.

## Why this choice

The per-import check keeps INV13's promise, a component without gestures ships none of their code, while letting gesture users through by name. It was offered on #8562 and aimed at main's test.

## What changes

- Each public import of Core is built the way the size report builds it, and may carry gesture code only if `GESTURE_USERS` names it. A failure lists the import, its gesture modules with their sizes, and the chain of imports that brings them.
- The root entry may carry only what a named import carries; the utils entry stays gesture-free.
- A strict case keeps Button and TextInput free of gesture code whatever the list says.
- `GESTURE_USERS` starts empty, so every import stays as strict as on main. The pull request that gives a component a gesture adds that component's import, and each import that reaches it, with a comment naming the gesture, so the new gesture user shows up in review.

## How to check it

1. Run `pnpm exec vitest run --project node scripts/touch-support-bundle.test.mjs` on main with this branch merged: it passes.
2. On a tree whose component uses a gesture, run it without naming that import in `GESTURE_USERS`: the test fails and names that import and the chain that brings the gesture code. Name it, and the test passes.
3. Import a gesture module from Button: the strict case fails.

## Evidence

- With the list empty, the test passes on main: no public import carries gesture code today.
- On open trees that give a component a gesture (AppShell's scroll-edge bar, Slider, the List reorder), the per-import case fails naming exactly those imports and their chains, and passes once each is named.
- No product code changes.

## Scope

- [x] No intended public API, product behavior, visual direction, or policy change.
- [x] Product changes discovered during the work were removed or split.
- [x] Public text and artifacts contain no internal Meta context.

This branch was successfully deployed

1 active deployment
Preview — 4fe659b5 Deployed Oct 27, 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants