Skip to content

test(storybook): run the story-tree check where Storybook is built, and bring the tree back to its shape - #8509

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/story-tree-in-ci
Oct 31, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/story-tree-in-ci

Conversation

@vjeux

@vjeux vjeux commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

apps/storybook/.storybook/story-tree.test.ts holds the story tree to the shape apps/storybook/README.md documents. It reads the built index and skips without one, and no CI job ran it after building Storybook. It never failed a pull request, so on main it fails 2 of its 5 cases wherever a Storybook build exists: 37 titles sit outside a package and 8 are nested too deep.

Intended invariant

The README's tree is <Package>/<Component>/…, <Package>/Hooks/<hook>, <Package>/Themes/<theme feature>. Two kinds of stories the repository depends on had no home in it:

  • The accessibility contract fixtures (A11y/…, a11y/…). The a11y audit opens these test fixtures by story id (.github/scripts/lib/a11y-story-identity.js, *.a11y.states.ts, the a11y browser specs), so moving them under a package would change every id.
  • Lab/ChartTheming/*: one feature in four renderers. It's the same sub-grouping the test already allows for Chrome and 3DChart.

Change

  • build-storybook runs the check right after the build, in about 5 s, so a title outside the tree fails the pull request that adds it.

  • The convention gains:

    • A11y as the fixtures' root, compared without case because Storybook ids lowercase titles;
    • ChartTheming as a sub-group;
    • Internationalization as a non-component group.

    The README and the test say so.

  • Four titles move into the tree:

    • Core/Icon/Size Theming → Core/Themes/Icon Size. The meta id keeps the story ids the visual baseline keys.
    • Core/Markdown/Plugins/Heading links → Core/Markdown, story "Heading links". Its browser spec follows the new id.
    • Core/SideNav/Collapse Ownership → Core/SideNav, story "Collapse ownership".
    • Foundations/Internationalization/Date consistency → Core/Internationalization/Date consistency.

Evidence

  • Failure before the change: on main's build, the new CI step exits 1 (2 of 5 cases).
  • Success after the change: 5 of 5. With an injected Components/Stray probe story, the step exits 1 and names it.
  • Product/runtime behavior verified unchanged:
    • every a11y fixture id (285) stays the same, as do both ChartTheming ids the play guard reads and the three Icon Size ids;
    • the CI-routing, a11y identity, a11y baseline and visual-gate tests pass;
    • the Heading links browser spec passes on its new id.

Scope

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

Testing

@vercel

vercel Bot commented Oct 26, 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 30, 2026 11:32pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 30, 2026, 11:46 PM UTC

@github-actions

github-actions Bot commented Oct 26, 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

Markdown (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) 616B 616B 0B
Lines of Code 8700 8700 -
Complexity Very High Very High (289) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/Markdown 146.5KB 146.5KB 0B 18.0KB 18.0KB 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.

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 35.6KB 35.6KB 0B

Accessibility Audit

Status: The accessibility audit did not run on this pull request. It runs after merges to main and before each release; pull requests that touch components run it with the ci:heavy-lanes label.


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

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

@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.

Recommending approval: the story-tree check now runs in the existing build-storybook job after the build, adding no new required check, and the four title moves keep every story id the accessibility audit, play guard and visual baseline rely on. The description's evidence holds: against the base tree's Storybook index the check fails 2 of its 5 cases, on this head it passes 5 of 5, and an injected stray title fails it by name. No changes are needed; for awareness, three Storybook URLs change (Heading links, Collapse ownership and Date consistency), and Date consistency now has two stable visual shots that the visual report lists as added until a reviewed baseline update records them.

[Automated review]

…nd bring the tree back to its shape

story-tree.test.ts reads the built Storybook index and skips without one, and no CI job ran it after building Storybook, so titles drifted: on main it fails 2 of 5 cases with a build. build-storybook now runs it right after the build. The convention gains A11y as the root of the accessibility contract fixtures (compared without case; Storybook ids lowercase titles), ChartTheming as a sub-group and Internationalization as a non-component group. Four titles move into the tree; Icon Size keeps its baselined story ids through the meta id, and the Heading links browser spec follows its new id.

@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.

Recommending approval: the story-tree check now runs inside the existing build-storybook job right after the build, adding no new required check, and the four title moves keep every story id the accessibility audit and visual baseline rely on. Against main's Storybook index the check fails 2 of its 5 cases; on this branch, and on this branch merged into main, it passes 5 of 5, and injected stray titles fail it by name. No changes are needed; for awareness, three Storybook URLs change (Heading links, Collapse ownership and Date consistency), and Date consistency now owns two stable visual shots that the visual report lists as added until a reviewed baseline update records them.

[Automated review]

cixzhang pushed a commit that referenced this pull request Oct 31, 2026
<!-- Template: other.md (internal infrastructure: nothing is exported). -->

Section 2 of the merge plan: #8061 → #8071 → #8076. One commit on main holding only this change.

## Primary intent

Complete the internal gesture system's recognizer set with UIKit's other recognizers that a component uses: swipe (Slider), pinch (Lightbox's zoom) and screen-edge pan (NavigationStack's back swipe). Rotation and hover, which no component uses yet (and rotation's threshold is unmeasured), land with their first users.

## User or maintainer impact

Sliders, lightboxes and back-swipe edges each need a recognizer, and today they would hand-roll one. These follow UIKit's classes, so each component gets the same thresholds and conflict rules. For example, an edge pan that the inner pan requires to fail delays nothing outside the edge band.

## Problem and solution fit

- Why does it happen? Two-finger and edge gestures exist only as one-off handlers, or not at all.
- Why does that hurt? Pinch and swipe would feel different in every component that adds them.
- Why does it matter? Parity covers the whole recognizer set, not only taps and pans.

Deltas:

- `SwipeGestureRecognizer`: recognized during the motion; one or more directions; fingers.
- `PinchGestureRecognizer`: scale measured from the starting span moved by the hysteresis, so it does not jump; settable scale; velocity in scale per second; focal point. The page keeps pinch-zoom wherever no pinch recognizer is attached.
- `ScreenEdgePanGestureRecognizer`: the leading or trailing edge, resolved against the writing direction; a touch outside every band fails at touch-down, so nothing waits on it there. Attached to an element that lies within the band at its edge, a pan takes the horizontal axis and an in-band touch decides at UIKit's 15 px; on any other element it leaves the browser every touch behavior and decides at FR19's 10 px (`spec:AST-094` FR18, DEC-22). The sides its edges resolve to under the view's writing direction and that answer are measured together, once, for the element's `touch-action` and the touch-down decision alike, and again when the host reports a layout change, which re-derives `touch-action` (FR19), or when a touch-down finds the view's writing direction switched in place, so a `leading` back swipe follows a switch to RTL (`design:bidirectionality` DR13); that touch landed under the `touch-action` from before, so it decides at FR19's 10 px unless that one claimed the axis. It is a finger's only: a mouse, a trackpad or a pen never starts it (FR43). Top and bottom edges, which no component uses yet, land with their first user.
- Their conflicts in the arena: pinch with pan simultaneously (on request), pinch against pan without permission, edge pan against inner pan, swipe against pan, delayed delivery to the view.

## Authority

`spec:AST-094` (current). Thresholds come from `motion/uikit/gestures.ts` with their sources.

## Change and evidence

Read from UIKit's recognizers in a reference app on the iOS 26.2 simulator and confirmed with HID touches:

- pinch hysteresis 8 pt; scale at `.began` = span ÷ (initial span ± 8), for example 144 / 128 = 1.125 from 120;
- swipe minimum 50 pt along, at most 50 pt across, within 0.5 s, recognized during the motion;
- screen-edge band 40.2 pt on a 402 pt wide screen, with a 15 pt hysteresis.

## Scope

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

## Testing

Local gates at ab509ed, one commit on main 257380d holding only this change (12 files, +1,522/−18):

- `pnpm test:ui` (core UI): 658 files, 16,506 tests passed.
- `pnpm exec vitest run --project node`: 806 files passed; the only failures are main's own story-tree and release-cache reds, tracked in #8509 and #8520, and its single-bundle case, which bundles Core's build and passes once that build is fresh.
- `tsc --project packages/core/tsconfig.json --noEmit`, strict ESLint and Prettier on every changed file: clean.
- `pnpm check:repo`: clean.
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
#9064)

## Maintainer impact

`LightboxViewport.a11y.browser.spec.ts` checks that the open viewer declares `height: 100dvh` by reading the page's stylesheets. Each sheet's walk sat inside an empty `catch`, meant for a cross-origin sheet whose rules a page can't read. That catch swallowed every other error too, so a same-origin sheet that failed to read was skipped in silence: the proof could pass on CSS it never read, or fail on a missing `100dvh` that hid the real error.

## Intended invariant

The proof's claim is unchanged: the open viewer declares `height: 100dvh`, so Safari's toolbar can't cover its caption (#8732). Only how it skips an unreadable sheet changes.

## Change

The walk now skips only a sheet whose `href` resolves to another origin, and reads every other sheet with no `catch`, so any other error fails the proof. One test file and no product code, so no changeset.

Found while auditing the Lightbox proofs for catch blocks that could hide a failure. Prior art: no open pull request touches this spec (searched open pull requests for `LightboxViewport`, `cross-origin stylesheet` and `styleSheets catch`).

## Evidence

- Failure before the change: with a read error injected into each same-origin sheet that lacks the `100dvh` rule, the spec on main passes; injected into every sheet, it fails on "expected [] to contain '100dvh'" rather than on the error.
- Success after the change: both injections fail on the injected error, and without one the spec passes 2 of 2 in Chromium and in WebKit.
- Product/runtime behavior verified unchanged: test-only change; the UI and node suites pass as on main.

## 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.

## Testing

Local gates at fd830f7 (on main d73908f):

- `pnpm check:repo`, `pnpm typecheck` (0 errors), ESLint and Prettier on the spec, the root build and the Storybook build pass.
- `pnpm test:ui`: 16,446 tests pass. `pnpm test:node`: 14,502 pass; its 4 failures, in `story-tree.test.ts` and the release `cache.test.mjs`, are independent of this change (#8509, #8520).
- The spec passes 2 of 2 in Chromium and 2 of 2 in WebKit; the injection runs above are in Chromium.
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Oct 31, 2026
@cixzhang
cixzhang marked this pull request as ready for review October 31, 2026 01:57
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
…wins over touch defaults (#8298)

<!-- Template: maintenance.md (an internal resolver; no behavior change until a component reads it). -->

Small batch of the merge plan: one commit on main holding only this change. Its paragraph for the gestures README waits for that README, which comes with #8076; the resolver's file header carries the same contract.

## Maintainer impact

A component that behaves differently under a finger, such as a menu that tracks the finger or becomes a sheet, must still let a caller pin the desktop behavior. Today components read `presentation ?? 'popover'`, which cannot tell an omitted prop from an explicit `'popover'`, so a component that adopts a touch default would override a caller who asked for the popover. The menu, context menu and picker work that adopts touch modes builds on this resolver (#8104, #8627, #8080, #8125, #8201, #8159, #8162).

## Intended invariant

A caller's explicit `presentation` always wins over the touch default (`architecture:public-component-api` INV16), and the surface equals `useAdaptivePresentation`'s for every value on every device, so no caller sees a change:

| `presentation`                  | surface                                       | touch input modes |
| ------------------------------- | --------------------------------------------- | ----------------- |
| `'popover'`                     | popover                                       | never             |
| `'bottom-sheet'`                | sheet                                         | under a finger    |
| `'adaptive'`                    | sheet on a compact touch screen, else popover | under a finger    |
| omitted, `whenOmitted: 'touch'` | popover                                       | under a finger    |

The modes follow the pointer, never the platform. The server and hydrating render never present touch modes, and no hint changes that (`spec:AST-094` FR13). The hook listens only to the queries a request reads (`architecture:react-component-runtime` INV5): none for a pinned `'popover'`, the pointer for `'bottom-sheet'` and the omitted `'touch'` default, and the pointer and compact size for `'adaptive'`. A touch-mode style is applied through `touchModes`, never nested under the iOS-only `@supports` gate.

## Change

- `utils/presentation.ts`: `usePresentation` and `readPresentation` (and the pure `resolvePresentation`) return the surface to render and `touchModes`, whether the component's touch input modes apply; `usePresentation` subscribes to each media query only while the request reads it. Internal: no component reads it yet.
- `hooks/useAdaptivePresentation.ts`: its header points a component that also switches input modes to `usePresentation`, whose surface is its own.

## Evidence

- Failure before the change: an omitted `presentation` and an explicit `'popover'` resolve the same, so a touch default cannot tell them apart; a server render given a touch hint must still answer the popover with no touch modes, a case that failed first. On an iPhone, a resolver that seeded its server snapshot from the live window fails both the server-render case and the `hydrateRoot` case; listening to both queries for every value fails the subscription case. A resolver that gives `'adaptive'` the sheet without the coarse pointer, or reads compact by width only, fails the surface matrix; one that ignores the theme's `md` fails the themed case.
- Success after the change: the unit matrix (iPhone, iPad, Android, desktop, Mac Safari, a fine-pointer narrow window, a phone in landscape, and the 767/768 and 499/500 compact edges, plus `'adaptive'` under a theme whose `md` is 1000) covers each row above, a live pointer change and the one-moment read; on an iPhone, the server render and the hydrating render answer the popover with no touch modes, and after hydration the phone's sheet with touch modes; each request holds only the subscriptions it reads.
- Product/runtime behavior verified unchanged: every value renders `useAdaptivePresentation`'s surface on every device, and no component reads the resolver yet.

## 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.

## Testing

Local gates at 9f0595f, one commit on main d73908f holding only this change (4 files, +571/−1):

- `pnpm test:ui` (core UI): 654 files, 16,459 tests passed.
- `pnpm exec vitest run --project node`: 804 files passed; the only failures are main's own story-tree and release-cache reds, tracked in #8509 and #8520.
- `tsc --project packages/core/tsconfig.json --noEmit`, strict ESLint and Prettier on every changed file: clean.
- `pnpm check:repo`: clean.
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
<!-- Template: maintenance.md -->

Small batch of the merge plan: one commit on main holding only this change.

## Maintainer impact

Core spells the touch presentation's media queries as literal StyleX keys across its style files. If one spelling drifts from the resolver's query, that style silently stops applying on phones, and nothing fails.

## Intended invariant

Every literal touch, compact and iOS-gate key in Core is the resolver's query (`spec:AST-094` FR13, `spec:AST-012` FR9), and the press paint keeps outranking the coarse-pointer `:active` reset. No style file changes.

## Change

- `utils/touchPresentation.stylex.ts`: `touchKeys`, the reference spellings, internal to Core (`spec:AST-017` FR21, DEC-27). Style files keep their literal keys: an imported key compiles to a different StyleX priority than the same literal (6000 against 3200) and would reorder the cascade. The iOS gate is only for the one style iOS WebKit itself requires, the 16 px input floor.
- `utils/touchPresentation.test.ts`: `touchKeys` equals the resolver's queries; no touch or Reduce Motion key in Core is a computed key; every quoted at-rule key in Core that names the pointer, the touch callout or a compact size, or that is within three characters of a reference spelling, is that spelling or a query the presentation does not decide; every iOS gate and compact-touch key is spelled and nested as the resolver.
- `utils/pressPaintPriority.test.ts`: in the compiled CSS, the press paint ranks above the coarse-pointer `:active` reset.
- `TabList/__tests__/TabPressPointer.interaction.browser.spec.ts`: under a fine pointer, a Tab's pressed overlay differs from its settled hover paint; under a coarse pointer, a finger's press marks the tab (`data-astryx-press="on"`) and paints the layer's background image, and with the tab forced into `:active` the color layer stays transparent. Chromium only: it holds a finger and forces `:active` through the DevTools protocol. Core declares the interaction harness as a dev dependency for it, its first Core user.
- `utils/touchPresentation.ts`: its header says why the keys are literal and names `touchKeys`.

## Evidence

- Failure before the change: switching the keys to an imported `defineConsts` key moved the coarse-pointer `:active` reset above the press paint, and WebKit lost the touch-down paint; on that head `pressPaintPriority.test.ts` failed, and the computed-key test failed on 102 sites. Changing one literal key by one character fails the drift test, which names the file. Removing Tab's `:active` overlay and its press image fails the browser proof's fine case (the press stays at the 5% hover paint) and its finger case (no image); removing only the coarse `:active` reset fails its reset case (10% instead of transparent).
- Success after the change: the tests and the browser proof above pass.
- Product/runtime behavior verified unchanged: no style file or query changes; the only runtime file touched is a comment.

## 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.

## Testing

Local gates at ea9fbf5, one commit on main d73908f holding only this change (8 files, +442/−4):

- `pnpm test:ui` (core UI): 654 files, 16,450 tests passed.
- `pnpm exec vitest run --project node`: 804 files passed; the only failures are main's own story-tree and release-cache reds, tracked in #8509 and #8520.
- `TabPressPointer.interaction.browser.spec.ts` on a built Storybook (`playwright.interaction.config.ts`): Chromium 2 passed, and each case failed on a Storybook built with its behavior removed; WebKit skips it, since only Chromium holds a finger and forces `:active` through the DevTools protocol.
- `pnpm install --frozen-lockfile` agrees with the lockfile; `tsc --project packages/core/tsconfig.json --noEmit`, strict ESLint and Prettier on every changed file: clean.
- `pnpm check:repo`: clean.
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
…ns (#8196)

## User impact

Part of making Astryx match iOS, whose progress indicators keep moving while busy. Progress usually arrives while the page is busy, and the fill then freezes and jumps (Chromium, Safari), so the work looks stuck. Now it keeps sliding.

## Problem and solution fit

The fill animated `width`, laid out and painted on the main thread every frame, so a busy page stalls it.

Options:

- Keep `width`: the freeze stays.
- `scaleX` on a full-length fill: compositor, but it stretches the round ends.
- `translateX` of a full-length fill in a clipping track: compositor, round ends. Costs: a tiny fill's end follows the track's curve; a runtime direction flip sweeps the fill across.

This PR takes the third; [cixzhang decided to keep it](#8196 (comment)).

## Expected behavior and authority

`component:ProgressBar`'s targets are unchanged; #6248 moved the marks out of the track, so it can clip. Under Reduce Motion a new value lands at once (`design:reduced-motion` DEC-3).

## Smallest restoration

`ProgressBar.tsx`: the fill transitions `transform` instead of `width`, on the theme's duration and easing; the track clips; the fill mirrors by its own direction. Forced colors keep the width geometry, so the outline stays whole (`architecture:theme-tokens` INV11). No API change.

## Evidence

- iOS simulator, 10 → 90 during a 0.7 s busy script; main (above) freezes at 41%, then jumps:
  ![The fill frozen on main and moving with this PR through the block](https://raw.githubusercontent.com/vjeux/astryx/3134c99c1e4bc50472d453305679242079bb41c3/progressbar-busy.ios-sim.gif)
- Unchanged: an ordinary change, and right to left:
  ![An ordinary change on main and with this PR](https://raw.githubusercontent.com/vjeux/astryx/0fd2ba99fb8619e17ae3b822e02e8cc7cc3f06f5/progressbar-ordinary.ios-sim.gif) ![The fill moving right to left](https://raw.githubusercontent.com/vjeux/astryx/e5923ba312a2fbb63b4c15affa264eb9169ae39c/progressbar-rtl.ios-sim.gif)
- Small values, before above:
  ![Small values before and after](https://raw.githubusercontent.com/vjeux/astryx/14224ce2b930315bfa47175ffaca8afa2fcf2d9d/progressbar-small-values.chromium.png)

## Scope

- [x] One defect is restored.
- [x] Separable contradictory or unsettled tagalongs were removed or split.
- [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
- [x] Public text and artifacts contain no internal Meta context.

## Testing

What I ran and what it showed:

1. In the ProgressBar story at 10, this console line (preview frame) sets 90 and blocks the page 0.7 s: `__STORYBOOK_ADDONS_CHANNEL__.emit('updateStoryArgs', {storyId: 'core-progressbar--default', updatedArgs: {value: 90}}); setTimeout(() => { const end = performance.now() + 700; while (performance.now() < end); }, 30);` `main` freezes, then jumps; this PR keeps sliding, with no per-frame layout or paint. iOS simulator: the same (above).
2. Chromium tests: the edge at the value in both directions, a 2% fill following the track's curve, a closed forced-colors outline, and an immediate change under Reduce Motion. The busy-page ones fail on `main`.
3. Local gates at f55c39b: root build, typecheck, ESLint, Prettier, Storybook, the ProgressBar Chromium tests (19) and `pnpm test:ui` pass, apart from failures known elsewhere: the rich-text race #8569 fixes, and #8509 and #8520 in the node project.
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
…uns (#8232)

## User impact

Part of making Astryx match iOS, whose progress indicators keep moving while busy. A CircularProgress given a new value on a busy page, as progress usually arrives, freezes, then jumps (Chromium, Safari), so the transfer looks stalled. Now it keeps moving, with the same timing, colors and geometry.

## Problem and solution fit

What led to it: the arc animates `stroke-dashoffset`, repainted on the main thread every frame.

Options:

- Keep the dash animation: the ring freezes.
- Animate a conic mask's angle: repainted every frame, like the dash.
- Layers the compositor turns (this PR): two clipped half-rings and two round caps, moved by Web Animations on the theme's timing. Costs: 16 elements instead of 3 (INV7); `stroke` still colors every part, but `stroke-width` and `stroke-linecap` no longer reach the drawing.

Only the third keeps moving.

## Expected behavior and authority

Apple: "Keep progress indicators moving." No CircularProgress record. The `circular-progress-fill` target moves to the fill's wrapper. Under Reduce Motion a change still sweeps over the theme's duration, as on `main`: Lab sits outside `design:reduced-motion`'s scope, so that stays as it is until the owner decides.

## Smallest restoration

`CircularProgress.tsx`, the determinate fill only; everything else, API included, is unchanged. A change releases its animations when it ends or unmounts.

## Evidence

- iOS simulator, 10% → 90% during a 0.7 s busy script; main left, this PR right:
  ![The ring frozen on main and moving with this PR through the block](https://raw.githubusercontent.com/vjeux/astryx/dd48f6baf80bc1245f94cd638e0e2d7709c00897/circular-busy.ios-sim.gif)
- A change arriving mid-way turns back from where the arc is:
  ![A change to 40% arriving while 10% → 90% runs](https://raw.githubusercontent.com/vjeux/astryx/cadcedb7988a6b06ab1fe43cd73ea469fe7a9263/circular-midway.ios-sim.gif)
- At rest, the stroked circle (top) and the layers:
  ![Stroked circle and ring at rest](https://raw.githubusercontent.com/vjeux/astryx/381a8b58fced4bc77e3cead9a0710f774b3447be/circular-progress-parity.chromium.png)
- 20% → 80%, frame by frame:
  ![Ring moving frame by frame](https://raw.githubusercontent.com/vjeux/astryx/381a8b58fced4bc77e3cead9a0710f774b3447be/circular-progress-move.chromium.png)

## Scope

- [x] One defect is restored.
- [x] Separable contradictory or unsettled tagalongs were removed or split.
- [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
- [x] Public text and artifacts contain no internal Meta context.

## Testing

What I ran and what it showed:

1. The large ring on the iOS 26.2 simulator, 10 → 90 through a 0.7 s busy script: `main` holds one position, then jumps; this PR shows 14 positions, always one piece.
2. Chromium tests: no layout or paint while it moves, the same drawing as the stroked circle at ten values, one piece across 6 o'clock, the theme's duration and easing, under Reduce Motion too.
3. Tests for a lighter band at 6 o'clock when a shrinking change arrived mid-way; both failed before its fix.
4. Local gates at 25701d9: root build, typecheck, ESLint, Prettier, Storybook, the CircularProgress Chromium tests (16) and `pnpm test:ui` (16,463) pass; the node project fails only #8509's and #8520's known cases.
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
## User impact

A `Badge` holds a fixed height (`--spacing-5`, 20px in the neutral theme, or a theme's own, such as Butter's 30px). When its label's text grows with a larger text size, the label outgrows the pill: it spills out, and white text on a colored badge leaves the color behind and becomes unreadable.

## Problem and solution fit

- **Why it occurs:** the badge's height is fixed, while its label's line follows the text size.
- **Why it harms the task:** at larger text sizes a badge's status or count is clipped or unreadable.
- **Why that matters:** the readers who need larger text are the ones who lose the information.

A badge with a label is now never shorter than one line of that label (`min-height: 1lh`). The minimum doesn't bind at the default size, so nothing moves there; at larger sizes the pill grows with its label.

## Expected behavior and authority

`component:Badge` FR3: a badge is one line, and its label never escapes its container. WCAG 1.4.4 (Resize Text): text can grow without losing content.

## Smallest restoration

- `min-height: 1lh` on a badge with a label, while main's height stays: a theme's height (Butter's 30px included) holds at the default size.
- A color-only badge has no text to hold, so it keeps its size at every text size (`component:Badge` FR1).
- No width floor: a badge still shrinks and stays inside a crowded row or a cell narrower than one line. Earlier versions of this change with a minimum width broke that and changed color-only badges' size, so it went.

## Evidence

- Reproduction before the change: in the Badge "Larger Text" story, where the supporting text size is raised on a wrapper, labels spill out of their pills.
- Result after the change: each badge with a label grows to hold it, and color-only badges keep their size.
- Representative unchanged path: at the default text size every badge's geometry is exactly main's, under the neutral theme and under Butter.
- Regression test or other mutation-sensitive proof: `BadgeLargerText.a11y.chromium.spec.ts` fails 3 of its 10 cases with main's `Badge.tsx` (the badge growing with its label at 1.25rem and 2.5rem text, under the neutral theme and Butter) and passes 10 of 10 with this change.

iOS simulator, the Larger Text story, main's Badge above this pull request:

![Neutral badges, main above this pull request](https://raw.githubusercontent.com/vjeux/astryx/81a91fec1377e3e868b9a119ce62d7e3c585b7a0/ios-badge-neutral.png) ![Butter badges, main above this pull request](https://raw.githubusercontent.com/vjeux/astryx/81a91fec1377e3e868b9a119ce62d7e3c585b7a0/ios-badge-butter.png)

## Scope

- [x] One defect is restored.
- [x] Separable contradictory or unsettled tagalongs were removed or split.
- [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
- [x] Public text and artifacts contain no internal Meta context.

## Testing

Local gates at a774d6f (on main 9ee7457):

- `pnpm check:repo`, `pnpm check:changesets`, `pnpm typecheck` (0 errors), ESLint and Prettier on the touched TypeScript and Markdown files, the root build and the Storybook build pass.
- `pnpm test:ui`: 16,454 tests pass. `pnpm test:node`: 14,563 pass; its 4 failures, in `story-tree.test.ts` and the release `cache.test.mjs`, are independent of this change (#8509, #8520).
- `BadgeLargerText.a11y.chromium.spec.ts`: 10 of 10 in Chromium, twice.
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
… the gesture host (#8071)

<!-- Template: other.md (internal infrastructure: nothing is exported). -->

Behavior-module PR: gesture host, touch-action derivation, native scroll probe, haptics

Section 2 of the merge plan: #8061 (merged) → #8071 → #8076. One commit on main holding only this change. It absorbs #8072 (the gesture host), which closes with a link here, and #8665's serving of every pointer; their authors are credited with `Co-authored-by`.

## Primary intent

Connect the gesture system to the DOM. Three browser-facing helpers come first: the `touch-action` each element gets from its recognizers, what the native scrollers under a touch could still do, and UIKit's haptic feedback kinds on the web. On them, one host per document routes touches, pens and mice to the recognizers on the hit path and negotiates with the browser: a claimed touch never scrolls or clicks, and an unclaimed one behaves as without the system.

## User or maintainer impact

Components pick `touch-action` by hand today, and pinch-zoom is often switched off as a side effect, which breaks WCAG 1.4.4 (resize text) on phones. Whether a sheet's list "is at its top" ignores the browser's own rules (the `touch-action` chain, `overscroll-behavior`, RTL), so a pull can start a drag while the browser still scrolls. Haptics have no shared module.

Each touch component negotiates alone, and results drift: ghost clicks after swipes, pinches zooming the page, presses surviving a scroll. The host gives every component one measured negotiation. Known limit: a scroll that begins on a mid-gesture recognizer waits for a busy main thread (measured in iOS Safari; a passive listener loses every diagonal to the scroll).

## Problem and solution fit

- Why does it happen? Each component re-derives `touch-action`, the scroll probe and haptics, and negotiates each touch alone.
- Why does that hurt? Zoom is lost, drags fight scrolling, haptics are missing, and touches are lost or followed by clicks.
- Why does it matter? Safari honors a cancelled `touchmove` only before it scrolls, and the host negotiates every touch from these three answers.

Deltas:

- `touchAction.ts`:
  - what an element's recognizers leave the browser: the other axis for an axis-limited pan or swipe, `manipulation` for taps and long presses, nothing taken by a one-way or scroll-coordinating pan;
  - `pinch-zoom` kept unless a pinch recognizer is attached;
  - a long press also turns off the iOS callout and text selection;
  - `intersectTouchAction`: what both a derived value and an element's own value allow, so the host never widens the author's (`spec:AST-094` FR18, DEC-8).
- `nativeScroll.ts`: `canScroll(dx, dy)` and the distance to the edge along the scroll chain, honouring `touch-action`, `overscroll-behavior`, RTL `scrollLeft` ranges and shadow roots.
- `haptics.ts`: UIKit's feedback kinds through `navigator.vibrate`; in iOS Safari, the one haptic WebKit plays, a light impact when a real tap toggles a hidden `<input type=checkbox switch>` in the control's label. Script cannot fire it later (WebKit requires a trusted event), so there are no mid-drag haptics.
- `GestureHost`:
  - touch events for fingers (the cancelable channel), paired with their pointer events (Chromium sends no `touchmove` within its slop);
  - pointer events for mice and pens; per-target listeners;
  - claims: a non-passive `touchmove` listener only where a recognizer can claim a moving touch (not taps or press consumers), cancelling while one owns the touch;
  - `pointercancel`, a scroll, or an uncancelable move the browser could pan, as the browser taking the touch;
  - click suppression (a cancelled `touchend`, a one-shot swallower) and replay;
  - delegated consumers by attribute;
  - `pointerIdOf(touch)`: the pointer behind a held finger;
  - a mouse, a pen and a finger served alike (`spec:AST-094` FR19, FR43): where the primary pointer is coarse, page listeners while something enabled is attached; where it is fine, one passive `pointerdown` on each element that uses a gesture and page listeners only during a press, the click listener alone kept through the swallower's window (FR21, FR24); a right click, a pen's barrel button and a ctrl-click on macOS start no press; the pointer kind followed while anything is attached; an action group (`family:action-groups` FR5) served like every attachment;
  - under `inputMode: 'pointer-events'`, a finger tracked once from its pointer events, a scroll taking it only after its 10 px of travel, and a claimed finger's `touchend` cancelled too (FR21);
  - a finger on page content reaches the recognizers tracking another finger as one that began elsewhere;
  - the view's box for a screen-edge pan, and a resize of that box, or of the viewport for a pan whose band moves with it, reported to it, so its edge-zone answer and the touch-action derived from it follow the layout (FR18, FR19, DEC-22); one `ResizeObserver` watches only enabled edge pans, under every pointer, and adds no listener (FR24); a pan's new answer, as after an in-place switch of direction, moves the watch with it, so a `leading` pan moved onto the right edge has the viewport watched and the switch back drops it;
  - a detach, even one that leaves the element other attachments, re-syncs the host, so an element left with a disabled recognizer keeps no `pointerdown`, page listener or `ResizeObserver` (FR24);
  - recognizers told apart by their `kind` (`RecognizerKind`, which each recognizer reports), never by `instanceof` (`architecture:react-component-runtime` INV13).
- `touch-action` on attach for every pointer, never wider than the element's own: an inline value is intersected at once, except a CSS-wide keyword (`initial`, `inherit`, `unset`, `revert`, `revert-layer`), which names no value of its own and is read as an author rule is, as what it resolves to; otherwise the element is marked under a zero-specificity rule any author rule outranks, and the next frame reads the value in force and writes only what both allow (FR18, DEC-8). Restored on detach; the scroll probe on every touch.
- The gesture system's real-touch browser proof (`__tests__/browser/gestures.interaction.browser.spec.ts` with its fixture, under `playwright.interaction.config.ts` on a phone in Chromium and WebKit):
  - `touch-action` per element, claims and cancelled moves, click suppression, pinch, a second finger, a long press under a blocked main thread, the 10 px take on a pan's axis, a narrower author `touch-action`, and the screen-edge band in both writing directions;
  - a scroll under a held press taking it only once the finger is 10 px from where it landed: a still finger, 9 px and (7, 7) keep it, while 10 px and (8, 8) lose it (FR20);
  - a vertical drag on a passive control hands its press to the browser where the page can scroll, and where nothing can scroll the browser's `pointercancel` ends it (FR20; Chromium, as WebKit cannot scroll natively from injected touches);
  - a keyboard activation inside the click window after a claimed drag still clicks: the swallower passes a click whose `detail` is 0 (FR21);
  - under a fine pointer, a mouse drag and tap, a pen drag, and the page listeners a press adds and removes (FR43, FR24);
  - `build-fixture.mjs` writes the same fixture as a standalone page for Mobile Safari on the iOS simulator.

## Authority

`spec:AST-094` (current): FR14 (nested scrolling), FR18 (`touch-action`), FR19 (claims), FR20 (the browser taking a touch), FR21 (clicks), FR23 (haptics), FR24 (gesture work costs nothing where it is not used) and FR43 (gestures work for every pointer).

## Change and evidence

Measured in Mobile Safari 26.2 on the iOS 26.2 simulator, with HID touches:

- `touchmove` arrives from the first pixel;
- WebKit commits to a scroll at 10–11 px; cancelling from 8 px keeps the page still, and a flick's first `touchmove` is cancelable even 20–30 px out;
- a cancelled `touchend` stops the click and mouse events;
- claiming costs no delivery rate (median 17–20 ms apart, as passive);
- under `pan-y`, WebKit scrolls only drags steeper than about 2:1 to 3:1, once vertical travel reaches about 10 px; a 4:1 drag is never taken;
- `user-select: none` with `-webkit-touch-callout: none` stops a long-pressed link's preview and menu.

On the simulator the host passed a horizontal pan claimed over a scroller, a vertical drag left to it, no ghost click, a scroll-edge pull, a pinch on its element only, and a long press at exactly 500 ms. The tests check the derived `touch-action` for every recognizer combination, the scroll probe on nested scrollers with `overscroll-behavior` and RTL, the vibration patterns, the hidden switch staying out of layout, touch and assistive technology, and the host's claims, click suppression and takeovers. The partial-detach cases fail without the re-sync: the element keeps its `pointerdown`, the page its listeners, and an edge pan's box stays observed. The browser proof's FR20 case catches both of its mutants in both engines: a 9 px press slop fails its 9 px case, and a per-axis take distance fails its (8, 8) case. Its keyboard case fails in both engines when the swallower stops passing `detail === 0` clicks; of the two passive-control cases, ignoring a touch's `pointercancel` fails the one where nothing can scroll, and with no FR20 signal at all the one with room fails. The in-place switch case fails without the layout watch's re-sync, and an inline `touch-action: initial` or `inherit` was intersected into a write before the keyword fix.

## Scope

- [x] This PR has one primary intent.
- [x] Independently removable deltas were removed or split (press tracking, hooks and docs follow in later sections).
- [x] Public text and artifacts contain no internal Meta context.

## Testing

Local gates at cc1238a, one commit on main 4413083 holding only this change (28 files, +7,256):

- `pnpm test:ui` (core UI): 664 files, 16,616 tests passed.
- `pnpm exec vitest run --project node`, after building Core: 808 files passed; the only failures are main's own story-tree and release-cache reds, tracked in #8509 and #8520.
- The gesture browser proof (`playwright.interaction.config.ts`, a phone in Chromium and WebKit): Chromium 27 passed; WebKit 21 passed and 6 skipped (five need input WebKit's driver cannot send, and the pen case).
- Motion, hook and DropdownMenu interaction proofs on a built Storybook: Chromium 62 passed; WebKit 62 passed.
- `tsc --project packages/core/tsconfig.json --noEmit`, strict ESLint and Prettier on every changed file: clean.
- `pnpm check:repo`: clean.



Behavior-module PR: LOC split waived per maintainer rule.
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
…e it overflows (#8155)

## User impact

A keyboard user who tabs onto a Carousel's scroll area lands on an element with no role and no name, so a screen reader announces nothing. The same unnamed stop appears even when everything fits. The edge buttons hand focus here when their direction runs out (component:Carousel FR2).

## Evidence

Chromium, keys captioned: Tab rings the › button, a second Tab focuses the scroll area, → → → ← scroll it. Its ring is the browser's default outline.

![Chromium, keyboard only: Tab reaches the scroll area, the arrows scroll it](https://raw.githubusercontent.com/vjeux/astryx/136eab094dbb72fc2b8cdbeed5e447170c553ee6/carousel-scroll-area-keyboard.gif)

- Before: the binding's `scroller-keyboard` state failed `carousel.scroller.role-and-name`, recorded as a known failure. After: it passes 8/8 with no known failures, and axe reports 0 violations on every Carousel story.
- New unit tests fail without the change: the named group, the tab stop following overflow, and the tab stop following slides added, removed or grown with the box unchanged. Another pins the translated default name.
- In Chromium and WebKit, before the re-measure, a fixed-width carousel's tab stop went stale as its content changed, and Scroll right stayed disabled after a slide was added at the end; both follow now.

## Problem and solution fit

- The scroll area is `role="group"`, named like the carousel (the caller's `aria-label`, else the translated "Carousel"), so landing on it says where the user is.
- It is a tab stop (`tabIndex={0}`) only while its content overflows; while it fits it is `tabIndex={-1}`, which keeps the edge buttons' programmatic hand-off (FR2) working.
- The overflow is measured again when the content changes inside an unchanged box: `useScrollOverflow` now observes each child's box, children added or removed, and the container's class and style (`spec:AST-025` FR5). The edge buttons and fades, and TabList's fades, follow the same measure.

## Expected behavior and authority

`spec:AST-025` FR12: a viewport that takes keyboard scrolling joins the tab order only while it overflows, with a role and an accessible name; as #9088 states it, a `group` named by the component that owns it, the caller's label, else its translated default. `component:Carousel` FR2 names it the hand-off target, out of the tab order when the content fits.

## Smallest restoration

- Three attributes on the scroll area; `useScrollOverflow` also observes the content, with its API unchanged.
- `Carousel.doc.mjs` and the Carousel record's review table describe the new behavior; the binding's known failure is removed.
- Tab entry does not delegate to a first link or button (FR12's optional path); that needs #8111's shared delegation.

## Writing rubric results

R1 narration: a projection row called the gap pending; it now states the behavior. R2–R6: none.

## Scope

- [x] One defect is restored.
- [x] Separable contradictory or unsettled tagalongs were removed or split.
- [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
- [x] Public text and artifacts contain no internal Meta context.

## Testing

Local gates at a2184a1:

- `pnpm exec vitest run packages/core/src/Carousel packages/core/src/hooks/useScrollOverflow.test.tsx packages/core/src/TabList`: 5 files, 158 tests passed.
- `pnpm exec playwright test packages/core/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts`: 8 passed.
- `pnpm a11y:audit -- --components core/Carousel`: 0 violations, gate passed.
- `pnpm test:ui`: 16,462 passed. The node project: 14,563 passed; its only failures are `packages/cli/foundation/release/cache.test.mjs` (fixed by #8520) and `apps/storybook/.storybook/story-tree.test.ts` (#8509), unrelated to this change.
- Root build and typecheck, `CI=true pnpm lint`, `pnpm check:knowledge`, `pnpm check:changesets` and its coverage, the Storybook build, the interaction config (136 passed), `pnpm check:repo`, Prettier: clean.
- Size: 10 files, 321 lines added, 43 removed.

Sibling: #7906 and #8153 also edit Carousel.tsx; whichever lands second rebases.
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
…wing main region (#8111)

Siblings: #8066, #6314.

## Why

With `height="fill"`, a keyboard user can't scroll AppShell's main region when it holds nothing focusable: Tab skips it, so Page Down and the arrow keys do nothing. axe reports it as `scrollable-region-focusable`, a serious violation.

## What led to it

Part of the touch-presentations program's work on AppShell scrolling (`spec:AST-094`), alongside #8066, which changes which element scrolls. Main was only the skip link's `tabIndex={-1}` target, which Tab never stops on.

## Options and tradeoffs

- **Always make main a tab stop:** simple, but adds a stop even when main fits, and an extra stop before its first link.
- **A stop only while main overflows, with Tab entry moving on to its first link or button:** what `spec:AST-025` FR12 asks; it costs measuring main, which happens only with `fill`.

## Why this choice

The second follows FR12 and AppShell FR4: a viewport joins the tab order only while it overflows, and Shift+Tab skips it. A fitting main, and `height="auto"`, keep `tabIndex={-1}`. Only Tab focus draws main's ring, inset and following the surface's rounded corner; a click, the skip link or a script's focus draws none.

Main has no inner content box, so an observer internal to AppShell watches main's direct children; the public `useScrollableArea` is unchanged, and its one-element form is a separate draft that waits on AST-025 OQ1. The AppShell record states the observation (PR1) and the ring (FR4), and drops the gap this closes. Main's stop is named by its `main` role alone, which the FR12 ruling allows for the single main.

## How to check it

In Chromium, on the AppShell Playground story with `height="fill"` and 40 rows:

1. Press Tab until focus reaches main: a ring appears inside its edge, and Page Down scrolls it. Before, Tab left the page.
2. Add a link inside main: Tab lands on the link instead, and Shift+Tab from it skips main.
3. Click into main, or use the skip link: no ring.
4. Show fewer rows so main fits: main leaves the tab order.

## Evidence

Before (main) and after (this PR):

![main](https://raw.githubusercontent.com/vjeux/astryx/ac93708b7e1bbaa6be17a20c8f7fd61bf4b7bbe8/8111-kbd-main-v2.gif) ![this PR](https://raw.githubusercontent.com/vjeux/astryx/ac93708b7e1bbaa6be17a20c8f7fd61bf4b7bbe8/8111-kbd-pr-v3.gif)

Tab, then Shift+Tab, with a link inside; the ring: ![Tab, then Shift+Tab](https://raw.githubusercontent.com/vjeux/astryx/ac93708b7e1bbaa6be17a20c8f7fd61bf4b7bbe8/8111-kbd-link-pr-v3.gif) ![Focus ring](https://raw.githubusercontent.com/vjeux/astryx/ac93708b7e1bbaa6be17a20c8f7fd61bf4b7bbe8/8111-ring-v3.png)

- The browser test `AppShellMainKeyboard.a11y.browser.spec.ts` covers each step: 16 of 16 in Chromium, and 15 of 15 in WebKit, where the window-switch case is skipped.
- Tab onto main exposes the landmark: Chromium's accessibility tree shows the focused node as `main`, not ignored and unnamed, so its role is announced; WebKit computes the same role. The test fails on main (Tab never reaches main) and when main is given a name.
- AppShell's keyboard tests fail without the observer, or when a `fill`/`auto` switch doesn't restart it; each of the observer's 5 tests fails when its behavior is removed.
- Local gates at 7d439ae: core UI suite (655 files), build, type check, lint, Storybook, the keyboard spec in both browsers, knowledge records and changeset coverage pass; the node project fails only on `cache.test.mjs` and `story-tree.test.ts`, which #8520 and #8509 fix.

## Writing rubric results

- R1 narration: the PR1, FR4 and verification-map edits are present tense; the closed current-state gap is removed, and the glance row counts four gaps.
- R2 research: none in the record.
- R3 evidence: the new verification cells name test files, not changes.
- R4 rejected alternatives: none added.
- R5 change references: none.
- R6 open questions: none touched; AST-025 OQ1 stays open with its options.
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
…ry row it passes (#8483)

## User impact

With a mouse, dragging a picker wheel in the TimeInput, DateTimeInput or DateInput bottom sheet committed every row it passed while the button was still down. In DateInput, the calendar behind the month and year wheels changed under the hand: dragging Month two rows, March to May, committed May before the release.

## Problem and solution fit

What led to it: Astryx's UIKit-parity work lets a mouse drag the sheet wheels the way a finger does (`usePointerDragScroll`), and testing the sheets with a mouse showed the drag committing early.

- Why does it commit? The drag assigns `scrollTop` on every move, and Chromium ends each of those scrolls with its own `scrollend`: 14 moves, 14 `scrollend`s. The settle (`useScrollSettle`) commits on `scrollend`.
- Why doesn't the settle wait? It waits for a touch to end, and a mouse drag sends no touch events.
- Why does it matter? It sets a value the person hasn't chosen yet; under a finger the same wheel commits only at the release.

Options:

- **Ignore `scrollend` after a scroll set from script.** Narrow, but it depends on each browser's event order.
- **Commit at the release and skip the settle.** Simple, but loses the glide onto the nearest row and the rest rule.
- **Chosen: the settle waits while a drag holds the wheel,** as it waits for a finger, and the release starts it. One rule for both.

## Expected behavior and authority

`usePointerDragScroll` lets a mouse drag the wheel "the way a finger does", and `useScrollSettle` states the finger's rule: "A finger resting mid-drag is not rest".

## Smallest restoration

`usePointerDragScroll` exposes the drag state it already kept; `useScrollSettle` takes it and doesn't settle while it is true. `MonthScroller` is unchanged.

## Evidence

Chromium, phone-sized, DateInput "Native picker modes", the `adaptive-bottom-sheet` field: a mouse drags the Month wheel two rows, March to May, and holds.

| | main | This PR |
| --- | --- | --- |
| Button still down (0, 400, 900 ms) | May committed | March kept |
| After the release | May | May |

![Held 400 ms: main (left) has committed May; this PR (right) keeps March](https://raw.githubusercontent.com/vjeux/astryx/86a32cc1c98267594a68089f03143e62dc42217f/wheel-mouse-held-before-after.chromium.png)

## Scope

- [x] One defect is restored.
- [x] Separable contradictory or unsettled tagalongs were removed or split.
- [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
- [x] Public text and artifacts contain no internal Meta context.

## Testing

In Storybook, open DateInput › Native Picker Modes in a phone-sized window, with a mouse, and open the `adaptive-bottom-sheet` field:

1. Drag the Month wheel two rows and hold the button: the month stays March. Release: May commits.
2. Click a row: it commits at once. Scroll the wheel with the mouse wheel: it commits when it comes to rest. Both behave as on `main`.

Automated: the `DateInputTouch.test.tsx` case "commits nothing while a mouse drag holds the wheel, and commits at the release" fails on `main`.

Local gates at a77a79a: `pnpm test:ui` passes (653 files, 16,447 tests); `pnpm test:node` fails only on main's own story-tree cases (#8509) and release-cache cases (#8520); the Storybook build, the DateInput, TimeInput and DateTimeInput browser specs (75), root typecheck (no errors beyond main's) and `check:repo` pass.
@cixzhang
cixzhang merged commit d29fe0f into meta:main Oct 31, 2026
137 of 143 checks passed
@vjeux
vjeux deleted the uikit/story-tree-in-ci branch October 31, 2026 08:11
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
<!-- template: bug-fix.md -->

Sibling: #7516 (off-grid max). One change on `main`, with no dependencies.

## User impact

Found during the UIKit-parity work on Slider (`spec:AST-094`). A range Slider whose two thumbs share a value gets stuck. With both at the maximum, dragging down moves nothing; with both in the middle, a track press above them moves nothing. It happens with a mouse, a finger and a pen.

## Problem and solution fit

1. **Why it happens:** with equal values, a direct press keeps the upper thumb (#6380) and a track press takes the lower one, whichever way the pointer goes, and that thumb is clamped against its sibling.
2. **Why it matters:** coincident thumbs are a normal state, and in those directions no pointer path moves them; on `main` only a track press below them or a drag toward the maximum works.

Only one thumb can move toward a given value, so that thumb takes the press. A track press beside them picks the thumb on its side. A press on the thumbs waits for the pointer's first movement, whose direction picks the thumb, with its focus, pressed look and tooltip. A drag that passes the other thumb's value hands itself over.

## Expected behavior and authority

- `component:Slider` FR1 / AR1: two thumbs bound the range and never cross. `architecture:interaction-modality` INV4: every modality has an operable path. `design:user-states` DR4: the pressed overlay follows the dragged thumb.
- `component:Slider` FR6, added here: which thumb a press takes when both share a value, and the consequence that a drag coming back past the shared value moves the other thumb. It waits on the spec owner's approval. The alternative, keeping one fixed thumb, is what leaves a direction stuck.

## Smallest restoration

`Slider.tsx` only: the press and move handlers, and the value tooltip's `isOpen` during a drag. No new prop, style or visual. `Slider.spec.md` gains FR6 and its verification row.

## Evidence

![Coincident thumbs dragged down: main moves nothing; here the lower thumb follows](https://raw.githubusercontent.com/vjeux/astryx/2ff402db2ed766013b6da91447e73905d6cd4fe8/slider-8151-coincident.gif)

![Only the dragged thumb's tooltip stays open](https://raw.githubusercontent.com/vjeux/astryx/2ff402db2ed766013b6da91447e73905d6cd4fe8/slider-8151-tooltip.gif)

iOS 26.2 simulator, Mobile Safari, `main` over this branch.

## Scope

- [x] One defect is restored.
- [x] Separable contradictory or unsettled tagalongs were removed or split.
- [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
- [x] Public text and artifacts contain no internal Meta context.

## Testing

On a range Slider story, with a mouse or a finger:

1. Both thumbs at the maximum, drag down: the lower thumb follows (on `main`, nothing moves).
2. Both in the middle, press the track above them: the upper thumb moves there; below, the lower one.
3. Press on both thumbs and move: the direction picks the thumb; the other's tooltip closes.
4. Repeat step 1 in RTL: mirrored.

Local gates at 1115a21: root build, typecheck, lint, Prettier, `check:repo`, `check:knowledge`, the CLI isolation test (34/34), the Storybook build, Slider's Chromium accessibility suite (7/7), `pnpm test:ui` (16,465 passed), and the node project apart from `story-tree.test.ts` and `cache.test.mjs`, whose failures are known on `main` and have open fixes (#8509, #8520). "Coincident range thumbs" in `Slider.test.tsx` automates each step; with `main`'s `Slider.tsx`, 7 of its 11 cases fail, and the other 4 guard paths that already work, including a drag that began with a track press beside the thumbs, which stays on its thumb.

## Writing rubric results

- R1 narration: none; FR6 states the rule and its consequence in the present tense.
- R2 research: none.
- R3 evidence: FR6's basis is the current source and focused tests.
- R4 rejected alternatives: none added to the record.
- R5 change references: none.
- R6 open questions: none touched.
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
…t activating the control (#9089)

## User need

On a touch screen, a tap on a field label's info icon (`labelTooltip`) opens its help and also activates the label's control, because the icon sits inside the `<label>`. In Chromium with touch, a tap on the info icon of the "Nickname" label opens the help and focuses the field, which on a phone raises the keyboard. Beside a Switch, the tap that opens "Automatically save your changes as you work" also turns auto-save on. Asking what a setting does should not change it.

## Problem and solution fit

- **Why it occurs:** a tap anywhere inside a native `<label>`, the icon included, activates the label's control.
- **Why it harms the task:** the help and the activation arrive together, so reading about a setting changes it, or moves focus to a field the person did not choose.
- **Why that matters:** the person has to undo a change they never asked for, and may not notice it.

The icon's tooltip opens or closes on a tap (`touchTrigger="tap"`), and a tap by finger or pen stops at the help: its click does not go on to the label. A mouse click on the icon keeps native label activation, and hover still shows the help.

## Current specification

This is a caller-compatible behavior change that FieldLabel's DEC-1 decides, a patch `[feat]` under `spec:AST-017` FR7: a tap on the info icon opens the help without also toggling or focusing the control, the unintended second action FR9 removes. `component:FieldLabel` lets people "activate eligible controls from the complete visible label area"; this pull request amends that record with FR9 and DEC-1, which give a tap on the info icon to the help, and with the matching end-user impact, tooltip concept, compatibility and verification rows. The amendment needs the record owner's approval.

## Public delta and caller burden

- On touch, a tap on the info icon opens the help without focusing the field or toggling the control. Mouse, hover and keyboard behavior are unchanged.
- No prop, type, default, export or DOM change: callers decide nothing new.
- The changeset is a patch `[feat]` under `spec:AST-017` FR7; it names the old and new tap.
- The `labelTooltip` docs of FieldLabel (English and Chinese) and Field describe hover and tap.

## Design and alternatives

- The tap's label activation is cancelled only for a finger or a pen, the pointers whose tap opens the help. A mouse click keeps native activation, as FieldLabel's record requires.
- Rejected: cancelling every click on the icon, which stops a mouse click from focusing the field or toggling a Switch.
- Rejected: leaving the tap to the label, which activates the control as it opens the help.
- #8207 makes `touchTrigger="auto"` leave a tap inside a control to that control, a `<label>` included. With `touchTrigger="tap"`, the icon keeps its help on a tap under that rule, so this pull request lands first.
- #6414 gives the same icon an accessible name (FR8). Both edit the same `<Icon>` element, so whichever lands second keeps both props.
- FieldLabel takes the tap pointers from `useTouchTrigger` (`TOUCH_POINTER_TYPES`) and keeps the cancel under its own FR9. A Tooltip-level rule for every `touchTrigger="tap"` trigger inside a label belongs to the pending decision on which triggers open on a tap.
- Prior art: open pull requests searched for `FieldLabel`, `labelTooltip`, `label info icon` and `label activation`; only #6414 and #8207 touch this icon.

## Evidence

- Chromium, `Core/FieldLabel` States story, the Nickname field. With touch, on main a tap on the info icon opens the help and focuses the field; with this change it opens the help, and focus stays off the field. With a mouse, on both, hover shows the help and a click focuses the field. `FieldLabelTap.a11y.chromium.spec.ts` checks the tap and the click.
- Unit tests: a finger tap and a pen tap on the icon open the help and leave a checkbox unchecked, and a mouse click on the icon toggles the checkbox. With main's `FieldLabel.tsx`, the finger-tap and pen-tap cases fail; with every click on the icon cancelled, the mouse case fails.
- iOS simulator, main above and this pull request below: the tap opens the help, and on main it also turns the switch on.

![Label icon tap: main above, this pull request below](https://raw.githubusercontent.com/vjeux/astryx/cd41fc0a424748962ca543cb12e371b6bf8d9e30/ios-tap-label-icon.gif)

## Scope

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

## Writing rubric results

`FieldLabel.spec.md`:

- R1 narration: none; FR9 and DEC-1 state what the label does.
- R2 research in the record: none.
- R3 evidence naming a change: none; FR9's verification names its test cases.
- R4 rejected alternatives over one line or outside a decision: one, inside DEC-1, one line.
- R5 pull request or issue references remaining: none.
- R6 ruled open questions still listing options: none; OQ1 is unanswered and unchanged.

## Testing

Local gates at 0a6a60f (on main 560c666):

- `pnpm check:repo`, `pnpm check:knowledge`, `pnpm typecheck` (0 errors), Prettier and ESLint on the touched files, the root build and the Storybook build pass.
- `pnpm test:ui`: 16,474 tests pass. `pnpm test:node`: 14,585 pass; its 4 failures, in `story-tree.test.ts` and the release `cache.test.mjs`, are independent of this change (#8509, #8520).
- `FieldLabelTap.a11y.chromium.spec.ts`: 2 of 2 in Chromium, twice; 24 of 24 with Chromium pinned to two cores at 4 workers, and 40 of 40 pinned to three cores at 16 workers. With main's `FieldLabel.tsx` its touch case fails, because the tap focuses the field.
- `FieldLabelAudit.a11y.chromium.spec.ts`: 9 of 9 in Chromium, twice.

This branch was successfully deployed

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

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) 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.

2 participants