Skip to content

feat(lab): TabBar — the search cancel button's press, and the field's fall - #8248

Draft
vjeux wants to merge 2139 commits into
meta:mainfrom
vjeux:uikit/c15-tabbar-search-cancel
Draft

vjeux wants to merge 2139 commits into
meta:mainfrom
vjeux:uikit/c15-tabbar-search-cancel

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #8243.

Review only this PR's change: vjeux/astryx@c79ed7f...f85f937

User need

Part of matching Astryx's touch components to iOS 26, so apps built with it feel native on phones. On iOS the search Cancel button answers the finger: it grows while pressed and wobbles back on release. In #8243 it gives no feedback until the tap ends search, so a press feels missed. This adds the press, measured on iOS 26.2.

Problem and solution fit

  • Press: the circle under Cancel grows from 48 to 63.65 px on UIKit's spring.
  • Release: it shrinks back with UIKit's wobble (63.65 → 43.6 → 49.2 → 48), and the bar's glass grows back only once the wobble rests.
  • Core's press tracker follows the finger on Cancel only while Cancel shows.
  • Under Reduce Motion a press scales nothing.

Current specification

spec:AST-094 FR13, FR11 (Cancel follows the control profile: it highlights on touch-down and the browser's click activates it), FR8.

Public delta and caller burden

None. uikit.tabBar gains Cancel's pressed size and springs; internal/touch gains usePressTracker.

Size, gzip against #8243's head: TabBar's import 67.9 → 69.7 KB JavaScript, 1,980 → 1,980 B CSS.

Design and alternatives

  • Chosen: the circle's own scale on compositor springs, so a release while the press still grows turns from where it is, carrying its speed, as on iOS.
  • Rejected: CSS :active (main thread, no measured spring); a wrapper around the glass (one element per role).

Evidence

iOS 26.2 simulator: a 0.5 s hold on Cancel, before (#8243: no response) and after, with close-ups; then Android 15 Chrome.

iOS before
iOS after
iOS before, close-up
iOS after, close-up
Android

Scope

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

Stack: #8076 → … → #8320 → #8129 → … → #8222 → #8243 → this PR (with #8224 merged into #8243).

Testing

Try it: pnpm storybook, Lab › TabBar › Search Tab, on a phone.

  • Tap the search circle, then hold a finger on Cancel: the circle grows. Lift: it wobbles back and search ends.
  • With Reduce Motion, the press changes nothing and the tap still ends search.

Browser tests: a held finger grows the painted circle to UIKit's size; the lift wobbles it back, never below the measured 43.6 px, before the bar expands; under Reduce Motion it keeps its size. They run in Chromium only, since Playwright's WebKit turns a held finger into a long press with no click.

Passing: pnpm test:interaction TabBar, pnpm vitest run packages/lab/src/TabBar packages/lab/src/SearchField, pnpm typecheck, lint.

@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 30, 2026 2:13am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. 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, 2:31 AM UTC

@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

New Components

SearchField (@astryxdesign/lab) · View in Storybook
Metric Value
Entry File (ESM) 253B
Lines of Code 1399
Source Files 4
Complexity Very High (48)
Exports SearchField, type, type
Props Count N/A
Has Tests Yes
Has Stories Yes

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/AlertDialog 56.9KB 57.2KB +342B 12.4KB 12.4KB 0B
core/AppShell 57.9KB 58.2KB +289B 11.6KB 11.6KB 0B
core/AvatarGroupOverflow 39.9KB 40.3KB +353B 6.4KB 6.4KB 0B
core/Banner 47.8KB 48.1KB +336B 9.9KB 9.9KB 0B
core/BaseTypeahead 54.3KB 54.6KB +289B 9.9KB 9.9KB 0B
core/BreadcrumbItem 66.4KB 66.7KB +351B 11.0KB 11.0KB 0B
core/Button 43.3KB 43.6KB +322B 9.2KB 9.2KB 0B
core/Calendar 54.9KB 55.2KB +341B 10.0KB 10.0KB 0B
core/Carousel 50.2KB 50.6KB +363B 10.2KB 10.2KB 0B
core/ChatComposer 60.6KB 60.9KB +319B 10.8KB 10.8KB 0B
core/ChatComposerInput 55.7KB 56.1KB +315B 10.1KB 10.1KB 0B
core/ChatComposerTokenElement 55.7KB 56.1KB +315B 10.1KB 10.1KB 0B
core/ChatDictationButton 46.5KB 46.8KB +314B 9.5KB 9.5KB 0B
core/ChatLayout 48.8KB 49.1KB +319B 9.9KB 9.9KB 0B
core/ChatLayoutScrollButton 46.4KB 46.7KB +301B 9.6KB 9.6KB 0B
core/ChatSendButton 45.8KB 46.1KB +312B 9.2KB 9.2KB 0B
core/CheckboxInput 49.9KB 50.2KB +319B 9.3KB 9.3KB 0B
core/CheckboxListItem 54.0KB 54.3KB +294B 10.5KB 10.5KB 0B
core/ClickableCard 12.8KB 13.1KB +289B 6.9KB 6.9KB 0B
core/CodeBlock 60.5KB 60.8KB +326B 10.7KB 10.7KB 0B
core/Collapsible 11.7KB 12.0KB +291B 4.2KB 4.2KB 0B
core/CommandPalette 50.9KB 51.2KB +330B 11.8KB 11.8KB 0B
core/CommandPaletteItem 8.4KB 8.7KB +280B 3.5KB 3.5KB 0B
core/ComplexSelector 55.8KB 56.2KB +369B 10.6KB 10.6KB 0B
core/ContextMenu 77.7KB 78.1KB +325B 14.6KB 14.6KB 0B
core/ContextMenuItem 16.6KB 16.8KB +280B 5.2KB 5.2KB 0B
core/DateInput 99.9KB 100.2KB +292B 14.8KB 14.8KB 0B
core/DateRangeInput 69.4KB 69.7KB +315B 11.2KB 11.2KB 0B
core/DateTimeInput 110.1KB 110.4KB +299B 15.2KB 15.2KB 0B
core/DialogHeader 48.8KB 49.1KB +325B 9.8KB 9.8KB 0B
core/DrawerHeader 48.9KB 49.2KB +296B 11.2KB 11.2KB 0B
core/DropdownMenu 72.7KB 73.0KB +325B 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.4KB +317B 9.5KB 9.5KB 0B
core/FileInput 54.1KB 54.4KB +309B 10.3KB 10.3KB 0B
core/IconButton 43.3KB 43.6KB +320B 9.2KB 9.2KB 0B
core/Item 11.4KB 11.6KB +273B 4.7KB 4.7KB 0B
core/LayerProvider 63.3KB 63.6KB +335B 10.1KB 10.1KB 0B
core/Lightbox 51.2KB 51.5KB +295B 9.8KB 9.8KB 0B
core/Link 43.5KB 43.8KB +335B 7.6KB 7.6KB 0B
core/ListItem 53.5KB 53.8KB +318B 10.5KB 10.5KB 0B
core/Markdown 144.5KB 144.7KB +293B 17.4KB 17.4KB 0B
core/MobileNav 51.0KB 51.3KB +309B 10.1KB 10.1KB 0B
core/MobileNavToggle 46.2KB 46.5KB +308B 9.4KB 9.4KB 0B
core/MoreMenu 72.9KB 73.2KB +324B 14.7KB 14.7KB 0B
core/MultiSelector 76.2KB 76.5KB +319B 14.6KB 14.6KB 0B
core/NumberInput 55.7KB 56.0KB +325B 10.7KB 10.7KB 0B
core/Outline 28.6KB 29.0KB +335B 4.0KB 4.0KB 0B
core/Pagination 87.7KB 88.0KB +309B 15.3KB 15.3KB 0B
core/Popover 49.8KB 50.1KB +282B 12.1KB 12.1KB 0B
core/PowerSearch 155.1KB 155.4KB +314B 18.6KB 18.6KB 0B
core/RadioListItem 52.1KB 52.5KB +334B 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 +317B 15.0KB 15.0KB 0B
core/SelectorOption 14.5KB 14.8KB +251B 5.1KB 5.1KB 0B
core/SideNav 58.0KB 58.3KB +318B 10.6KB 10.6KB 0B
core/SideNavCollapseButton 46.6KB 46.9KB +286B 9.5KB 9.5KB 0B
core/SideNavHeading 54.7KB 55.0KB +297B 10.1KB 10.1KB 0B
core/SideNavItem 54.5KB 54.8KB +317B 10.1KB 10.1KB 0B
core/Step 32.4KB 32.7KB +326B 5.3KB 5.3KB 0B
core/Stepper 47.4KB 47.7KB +311B 9.6KB 9.6KB 0B
core/Switch 48.4KB 48.7KB +330B 9.3KB 9.3KB 0B
core/Tab 9.7KB 10.0KB +294B 4.1KB 4.1KB 0B
core/TabMenu 51.6KB 51.9KB +316B 10.0KB 10.0KB 0B
core/Table 84.0KB 84.3KB +302B 15.1KB 15.1KB 0B
core/TableCell 78.8KB 79.1KB +315B 14.8KB 14.8KB 0B
core/TableHeaderCell 78.6KB 78.9KB +323B 14.8KB 14.8KB 0B
core/TableSelectionToolbar 52.4KB 52.7KB +324B 11.2KB 11.2KB 0B
core/TextInput 53.5KB 53.8KB +331B 10.5KB 10.5KB 0B
core/Thumbnail 50.7KB 51.0KB +320B 11.0KB 11.0KB 0B
core/TimeInput 86.8KB 87.2KB +320B 13.8KB 13.8KB 0B
core/Timestamp 27.5KB 27.6KB +49B 9.5KB 9.5KB 0B
core/Toast 59.8KB 60.1KB +305B 9.7KB 9.7KB 0B
core/ToggleButton 44.1KB 44.4KB +291B 9.3KB 9.3KB 0B
core/Token 29.6KB 29.9KB +337B 4.5KB 4.5KB 0B
core/Tokenizer 64.8KB 65.2KB +358B 11.7KB 11.7KB 0B
core/TopNav 51.9KB 52.2KB +322B 10.4KB 10.4KB 0B
core/TopNavHeading 54.2KB 54.4KB +277B 9.9KB 9.9KB 0B
core/TopNavItem 9.0KB 9.3KB +283B 3.8KB 3.8KB 0B
core/TopNavMegaMenu 54.2KB 54.5KB +316B 10.8KB 10.8KB 0B
core/TopNavMegaMenuItem 9.1KB 9.4KB +281B 4.1KB 4.1KB 0B
core/TopNavMenu 53.6KB 53.9KB +306B 10.1KB 10.1KB 0B
core/TreeList 32.5KB 32.9KB +325B 4.7KB 4.7KB 0B
core/Typeahead 61.5KB 61.8KB +314B 11.3KB 11.3KB 0B
lab/SearchField N/A 58.4KB N/A N/A 1.2KB N/A
lab/TabBar N/A 69.7KB N/A N/A 1.9KB N/A
lab/TabBarItem N/A 5.4KB N/A N/A 1.9KB N/A
lab/TabBarMoreList N/A 55.5KB N/A N/A 2.0KB N/A
lab/TabBarSearchTab N/A 5.4KB N/A N/A 1.9KB N/A

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
@astryxdesign/lab 5.1KB 1.9KB 2.1KB +209B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 34.6KB 34.6KB 0B
@astryxdesign/lab 11.1KB 12.3KB +1.2KB

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

@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 owner decision before it can be approved: every change here rests on the draft AST-094 touch-presentations spec, whose two decisions (UIKit as the reference for touch, and recognizers with compositor-played releases) are still pending, and which proposes touch amendments to the current pressed-overlay rule (user-states DR1) and to scroll chaining (AST-025 FR14). An engineering owner records that decision by commenting /approve-spec followed by the full head SHA on this pull request; the author may do so if they are an engineering owner. Two changes are needed whichever way that goes:

  • Land the predecessor PRs first, or retarget this one onto #8243's branch, so this diff is the 306-line Cancel-button commit rather than the 39,586-line stack.
  • After a cancel the bar re-expands while the release wobble plays, so the visible Cancel circle settles at the bar's 62 px instead of the measured 48 px; the new test reads only the wrapper's scale.

[Automated review]


// The cancel button's press: it grows to `searchCancelPressedSize` under
// the finger and shrinks back with UIKit's wobble on release.
const pressCancel = (isPressed: boolean) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cancelling also returns the bar to the previous tab, so useTabBarMinimize.ts:271–275 springs the search glass from 48⁄62 back to full size on collapseSize while this wrapper plays searchCancelReturn. What a person sees is the product of the two: about 63.65 → 52 → 63 → 62 px, not the measured 63.65 → 43.6 → 49.2 → 48. The new proof samples only this wrapper's scaleX, so it cannot catch this. Holding the glass's expansion until the return settles, or asserting the glass's composed size against the iOS data, would close it.

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 24, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
@vjeux
vjeux force-pushed the uikit/c15-tabbar-search-cancel branch from c37afd9 to 83f8078 Compare October 25, 2026 11:12
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 25, 2026

@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 cancel button's press and most of the stack beneath it have no governing spec on main, so an engineering owner must provide or identify one, either accepting spec:AST-094 (proposed in #8378) or naming another record, and records that decision by commenting /approve-spec followed by the full head SHA on this pull request; the author may do so as an engineering owner. Two changes are needed either way:

  • Land the predecessor PRs first, or retarget onto #8243's branch, so this diff is the 160-line cancel-button commit rather than a 50,114-line stack.
  • When Cancel ends search, the bar's glass re-expands while the release wobble plays, so the visible circle dips only to 52.3 px and settles at 62 px instead of the measured 43.6 → 48 px, and the new proof samples the button's box rather than the painted glass.

[Automated review]

@vjeux
vjeux force-pushed the uikit/c15-tabbar-search-cancel branch from 83f8078 to 39970f4 Compare October 26, 2026 02:30
@vjeux

vjeux commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Both changes from the last review are in 39970f4.

  • The wobble now plays at the minimized size. When Cancel ends search and the bar expands, the search circle's glass keeps its 48 px until the release wobble rests, so the painted circle follows the measured 63.65 → 43.6 → 48 instead of dipping to 52.3 and settling at 62.
  • The proof samples the painted glass, not the button's box, over a window long enough to cover the wobble and the expansion that follows: it checks the peak (63.65/48), the dip (no higher than 43.6/48), the settle at the minimized size, and only then the bar's 62 px.

On the stack: each PR carries its own commit, and this one is the 160-line cancel-button commit on top of #8243. The predecessors are its stack, not its content; the whole stack now sits on the gesture line's current head.

@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: spec:AST-094 now governs the touch mechanics, but it leaves each component's touch presentation and any new motion roles to that component's own record, and no TabBar record covers the Cancel press or its new tabBar.searchCancelPress and tabBar.searchCancelReturn theme roles. An engineering owner can approve them, or name the record that must come first, by commenting /approve-spec followed by the full head SHA on this pull request; the author may do so as an engineering owner. Whatever is decided, three changes are needed:

  • Land the predecessor pull requests first, so this diff is the 209-line Cancel commit rather than a 51,420-line stack.
  • Describe the two new theme roles in .changeset/uikit-tab-bar-search-cancel-press.md as theme-settable rather than internal.
  • Limit .changeset/touch-selection-lock.md to what ships, since no Slider, Switch or SegmentedControl takes the selection lock in this diff.

[Automated review]

'@astryxdesign/core': patch
---

[chore] Internal: the UIKit constants table's `tabBar` gains the measured values of the iOS 26 tab bar's search cancel button: its pressed size and the springs it grows and shrinks back on. Not exported from the package entry point; the lab TabBar imports it by name.

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 calls the change internal, but tabBar.searchCancelPress and tabBar.searchCancelReturn become role ids that defineTheme accepts (roleKinds.generated.ts:63–64) and that astryx docs motion lists. .changeset/uikit-search-table.md ships its role additions as [feat]; describing these two as theme-settable roles in the same category would tell theme authors they exist.

Comment thread .changeset/touch-selection-lock.md Outdated
'@astryxdesign/core': patch
---

[fix] Under a finger or pen, holding a control whose hold does something (a slider's thumb, a switch's or a segmented control's drag) no longer starts text selection or the iOS callout; they come back when the finger lifts. A control or row whose hold does nothing keeps the browser's long-press selection. Text fields keep their selection, a link keeps its native menu and preview, and where the primary pointer is fine (a mouse, a trackpad, a touchscreen laptop, a desktop pen tablet) every contact keeps desktop selection. There, the press controller also registers no touch listener.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

At this head only the gesture host takes the selection lock, and no released Slider, Switch or SegmentedControl uses it (none of their files changes), so this [fix] promises behaviour the release would not ship. Limiting the note to the press controller's touch listener, and carrying the selection claim with the change that moves those controls onto the gesture host, would keep the changelog accurate.

@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: spec:AST-094 governs the touch mechanics, but it leaves each component's touch presentation and any new motion roles to that component's own record, and no TabBar record covers the Cancel press or its new tabBar.searchCancelPress and tabBar.searchCancelReturn theme roles. An engineering owner can approve them, or name the record that must come first, by commenting /approve-spec followed by the full head SHA on this pull request; the author may do so as an engineering owner. Whatever is decided, these changes are needed:

  • Rebase onto main and land the remaining predecessor pull requests, so this diff is the 209-line Cancel commit rather than a 51,430-line stack that now conflicts with main.
  • Describe the two new theme roles in .changeset/uikit-tab-bar-search-cancel-press.md as a [feat] rather than internal, and limit .changeset/touch-selection-lock.md to what ships, since no Slider, Switch or SegmentedControl takes the selection lock in this diff.
  • Return the circle's scale when search ends while Cancel is still pressed, so the circle cannot stay enlarged.

[Automated review]

}, []);
const pressTargetRef = useRef<HTMLElement | null>(null);
useLayoutEffect(() => {
pressTargetRef.current = isCancel ? cancelElementRef.current : 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.

If search ends while a finger is still on Cancel, this clears the target and useAttachment disposes the tracker without calling onHighlightChange(false) (usePressTracker.ts:82–85, :137–144). Nothing else animates the circle's scale, so it stays at 63.65⁄48 of its size, about 82 px once the bar expands. Playing the return here when isCancel turns false while the press is still highlighted would close it.

@vjeux
vjeux marked this pull request as draft October 29, 2026 22:34
vjeux added 6 commits October 29, 2026 15:35
…rt times

The expand's first frame is checked against the expand spring started from
the offset the accessory turns from, with the speed the collapse had at the
turn. The turn's moment is the two animations' start times apart, so a late
tap (a loaded box) moves the prediction with it instead of failing the case.

@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: spec:AST-094 governs the touch mechanics but leaves each component's touch presentation and its springs to that component's own record, and no TabBar record covers the Cancel press. An engineering owner can provide or identify that record, or approve the press as it stands, by commenting /approve-spec followed by the full head SHA on this pull request, and the author may do so as an engineering owner. Whatever is decided, these changes are needed:

  • Land the predecessor pull requests first, or retarget onto #8243's branch, so this diff is the 253-line Cancel layer rather than about 44,900 changed lines.
  • Make the gesture host attach for every pointer, as spec:AST-094 FR19 and FR43 and architecture:react-component-runtime INV13 now require, instead of installing nothing under a fine pointer.
  • Back the claim that Cancel answers the finger in iOS Safari with a recording on a real iPhone.

[Automated review]

Comment on lines +12 to +28
* ONLY WHERE THE PRIMARY POINTER IS COARSE
*
* - Recognizers attach, and the host registers listeners, only while the
* primary pointer is coarse (`spec:AST-094` FR19, FR24; coarsePointer.ts).
* Where it is fine, an attach is recorded but nothing is installed: no
* document, window or element listener, no `touch-action` or other style,
* nothing delivered, so a finger on a touchscreen laptop gets the
* browser's defaults. The host follows the query: turning coarse installs
* it and styles every registration; turning fine cancels every touch in
* flight and removes it all. A development warning names the first attach
* under a fine pointer.
* - The one carve-out is `perEventPointer` (AttachOptions). A per-event
* recognizer gets its listeners and its element's style on any pointer. A
* per-event press tracker, where the pointer is fine, gets only passive
* `touchstart` and `pointerdown` listeners on its own element and no
* style; the host's document and window listeners are added at a finger's
* press on it and removed once that press's contacts end.

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 host inactive under a fine pointer, but current spec:AST-094 FR19 says "Recognizers attach for every pointer, with FR43's exceptions", FR43 says "Gestures attach for every pointer, a mouse, a pen, and a finger, not only a coarse primary pointer", and architecture:react-component-runtime INV13 says "The gesture host attaches for every pointer, with no touch-only query". Attaching for every pointer with FR43's exceptions, and listening only on the component's own element under a fine pointer (FR24), would also retire perEventPointer's carve-out and the FR19 warning at lines 1353–1362.

vjeux added 5 commits October 29, 2026 16:36
…arch field covers it

Under a finger the active field spans the bar's row over the leading circle,
which kept its tab stop and its name. It is inert while the field is active
there, with a browser test (red first: the covered circle took focus).
vjeux added 11 commits October 29, 2026 18:01
The Effect that ends a press when the recognizer turns off, and the one
that ends it when the tab list changes under a finger, now say what they
synchronize, as the selection Effect does.
While the bar is collapsed its tabs are inert, so focus never lands on a
tab: keyboard focus reaches the circle, whose activation expands the bar.
The prop doc, the component doc and the hook said focus on a tab expands it.
…tree (AST-085 FR5)

Reads Chromium's accessibility tree: the disabled tab keeps its name and is
announced disabled on the tab itself; no other tab is.
The component doc said the search circle becomes the cancel button; the
circle stays a tab, out of reach while the field is active, and a separate
Cancel button lies over it.

@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: spec:AST-094 governs the touch mechanics but leaves each component's touch presentation and its springs to that component's own record, and no TabBar record covers the Cancel press. An engineering owner can provide or identify that record, or approve the press as it stands, by commenting /approve-spec followed by the full head SHA on this pull request, and the author may do so as an engineering owner. Whatever is decided, these changes are needed:

  • Land the predecessor pull requests first, or retarget onto #8243's branch, so this diff is the 253-line Cancel layer rather than about 44,900 changed lines.
  • Make the gesture host attach for every pointer, as spec:AST-094 FR19 and FR43 and architecture:react-component-runtime INV13 require, instead of installing nothing under a fine pointer.
  • Back the claim that Cancel answers the finger in iOS Safari with a recording on a real iPhone.
  • Move the unit test that leaves search from the leading circle with the keys (TabBar.test.tsx) to the inline-field state, since the active field now makes that circle inert and jsdom ignores inert.

[Automated review]

);
});

