Skip to content

feat(lab): TabBar — minimize on scroll - #8154

Draft
vjeux wants to merge 1800 commits into
meta:mainfrom
vjeux:uikit/c15-tabbar-minimize
Draft

vjeux wants to merge 1800 commits into
meta:mainfrom
vjeux:uikit/c15-tabbar-minimize

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #8141.

Review only this PR's change: vjeux/astryx@ff6c905...5f4e586

User need

Part of matching Astryx's touch components to iOS 26, so apps built with it feel native on phones. On iOS the tab bar steps aside while people read: scrolling down collapses it into a circle, and it returns at the top. Astryx's bar keeps its 83 px over every page. This adds minimizeBehavior="onScrollDown".

Problem and solution fit

  • When: 66 px into a finger's downward scroll; scrolling up keeps it small, as on iOS 26.2; the top, a tap on the circle or a focused tab expands it.
  • Whose scroll: a pan that never claims the touch, listening only while the person scrolls.
  • Motion: the lens travels into the circle and shrinks on UIKit's springs; the glass contracts by transforms.

Current specification

An engineering owner decides (no record governs it): this API, touch only, and the glass approximation with its fade (GUESS, M-TB1). spec:AST-094 FR13, FR8.

Public delta and caller burden

New minimizeBehavior?: 'never' | 'onScrollDown', default 'never'; uikit.tabBar gains the minimize values; internal/touch gains useFingerScroll.

Size, gzip against #8141's head: TabBar's import 59.4 → 63.9 KB JavaScript, 1,648 → 1,923 B CSS.

The increase is the minimize itself: the scroll watch, the circle and the collapse's springs. TabBar is one module, so a bar that never minimizes loads it too. Elements (Default story, Chromium): 32 → 36 under a mouse and a finger alike (the bar's box, the platter and its glass, the tab layer); mounting those only while minimizing is a follow-up. With minimizing on, under a finger: 41, at rest and minimized.

Design and alternatives

  • Chosen: the glass's three pieces contract by transforms (an approximation of UIKit's morph that stays on the compositor), and the bar watches the scroll without claiming the touch, so the page scrolls as usual.
  • Rejected: scaling one capsule (squashes its ends); animating width or clip-path (not composited); expanding on any upward scroll (iOS 26.2 does not).

Evidence

iOS 26.2 simulator (minimize and expand; a 600 ms block; Reduce Motion), then Android 15 Chrome.

iOS: minimize
iOS: blocked
iOS: Reduce Motion
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: #8360 → #8129 → #8141 → this PR.

Testing

Try it: pnpm storybook, Lab › TabBar › Minimize On Scroll, on a phone or Chrome's device mode.

  • Scroll down: the bar collapses into a circle. Scroll up: it stays small. Scroll to the top or tap the circle: it expands.
  • With a mouse, the bar never minimizes.
  • With Reduce Motion, it cross-fades into the circle.
  • Expanded by a tap on the circle, the bar minimizes again only after another 66 px down.
  • With a screen reader, the collapsed bar is one button, the circle, named after the selected tab; the tabs come back as it expands.

Browser tests: the collapse follows UIKit's springs, even through a 600 ms block; the bar puts no touch listener or touch-action on the page; a script's scroll never minimizes it.

CI's test-ui (4/4) red is the CodeBlockHeaderPlugin race #8569 fixes, outside TabBar.

Passing locally, which is the evidence here (pushes skip CI, so no CI run is expected): 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
❓ Needs maintainer input (for maintainers only) Oct 30, 2026, 2:32 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 61.0KB N/A N/A 1.8KB N/A
lab/TabBarItem N/A 3.9KB N/A N/A 1.8KB 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 +108B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 34.6KB 34.6KB 0B
@astryxdesign/lab 11.1KB 11.9KB +796B

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 is on hold until an engineering owner provides or identifies the governing spec for TabBar's minimizeBehavior API and for the new compact-touch threshold of presentation="adaptive" (the sheet below 744 px wide or 500 px tall instead of 768 px wide and below), which no current or draft record states, and approves or rejects the draft spec:AST-094 requirements this branch adds. Any 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, please:

  • Keep the minimized circle whole when the bar's width changes (after a rotation the trailing cap stays 20.9 px away), with a browser test that resizes while minimized.
  • Land #8045, #8052, #8062, #8074, #8076, #8129 and #8141 first or retarget onto #8141, so this pull request carries the 1,017-line minimize commit instead of 29,815 authored lines.
  • Add a Changeset naming @astryxdesign/cli for the TabBar entries in its discovery data, which the lint job requires.

