Skip to content

feat(lab): TabBar — a search tab - #8192

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

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

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #8172.

Review only this PR's change: vjeux/astryx@43efaf0...9574764

User need

Part of matching Astryx's touch components to iOS 26, so apps built with it feel native on phones. iOS apps give search its own tab: a circle at the bar's end whose tap brings up the field and keyboard. Astryx has none; this adds TabBarSearchTab. Land it with #8243, which keeps the active field above a phone's keyboard.

Problem and solution fit

  • Layout: a 62 px circle after the capsule (48 px minimized).
  • Under a finger: the bar collapses to a circle holding the previous tab, and the same tap focuses the field, so a phone raises its keyboard (automaticallyActivates={false} keeps it inline).
  • Under a mouse it selects in place: the field shows at once, focused; Escape returns.
  • Collapsed, the bar is one button named after its tab, with aria-expanded.
  • Leaving the search tab reports onActiveChange(false).

Current specification

spec:AST-094 FR13 and FR24; spec:AST-012 FR9; spec:AST-017 FR21 and DEC-27; spec:AST-099 DEC-3 (keyboard shown in the simulator and emulator to merge).

Public delta and caller burden

New TabBarSearchTab (value, label, icon, children, isActive, onActiveChange, fieldRef, automaticallyActivates); uikit.tabBar gains the search values.

Size, gzip against #8172's head: TabBar's import 61.7 → 63.5 KB JavaScript, 1,934 → 1,955 B CSS.

Design and alternatives

  • Chosen: the field stays mounted (inert while hidden), so the tap that chooses the tab focuses it in the same event, which iOS needs to raise the keyboard.
  • Rejected: mounting the field on selection (simpler, but iOS raises no keyboard for a focus after the tap).

Evidence

iOS 26.2 simulator (a tap; Reduce Motion), a Chromium mouse, Android 15 Chrome.

iOS
iOS: Reduce Motion
Mouse
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 → … → #8172 → this PR.

Testing

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

  • On a phone or Chrome's device mode, tap the search circle: the bar collapses to a circle holding Home and the field is focused; tap that circle to go back.
  • With a mouse, click the search tab: the field shows above the bar, focused; Escape returns.
  • With the keyboard, Tab to the collapsed circle: it reads its tab's name and expands the bar.

Browser tests: the field is focused inside the choosing tap; the morph follows UIKit's spring; leaving search moves focus to the returned-to tab, never a hidden one.