it('leaving search from the circle with the keys moves focus on to the tab it returns to', () => {

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 activates the field under a coarse pointer (the default automaticallyActivates), then focuses and activates the leading circle. In that state the circle is now inert (TabBar.tsx:1622), and the new browser test shows a focus call on it fails (TabBar.interaction.browser.spec.ts:2751–2756); jsdom ignores inert, so this test keeps asserting a keyboard path nobody can take. Rendering it with automaticallyActivates={false} keeps the field inline and the circle reachable, and an inert assertion while the field is active would cover the new state; the click at line 707 drives the same covered circle.

@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: spec:AST-094 governs the touch mechanics but leaves each component's touch presentation and its springs to that component's own record, and no TabBar record covers the Cancel press. An engineering owner can provide or identify that record, or approve the press as it stands, by commenting /approve-spec followed by the full head SHA on this pull request, and the author may do so as an engineering owner. Whatever is decided, these changes are needed:

  • Land the predecessor pull requests first, or retarget onto #8243's branch, so this diff is the 253-line Cancel layer rather than about 45,000 changed lines.
  • Make the gesture host attach for every pointer, as spec:AST-094 FR19 and FR43 and architecture:react-component-runtime INV13 require, instead of installing nothing under a fine pointer.
  • Back the claim that Cancel answers the finger in iOS Safari with a recording on a real iPhone.
  • Move the unit test that leaves search from the leading circle with the keys (TabBar.test.tsx) to the inline-field state, since the active field makes that circle inert and jsdom ignores inert.

[Automated review]

This branch was successfully deployed

1 active deployment
Preview — 72a32128 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

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.

2 participants