[Automated review]

}
const isRtl = getComputedStyle(element).direction === 'rtl';
// The trailing cap's travel onto the leading one.
const travel = element.offsetWidth - tabBar.barHeight;

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 trailing cap's travel is read once, when isMinimized toggles. If the capsule's width changes while the bar stays minimized (a phone rotated to landscape, a split view resized), the cap keeps the old offset: rotating a 375×667 touch viewport with four tabs leaves it 20.9 px off the circle. Re-apply the collapsed geometry when the capsule resizes while minimized (here and in collapsed() in useTabBarLens.ts), and add a browser test that changes the viewport while minimized.

Comment on lines +175 to +182
{
"kind": "component",
"name": "TabBar"
},
{
"kind": "component",
"name": "TabBarItem"
},

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 entries change what the CLI ships to consumers, and the lint job's changeset coverage fails for want of a Changeset naming @astryxdesign/cli (pnpm changeset:new --packages @astryxdesign/cli --category feat).

Comment thread .changeset/uikit-tab-bar-minimize.md Outdated
'@astryxdesign/core': patch
---

[experimental] `uikit.tabBar`, in the experimental motion subpath, gains the measured values of the iOS 26 tab bar's minimize on scroll: the scroll distance that collapses it, the minimized circle's size, and the lens's travel and size springs into and out of the circle.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

minimizeFade is still marked GUESS pending M-TB1 in uikit/tabBar.ts, so "the measured values" overstates it; say which value is still a guess.

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.

No spec:AST-090 record exists at this head or on main, so this amendment has no target an owner can check; name the record that holds FR1 and FR10, or drop the reference.

@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 is on hold until an engineering owner approves or rejects draft spec:AST-094 FR1–FR23 and provides or identifies the spec for TabBar's minimizeBehavior (with its five uikit.tabBar values) and for the new 744 px / 500 px compact-touch threshold of presentation="adaptive"; an engineering owner records that decision by commenting /approve-spec <full head SHA>, and the author may do so as an engineering owner.

  • When a minimized bar's width changes (a rotation or a split view), its trailing glass cap stays 20.9 px off the circle because useTabBarMinimize.ts:202 measures the cap's travel only when the state flips, and useTabBarLens.ts:402-412 places the lens the same way, so please re-place both on resize and add a browser case for it.
  • The diff carries 29,837 authored lines, 28,837 of them from the seven open predecessors (#8045 to #8141), so please land those first or retarget this pull request onto #8141.
  • The red lint job ran out of memory rather than reporting a lint error, so a re-run should clear it.

[Automated review]

}
const isRtl = getComputedStyle(element).direction === 'rtl';
// The trailing cap's travel onto the leading one.
const travel = element.offsetWidth - tabBar.barHeight;

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 trailing cap's travel is read here only when isMinimized flips. If the capsule's width changes while the bar stays minimized (a rotation, a split view), the cap keeps the old offset: from 375×667 to 667×375 it ends 20.9 px past the circle until the next expand. Observing the capsule's size while minimized and re-placing the cap (and the lens's collapsed offset in useTabBarLens.ts:402-412) without animating would fix it, and a browser case that resizes a minimized bar would keep it fixed.

Comment thread .changeset/uikit-tab-bar-minimize.md Outdated
'@astryxdesign/core': patch
---

[experimental] `uikit.tabBar`, in the experimental motion subpath, gains the measured values of the iOS 26 tab bar's minimize on scroll: the scroll distance that collapses it, the minimized circle's size, and the lens's travel and size springs into and out of the circle.

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 names the four measured values but not minimizeFade, which uikit/tabBar.ts adds as @source GUESS pending M-TB1; please name it and say it is still a guess, so the release note covers the whole surface.

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.

No spec:AST-090 record exists at this head or on main, so an owner cannot check what this departs from; please name the record that holds FR1 and FR10, or drop the reference (it appears again at line 235).