Passing: pnpm test:interaction TabBar, pnpm vitest run packages/lab/src/TabBar, 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:12am 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
🟡 Reviewed (for maintainers only) Oct 30, 2026, 2:42 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

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/AlertDialog 56.9KB 57.2KB +309B 12.4KB 12.4KB 0B
core/AppShell 57.9KB 58.1KB +256B 11.6KB 11.6KB 0B
core/AvatarGroupOverflow 39.9KB 40.2KB +319B 6.4KB 6.4KB 0B
core/Banner 47.8KB 48.1KB +303B 9.9KB 9.9KB 0B
core/BaseTypeahead 54.3KB 54.6KB +257B 9.9KB 9.9KB 0B
core/BreadcrumbItem 66.4KB 66.7KB +313B 11.0KB 11.0KB 0B
core/Button 43.3KB 43.6KB +287B 9.2KB 9.2KB 0B
core/Calendar 54.9KB 55.2KB +306B 10.0KB 10.0KB 0B
core/Carousel 50.2KB 50.5KB +331B 10.2KB 10.2KB 0B
core/ChatComposer 60.6KB 60.9KB +284B 10.8KB 10.8KB 0B
core/ChatComposerInput 55.7KB 56.0KB +279B 10.1KB 10.1KB 0B
core/ChatComposerTokenElement 55.7KB 56.0KB +279B 10.1KB 10.1KB 0B
core/ChatDictationButton 46.5KB 46.8KB +278B 9.5KB 9.5KB 0B
core/ChatLayout 48.8KB 49.1KB +288B 9.9KB 9.9KB 0B
core/ChatLayoutScrollButton 46.4KB 46.7KB +269B 9.6KB 9.6KB 0B
core/ChatSendButton 45.8KB 46.1KB +279B 9.2KB 9.2KB 0B
core/CheckboxInput 49.9KB 50.2KB +287B 9.3KB 9.3KB 0B
core/CheckboxListItem 54.0KB 54.3KB +259B 10.5KB 10.5KB 0B
core/ClickableCard 12.8KB 13.1KB +289B 6.9KB 6.9KB 0B
core/CodeBlock 60.5KB 60.8KB +292B 10.7KB 10.7KB 0B
core/Collapsible 11.7KB 12.0KB +291B 4.2KB 4.2KB 0B
core/CommandPalette 50.9KB 51.2KB +296B 11.8KB 11.8KB 0B
core/CommandPaletteItem 8.4KB 8.7KB +280B 3.5KB 3.5KB 0B
core/ComplexSelector 55.8KB 56.1KB +333B 10.6KB 10.6KB 0B
core/ContextMenu 77.7KB 78.0KB +290B 14.6KB 14.6KB 0B
core/ContextMenuItem 16.6KB 16.8KB +280B 5.2KB 5.2KB 0B
core/DateInput 99.9KB 100.1KB +257B 14.8KB 14.8KB 0B
core/DateRangeInput 69.4KB 69.6KB +280B 11.2KB 11.2KB 0B
core/DateTimeInput 110.1KB 110.3KB +263B 15.2KB 15.2KB 0B
core/DialogHeader 48.8KB 49.1KB +294B 9.8KB 9.8KB 0B
core/DrawerHeader 48.9KB 49.2KB +263B 11.2KB 11.2KB 0B
core/DropdownMenu 72.7KB 73.0KB +292B 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 +284B 9.5KB 9.5KB 0B
core/FileInput 54.1KB 54.4KB +276B 10.3KB 10.3KB 0B
core/IconButton 43.3KB 43.6KB +286B 9.2KB 9.2KB 0B
core/Item 11.4KB 11.6KB +273B 4.7KB 4.7KB 0B
core/LayerProvider 63.3KB 63.6KB +301B 10.1KB 10.1KB 0B
core/Lightbox 51.2KB 51.4KB +263B 9.8KB 9.8KB 0B
core/Link 43.5KB 43.8KB +302B 7.6KB 7.6KB 0B
core/ListItem 53.5KB 53.7KB +281B 10.5KB 10.5KB 0B
core/Markdown 144.5KB 144.7KB +260B 17.4KB 17.4KB 0B
core/MobileNav 51.0KB 51.3KB +277B 10.1KB 10.1KB 0B
core/MobileNavToggle 46.2KB 46.5KB +273B 9.4KB 9.4KB 0B
core/MoreMenu 72.9KB 73.2KB +292B 14.7KB 14.7KB 0B
core/MultiSelector 76.2KB 76.5KB +286B 14.6KB 14.6KB 0B
core/NumberInput 55.7KB 56.0KB +293B 10.7KB 10.7KB 0B
core/Outline 28.6KB 28.9KB +305B 4.0KB 4.0KB 0B
core/Pagination 87.7KB 88.0KB +280B 15.3KB 15.3KB 0B
core/Popover 49.8KB 50.1KB +252B 12.1KB 12.1KB 0B
core/PowerSearch 155.1KB 155.3KB +282B 18.6KB 18.6KB 0B
core/RadioListItem 52.1KB 52.4KB +301B 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 +284B 15.0KB 15.0KB 0B
core/SelectorOption 14.5KB 14.8KB +251B 5.1KB 5.1KB 0B
core/SideNav 58.0KB 58.3KB +285B 10.6KB 10.6KB 0B
core/SideNavCollapseButton 46.6KB 46.9KB +257B 9.5KB 9.5KB 0B
core/SideNavHeading 54.7KB 55.0KB +263B 10.1KB 10.1KB 0B
core/SideNavItem 54.5KB 54.8KB +282B 10.1KB 10.1KB 0B
core/Step 32.4KB 32.7KB +294B 5.3KB 5.3KB 0B
core/Stepper 47.4KB 47.7KB +280B 9.6KB 9.6KB 0B
core/Switch 48.4KB 48.7KB +298B 9.3KB 9.3KB 0B
core/Tab 9.7KB 10.0KB +294B 4.1KB 4.1KB 0B
core/TabMenu 51.6KB 51.9KB +282B 10.0KB 10.0KB 0B
core/Table 84.0KB 84.2KB +267B 15.1KB 15.1KB 0B
core/TableCell 78.8KB 79.1KB +283B 14.8KB 14.8KB 0B
core/TableHeaderCell 78.6KB 78.9KB +289B 14.8KB 14.8KB 0B
core/TableSelectionToolbar 52.4KB 52.6KB +291B 11.2KB 11.2KB 0B
core/TextInput 53.5KB 53.8KB +296B 10.5KB 10.5KB 0B
core/Thumbnail 50.7KB 50.9KB +288B 11.0KB 11.0KB 0B
core/TimeInput 86.8KB 87.1KB +284B 13.8KB 13.8KB 0B
core/Timestamp 27.5KB 27.5KB +14B 9.5KB 9.5KB 0B
core/Toast 59.8KB 60.1KB +271B 9.7KB 9.7KB 0B
core/ToggleButton 44.1KB 44.4KB +257B 9.3KB 9.3KB 0B
core/Token 29.6KB 29.9KB +304B 4.5KB 4.5KB 0B
core/Tokenizer 64.8KB 65.1KB +321B 11.7KB 11.7KB 0B
core/TopNav 51.9KB 52.1KB +290B 10.4KB 10.4KB 0B
core/TopNavHeading 54.2KB 54.4KB +246B 9.9KB 9.9KB 0B
core/TopNavItem 9.0KB 9.3KB +283B 3.8KB 3.8KB 0B
core/TopNavMegaMenu 54.2KB 54.5KB +283B 10.8KB 10.8KB 0B
core/TopNavMegaMenuItem 9.1KB 9.4KB +281B 4.1KB 4.1KB 0B
core/TopNavMenu 53.6KB 53.9KB +272B 10.1KB 10.1KB 0B
core/TreeList 32.5KB 32.8KB +290B 4.7KB 4.7KB 0B
core/Typeahead 61.5KB 61.7KB +283B 11.3KB 11.3KB 0B
lab/TabBar N/A 63.5KB N/A N/A 1.9KB N/A
lab/TabBarItem N/A 5.3KB N/A N/A 1.9KB N/A
lab/TabBarSearchTab N/A 5.3KB 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 4.8KB 1.9KB 2.0KB +113B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 34.6KB 34.6KB 0B
@astryxdesign/lab 11.1KB 11.9KB +811B

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.