@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 needs an engineering owner to provide or identify the governing spec for TabBar's minimizeBehavior, for the new 744 px / 500 px compact-touch threshold of presentation="adaptive" and for the package-level experimental motion and gesture subpaths, and to approve or reject the draft AST-094 requirements. 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. Separately from that decision, please address these points:

  • A bar minimized before a rotation or a resize keeps its old geometry, so the circle tears by about 21 px (useTabBarMinimize.ts:202, useTabBarLens.ts:402-412).
  • The diff carries about 30,000 authored lines from seven open predecessor pull requests; land them or rebase this branch onto main so it holds only minimize on scroll.
  • .changeset/touch-presentation.md says an iPad mini in portrait keeps the popover, but it actually switches from the sheet to the popover, and .changeset/uikit-tab-bar-minimize.md leaves out the guessed minimizeFade.

[Automated review]

}
const isRtl = getComputedStyle(element).direction === 'rtl';
// The trailing cap's travel onto the leading one.
const travel = element.offsetWidth - tabBar.barHeight;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

travel is read from offsetWidth only when isMinimized flips, and useTabBarLens.ts:402-412 places the lens the same way, so a bar minimized in portrait and rotated to landscape keeps the old geometry: the trailing cap stops 20.9 px short of the circle and the lens sits 8.1 px off centre at 52.5 px wide. Re-measuring and set-ting both targets when the capsule resizes while minimized (a ResizeObserver on the capsule) would keep the circle whole.

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.

An iPad mini in portrait is 744 px wide, so with a coarse pointer the base query (max-width: 768px) and (pointer: coarse) opened the bottom sheet; with this change it opens the popover. It switches surfaces rather than keeping the popover: "An iPad mini in portrait now gets the anchored popover instead of the sheet".

Comment thread .changeset/uikit-tab-bar-minimize.md Outdated
'@astryxdesign/core': patch
---

[experimental] `uikit.tabBar`, in the experimental motion subpath, gains the measured values of the iOS 26 tab bar's minimize on scroll: the scroll distance that collapses it, the minimized circle's size, and the lens's travel and size springs into and out of the circle.

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 lists the measured values but not minimizeFade, the fifth value the change adds, which uikit/tabBar.ts marks @source GUESS pending M-TB1; naming it ("and a provisional fade spring, a guess pending M-TB1") keeps the release note complete.

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.

main has no spec:AST-090 record, so the departure FR7 describes (and the matching line under current-state impact) cannot be checked by an approver; cite the record that exists or drop the departure note.

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.
  • Raw touch listeners → the gesture host: the minimize watches the page's scroll through a vertical pan with the host's claimsTouches: false option (passive listeners only, never claims a touch), and the window touch listeners go.

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
@vjeux
vjeux force-pushed the uikit/c15-tabbar-minimize branch from e62f5d6 to 802d149 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
@github-actions
github-actions Bot requested review from cvkxx and ernestt October 25, 2026 03:45
vjeux added 20 commits October 29, 2026 12:16
…esture host's subscriptions

The gesture host subscribes no click: the one cancelling click subscriber
is the click guard's, added at a window's first arm and kept. The release
note, the stream's header and the gestures README listed click with the
host's touchend and contextmenu; they now name the guard's own.
meta#8360 now carries the gesture foundation this stack built on (meta#8320 and the
PRs below it).
The merge of the heads meta#8129 builds on: meta#8360 @ 045f666 (the gesture
foundation), meta#8340 @ 339a352 (the animator) and meta#8562 @ cd3ad72
(Core's internal entries). With it as an ancestor, GitHub's compare from it
shows exactly meta#8129's own files.
…changed)

bbc0a4a is the merge of the heads this pull request builds on. With it
as an ancestor, GitHub's compare from it shows exactly this pull request's
own files.
…ps reach it

Red first: with no label the tab list has no name, and aria-label or
aria-labelledby passed to TabBar land on its root, where they name nothing.
As TabList does, the tab list is named by aria-labelledby, else aria-label,
else label, else the translated `@astryx.tabList.label` ("Tabs"), and the
aria naming props go to the tab list instead of the root.
spec:AST-094 FR4 names none of the tab bar's values, and Core's roles test
pins the registered roles to exactly FR4's list, so registerTabBarTable()
lists no motion role and each spring plays as measured, as the scroll and
navigation tables do. The comments and the changeset no longer call them
motion roles.
The comments it rewrote say, at this layer's wording too, that the tab bar's
springs play as measured; the lens's selection Effect says what it
synchronizes.
…nges under it

Red first: four tabs shrinking to three under a finger held on the last one
throw at the lift ("Cannot read properties of undefined (reading 'value')"),
since the lift resolves its index against the new list.
…ges under it

A press measured the tab centres of the list it began on. When the list
changes under a held finger, the press now ends there as a cancel and the
lens settles back to rest, so no move chases the old centres and the lift
never hands onLift an index into the new list.
Its tab-list naming props sit beside this layer's minimizeBehavior, and the
comments it rewrote say, at this layer's wording too, that the tab bar's
springs play as measured.
Red first: expanded by a tap, the bar minimizes again on the next pixel
down; where the browser sends no scrollend, a script's scroll after the
person's counts; collapsed, the tab list stays in the accessibility tree
and the circle is no button; and the circle and the split glass mount
even with minimizing off.
… restarts on expand

- Expanding starts the downward scroll run over, so an expanded bar takes
  another minimizeDistance down before it minimizes again (before, the
  next pixel down minimized it).
- Where the browser sends no scrollend, the scroll watch ends when the
  gesture host's reader says the person's scroll ended (its own fallback),
  so a script's scroll after it no longer counts.
- Collapsed, the circle is the bar's one element for assistive technology,
  as on iOS: a button beside the tab list, named after the selected tab and
  collapsed (aria-expanded), with the tabs inert until it expands; from the
  keys, focus lands on the selected tab. The capsule sits in the bar's box,
  which places the circle.
- The circle and the glass's three pieces mount only when minimizing is on;
  otherwise the glass is one piece.
…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 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.

@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 is on hold until an engineering owner provides or identifies the governing spec for Lab TabBar and its new minimizeBehavior prop: no current record covers the API, its finger-only behavior, the collapse with its guessed fade (tabBar.minimizeFade), or whether the tab-bar springs follow the theme's motion knobs. An engineering owner can record that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Independent of that decision, these changes are needed:

  • Narrow the diff to this layer (it carries 33,675 authored lines, mostly from the unlanded stack) and move the astryxStylex build fix and the recognizers no component uses to their own pull requests.
  • Drive TabBar's press tracking from the shared action-group tracker for every pointer, so a lift off the bar acts on nothing and a mouse slide works, as family:action-groups asks of a tab bar.
  • Mount the minimize's wrappers only when minimizing is on, reach the animator through @astryxdesign/core/internal/touch, and justify the 4.2 KB finger-only cost.
  • Add a real iPhone recording, and fix the docs that say focus on a tab expands the collapsed bar.

[Automated review]