Approval waits on an engineering-owner decision. No current spec covers the TabBarSearchTab and TabBar API (described here as "proposed; pending owner review"), the draft spec:AST-094 requirements, the module-level motion/experimental and gestures/experimental subpaths, or the new 744/500 px threshold for presentation="adaptive". TabBar motion also departs from the current architecture:theme-tokens record, which would need updating if touch presentations are to take motion from the UIKit table. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Separately from that decision, these need changes:

  • Land the predecessor stack or retarget the base, so that this pull request carries only the search-tab commit instead of 29 commits and about 31,600 authored lines.
  • Keep keyboard focus visible while searching, since Shift+Tab from the field lands on the Search tab at opacity 0 and the arrow keys then move through invisible tabs.
  • Hold the tab that search was chosen from in state rather than in a ref written during render (TabBar.tsx lines 824–833).
  • Name the option that restores the old adaptive default in the touch-presentation Changeset, and fix spec:AST-094 FR7's citation of a spec:AST-090 that is not in the repository.

[Automated review]

Comment thread packages/lab/src/TabBar/TabBar.tsx Outdated
// searching, and choosing it leaves the search tab.
const previousValueRef = useRef<string | null>(null);
if (!isSearchSelected && selectedIndex >= 0) {
previousValueRef.current = value;

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 writes the tab that search returns to into a ref during render, and shownIndex then places the lens and the leading circle from it. Current architecture:react-component-runtime INV4 says a ref must not be the sole source of rendered output. Keeping the previous tab in state, set where selection changes (for example in chooseSearch), stops a discarded render from leaving a tab that never committed.

id={`${baseId}-tab-search`}
aria-selected={isSearchSelected}
aria-label={search.label}
tabIndex={isSearchSelected ? 0 : -1}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

While search is selected, this button holds the tablist's only tab stop, but useTabBarSearch fades it to opacity 0 through searchMotion.circle. Shift+Tab from the field therefore focuses an invisible tab, and ArrowLeft moves on to invisible tabs. Keep the focused control visible, or move the tab stop to a visible one and make the faded tabs inert.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval waits on an engineering-owner decision: no current spec governs the TabBarSearchTab and TabBar API (described here as "proposed; pending owner review"), the draft spec:AST-094 requirements, the module-level motion/experimental and gestures/experimental subpaths, or the new 744/500 px compact-touch threshold, and FR4 would also need the current architecture:theme-tokens record (INV3) updated before touch motion leaves the theme's motion tokens. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Independently of that decision, these need changes:

  • Land the predecessor stack or retarget the base, so this pull request carries only the search-tab commit instead of about 32,000 authored lines.
  • Keep keyboard focus visible while searching: Shift+Tab from the field lands on the Search tab at opacity 0, and the arrow keys then move through invisible tabs.
  • Say in the touch-presentation Changeset that the new query also flips the default DropdownMenuSubMenu drill-in on landscape phones and 744–768 px touch screens, and give the migration for both surfaces.
  • Keep the tab that search returns to in state rather than in a ref written during render, cancel the lift's pending report on unmount, and fix FR7's citation of a spec:AST-090 that is not in the repository.

[Automated review]

Comment on lines +59 to +60
export const COMPACT_TOUCH_QUERY =
'(width < 744px) and (pointer: coarse), (height < 500px) and (pointer: coarse)';

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 query also feeds useMenuDrillIn.tsx, so the default adaptive presentation of every DropdownMenuSubMenu changes with it: on an 852 × 393 touch phone a sub-menu now drills in where it flew out, and on a 744–768 px touch screen it flies out where it drilled in. The touch-presentation Changeset names only presentation="adaptive" on five components; please name the sub-menu change too and give the migration (presentation="flyout" or "drill-in" on the sub-menu), as spec:AST-017 FR3 asks for a changed default.

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

[feat] `presentation="adaptive"` on DropdownMenu, ContextMenu, MoreMenu, Selector and MultiSelector chooses the bottom sheet on a compact touch screen: a coarse primary pointer and a viewport narrower than 744px or shorter than 500px (it was 768px wide and below). An iPad mini in portrait keeps the anchored popover; a phone in landscape now gets the sheet.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

spec:AST-017 FR3 asks a Changeset that changes a default's behaviour to name the old and new default and the option that restores the old one. This names the old and new rule but no restoring option, and it leaves out the default sub-menu drill-in, which reads the same query.

Comment on lines +111 to +123
function afterHandOff(callback: () => void): void {
let frames = 0;
const step = () => {
frames += 1;
if (frames < HAND_OFF_FRAMES) {
requestAnimationFrame(step);
} else {
// After this frame's rendering update, not inside it.
setTimeout(callback, 0);
}
};
requestAnimationFrame(step);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These animation frames and the timeout are never cancelled, and the report they lead to calls flushSync(() => onLiftRef.current(chosen)), which reaches the app's onChange. A bar that unmounts (or switches to a mouse) within those frames still reports the lift. Keeping the ids and cancelling them, and clearing pendingReportRef, on unmount and when the recognizer is disabled would follow architecture:react-component-runtime INV5.

follows.
- **FR7 — Exits animate as UIKit's do.** A touch presentation MUST play the
exit its UIKit counterpart plays. **Proposed; pending owner review:** this
departs from the draft `spec:AST-090` FR1 (exits off by default) and FR10

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There is no spec:AST-090 in the repository at this revision or on main, so owners cannot check this departure. Could this cite the record that holds those claims, or drop the departure?

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 24, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

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

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

@vjeux

vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: one implementation.

  • Writing direction → the shared helper: isRtlElement, exported from @astryxdesign/core/hooks.

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
…-touch-model restack; the before clip is meta#8192's build)
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
…-touch-model restack); the before clip is meta#8192's build
@vjeux
vjeux force-pushed the uikit/c15-tabbar-search branch from 2d706cc to 0993496 Compare October 25, 2026 03:45
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 25, 2026
@vjeux

vjeux commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Done in 0993496: direction comes from isRtlElement (#8330). Under a mouse the search tab selects in place with no animator motion; the touch morph sits in TabBarTouch.ts. The CSS keys stay literal, spelled exactly as the resolver's constants and pinned to them by test (#8331), because the StyleX build gives an imported at-rule key a different priority.

vjeux added 15 commits October 29, 2026 13:20
…rn keeps its speed

- Expanding, the accessory's content is laid out at once for its new box
  while the glass grows into it. The content now shows through a window
  whose trailing edge rides the glass's trailing cap (a translate, with the
  content counter-moved so it stays put), so "Next" no longer shows past
  the glass for its first ~140 ms. A shrinking glass already holds the
  narrower content, so no window moves then.
- Turned around mid-move, each of the accessory's springs starts from the
  velocity it had (spec:AST-094 FR6) instead of from rest.
At this layer's text: the tab list's name and the aria naming props (the
collapsed circle falls back to the same name), the circle and the glass's
three pieces mounted only when the bar can collapse under a finger
(minimizing is on, or a search tab is there), the scroll run and scroll-end
fixes, the accessory content's window, a turned-around accessory keeping its
speed, and the comments saying the tab bar's springs play as measured.
…object too

On the global object the onscrollend handler is an own property, so the
browser without scrollend the test models still detected one.
The no-scrollend case removes the handler from the global object too.
The no-scrollend case removes the handler from the global object too.
The merge of meta#8129's fixes ran Prettier over every file it staged, which
reformatted 17 files this stack does not change (docs, scripts and a test
from main and the gesture foundation). They are back to the foundation's
text.
The tap and the second finger's landing went out 20 ms apart on the test's
wall clock, which a loaded box stretched until the lens had reached Profile
before the finger landed. They now go back to back, and the hold is a wait
after the landing.
… spring from rest

The turn used to come after the page settled, when the accessory had almost
stopped, so a carried and a dropped velocity looked alike. The drag now ends
at rest and the circle is tapped at once, and the first frame back is
compared with the expand spring from rest.
Holding every animation made the earliest one the sampling origin; when the
bar's other layers started a frame before the field, the samples ran ahead
of the spring by about half a pixel in WebKit.
@vjeux
vjeux marked this pull request as draft October 29, 2026 22:33
vjeux added 2 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.

Changes are requested: the search tab's direction is settled, but it and the stack under it conflict with current records, and this pull request still carries that whole stack.

  • Keep the active search field above the phone keyboard without panning the page (spec:AST-099 FR3 and FR4), for example by landing #8243's handling with or before this tab and letting fieldRef focus with preventScroll.
  • Make a press that slides across tabs act on the tab it lifts on under a mouse too, through Core's action-group tracker as family:action-groups FR1 and FR5 ask of a tab bar, or have an owner record an exception.
  • Let the gesture host attach for every pointer, as architecture:react-component-runtime INV13 and spec:AST-094 FR19 and FR43 now require, and keep the leading circle out of the tab order while the active field covers it.
  • Land or rebase past #8172 so this pull request carries only the search-tab layer (about 2,000 of its 36,300 authored lines).

[Automated review]

}
});
if (activates) {
search.fieldRef?.current?.focus();

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 focus raises the phone keyboard, but nothing places the active field from the keyboard height (it keeps the bar's row, :1456-1466) and the call passes no preventScroll, which the fieldRef type at line 239 cannot carry. Current spec:AST-099 FR3 says tab bar search positions from the keyboard height and FR4 that programmatic focus never scrolls the document. Landing #8243's keyboard handling with or before this tab, with fieldRef taking FocusOptions, would conform.

}
aria-expanded={isMinimized && !isSearchSelected ? false : undefined}
aria-hidden={isMinimized ? undefined : true}
tabIndex={isMinimized ? 0 : -1}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

While the search field is active under a finger it covers this circle: in Pixel 7 emulation the hit test at the circle's centre finds the search input and a tap there leaves the search tab selected, yet the circle keeps tabIndex={0} and the name "Home". Making it inert and unnamed while the field is active would keep hidden controls out of the tab order.

}
},
{
isEnabled: isTouch && !isMinimized,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The bar tracks a held press only under a coarse pointer, with its own recognizer: with a mouse, a press on Home released on Browse leaves Home selected. Current family:action-groups makes a tab bar a member ("joins by the rule, including … a tab bar"), FR1 and FR5 ask for the slide-and-lift under every pointer, and architecture:interaction-modality INV13 gives that tracking to actionGroupTracker.

Comment on lines +14 to +16
* - 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Current architecture:react-component-runtime INV13 says "The gesture host attaches for every pointer, with no touch-only query", and spec:AST-094 FR19 now reads "Recognizers attach for every pointer, with FR43's exceptions" (DEC-21 rejects keeping gestures touch-only). This coarse-only gate cites FR19 for a rule it no longer states.

…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 5 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.

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

Changes are requested: the leading circle now stays out of reach while the active search field covers it, but the search tab and the stack under it still conflict with current records, and this pull request still carries that whole stack.

  • Keep the active search field above the phone keyboard without panning the page (spec:AST-099 FR3 and FR4), for example by landing #8243's handling with or before this tab and letting fieldRef focus with preventScroll.
  • Make a press that slides across tabs act on the tab it lifts on under a mouse too, through Core's action-group tracker as family:action-groups FR1 and FR5 ask of a tab bar, or have an owner record an exception.
  • Let the gesture host attach for every pointer, as architecture:react-component-runtime INV13 and spec:AST-094 FR19 and FR43 require.
  • Point the two jsdom tests that leave search through the circle ("leaving search from the circle…" in TabBar.test.tsx) at an inline field, since they now drive a circle that browsers keep inert.
  • Land or rebase past #8172 so this pull request carries only the search-tab layer (about 2,000 of its 36,300 authored lines).

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

With the default automaticallyActivates, choosing the search tab here makes the field active, so the circle this case focuses now carries inert (TabBar.tsx:1387): a browser refuses that focus, as the new browser case asserts, and jsdom 27 accepts it only because it implements no inert. The case at line 682 has the same premise; its click reaches the circle only because fireEvent skips hit testing. Rendering both with automaticallyActivates={false}, as the case at line 773 does, keeps them on the path people still have: the circle beside an inline field.

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

Changes are requested: the newest commits only touch comments and docs, so the search tab and the stack under it still conflict with current records, and this pull request still carries that whole stack.

  • Keep the active search field above the phone keyboard without panning the page (spec:AST-099 FR3 and FR4), for example by landing #8243's handling with or before this tab and letting fieldRef focus with preventScroll.
  • Make a press that slides across tabs act on the tab it lifts on under a mouse too, through Core's action-group tracker as family:action-groups FR1 and FR5 ask of a tab bar, or have an owner record an exception.
  • Let the gesture host attach for every pointer, as architecture:react-component-runtime INV13 and spec:AST-094 FR19 and FR43 require.
  • Point the two jsdom tests that leave search through the circle at an inline field, and have the minimizeBehavior docs say that a minimized bar's search tab stays reachable and expands the bar when focused.
  • Land or rebase past #8172 so this pull request carries only the search-tab layer (about 2,000 of its 36,300 authored lines).

[Automated review]

name: 'minimizeBehavior',
type: "'never' | 'onScrollDown'",
description:
"With 'onScrollDown', scrolling the page down collapses the bar into a small circle at its leading end that holds the selected tab's icon, keeping the content in view, as iOS's tab bar does. Scrolling back up leaves it collapsed; reaching the top of the page or activating the circle expands it. Collapsed, the circle is the bar's one element for assistive technology, named after the selected tab and collapsed, as on iOS. Only under a finger: a mouse-driven bar stays expanded.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

With a search tab (the Search Tab story's own setup), a minimized bar keeps its tab list un-inert, so the Search tab stays reachable beside the circle (TabBar.tsx:1034-1037, :1131), and focusing that tab expands the bar through the list's focus handler (TabBar.tsx:1134-1139). This doc now says the circle is the bar's one element for assistive technology and that only the page top or the circle expands it; naming the search-tab case here and in useTabBarMinimize.ts:95 would keep the docs true.

This branch was successfully deployed

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