new LongPressGestureRecognizer({
name: 'tab-bar-selection',
minimumPressDuration: 0,
allowedPointerTypes: ['touch', 'pen'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Only touch and pen are tracked here, and the lift at lines 419-421 picks the nearest tab even when the finger has left the bar. family:action-groups counts a tab bar as a member: a lift outside the group acts on nothing (FR3), and a mouse slides too (FR1, FR5), through the one shared tracker. createActionGroupTracker (with resolveTarget and onMove for the lens) could drive this for every pointer.

Comment on lines +748 to +752
<div
{...stylex.props(
styles.bar,
styles.barSize(px(tabBar.barHeight), px(naturalWidth(count))),
)}>

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 minimizing off, this sizing wrapper, the platter wrapper and its glass element (lines 773-801) and the tab layer (lines 802-806) do nothing that the capsule alone did not do in the layer below. Mounting them only while canMinimize, with the glass back on the capsule otherwise, would keep the default bar at its previous element count (architecture:component-style-authoring INV7).

Comment on lines +56 to +60
import {
registerTabBarTable,
tabBar,
useAnimator,
} from '@astryxdesign/core/internal/motion';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

architecture:react-component-runtime INV13 routes the animator and UIKit's measured tables through @astryxdesign/core/internal/touch; importing them from a second entry, internal/motion, needs either a re-export from internal/touch or an amendment to INV13.

Comment thread packages/lab/src/TabBar/TabBar.tsx Outdated
/**
* Whether scrolling the page down collapses the bar into a circle holding
* the selected tab's icon (UIKit's `tabBarMinimizeBehavior`): reaching the
* top of the page, a tap on the circle or focus on a tab expands it. Under a finger only;

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 bar is collapsed every tab is inert (line 832), so focus cannot reach a tab; keyboard focus lands on the circle, whose activation expands the bar and focuses the selected tab. The doc here, in TabBar.doc.mjs and in useTabBarMinimize.ts:70 could say that instead.

@vjeux

vjeux commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, fixed in this push:

  • Expanding starts the downward run over, so the bar takes another 66 px down before it minimizes again.
  • Where the browser sends no scrollend, the scroll watch ends when the gesture host's reader says the person's scroll ended.
  • Collapsed, the circle is a button beside the tab list, named after the selected tab and collapsed (aria-expanded). The tabs stay inert until it expands.
  • The circle and the split glass mount only when minimizing is on.

The astryxStylex change comes from the gesture foundation (#8360). The animator comes through @astryxdesign/core/internal/motion, the internal entry that serves it; INV13 lists the animator among the modules Lab may reach directly. The recordings come from the iOS 26.2 simulator; this stack has no real-device rig.

vjeux added 3 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.

Approval is on hold until an engineering owner provides or identifies the governing spec for Lab TabBar and its new minimizeBehavior prop: no current record covers the API, its finger-only behavior, the collapse with its guessed fade (tabBar.minimizeFade), or whether the tab-bar springs follow the theme's motion knobs. Any engineering owner can record that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Thanks for correcting the docs on how the collapsed bar expands; independent of the spec decision, these changes are still needed:

  • Narrow the diff to this layer (it carries 33,677 authored lines, mostly from the unlanded stack) and move the astryxStylex build fix and the recognizers no component uses to their own pull requests.
  • Drive TabBar's press tracking from the shared action-group tracker for every pointer, so a lift off the bar acts on nothing and a mouse slide works, as family:action-groups asks of a tab bar.
  • Mount the minimize's wrappers only when minimizing is on, and reach the animator through @astryxdesign/core/internal/touch, the route architecture:react-component-runtime INV13 names.
  • Justify the 4.5 KB finger-only cost and add real-device recordings, as spec:AST-094 asks.

[Automated review]

Comment on lines +419 to +421
const chosen = isCancelled
? selected
: nearestIndex(press.lastX, press.centers);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A lift off the bar still commits nearestIndex here, and the long press above tracks only touch and pen under a coarse primary pointer, so a finger that slides off the bar and lifts over the page switches tabs while a mouse slide across the tabs chooses nothing. family:action-groups names a tab bar as a member by rule and asks for FR1, FR3 ("A press that lifts outside the group acts on nothing") and FR5 (every pointer) from the shared actionGroupTracker (architecture:interaction-modality INV13); its resolveTarget and onMove already support a lens that chases the finger.

Comment on lines +773 to +806
<div
ref={minimize.platter}
aria-hidden
data-tab-bar-platter=""
{...stylex.props(styles.platter(HALF_BAR))}>
{canMinimize ? (
<>
<div
{...stylex.props(styles.glass, styles.platterStart(HALF_BAR))}
/>
<div
ref={minimize.platterMiddle}
{...stylex.props(
styles.glass,
styles.platterMiddle(HALF_BAR),
)}
/>
<div
ref={minimize.platterEnd}
data-tab-bar-platter-end=""
{...stylex.props(styles.glass, styles.platterEnd(HALF_BAR))}
/>
</>
) : (
<div
{...stylex.props(styles.glass, styles.platterWhole(HALF_BAR))}
/>
)}
</div>
<div
ref={minimize.items}
role="presentation"
data-tab-bar-items=""
{...stylex.props(styles.items)}>

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 minimizing off, the platter wrapper, the whole-glass element and the tab layer still render, beside the sizing wrapper at line 748, where the layer below painted the glass and the size on the capsule itself: a four-tab bar at rest goes from 22 to 26 elements. architecture:component-style-authoring INV7 asks for element counts that justify them, or for mounting them only while canMinimize.

import * as stylex from '@stylexjs/stylex';
import type {BaseProps} from '@astryxdesign/core';
import {useListFocus, useMergedRefs} from '@astryxdesign/core/hooks';
import {tabBar} from '@astryxdesign/core/internal/motion';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

architecture:react-component-runtime INV13 lists the animator and UIKit's measured tables among the shared touch modules and says Core and Lab components reach them through @astryxdesign/core/internal/touch; this import, and the ones in useTabBarLens.ts and useTabBarMinimize.ts, use a second entry, internal/motion. Export them from internal/touch, or have INV13 amended.

@vjeux

vjeux commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. Fixed in this push: the docs now say that activating the collapsed circle expands the bar, since focus never reaches an inert tab. The description now gives the element counts and what the size increase holds.

Mounting the bar's wrappers only while minimizing comes in a follow-up push. The astryxStylex change and the recognizers belong to the gesture foundation (#8360), and internal/motion is #8562's entry for the animator.

This branch was successfully deployed

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