Skip to content

Commit faebef7

Browse files
committed
Merge the List updates base (main with meta#8780 as merged, and meta#8723) into the List updates change
# Conflicts: # packages/core/src/motion/animatedLayout.boundary.test.ts
2 parents 6488a4d + 039e696 commit faebef7

62 files changed

Lines changed: 7115 additions & 736 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[perf] With an `animatedLayout` handle, a Collapsible or TreeList change in a long list reads every row's place before any glide starts, so the page is laid out once rather than once per gliding row.
6+
7+
@cixzhang

‎.changeset/animated-layout-swap.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[fix] The animated-layout module gains its internal in-place swap: old content held as one inert, transient copy while new content enters in its place, on the shared motion. Nothing uses it yet and nothing public changes. In right-to-left containers, content after a Collapsible or TreeList size change (with an `animatedLayout` handle) now glides by its inline-start edge instead of jumping.
6+
7+
@cixzhang
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/cli': patch
3+
'@astryxdesign/core': patch
4+
---
5+
6+
[feat] `astryx theme build` keeps function icon entries, so a built theme answers each `<Icon>` request with the size and variant it renders, exactly as the runtime theme does. This includes entries inherited from a built or package theme, and family builds. A built theme's `icons` field and the registry its module re-exports are React nodes, each function read at `{size: 'md'}`. A theme that lists `iconVariants` writes an `IconVariantMap` augmentation into `<theme>.variants.d.ts`, and its declaration carries the list, so a theme that extends the built theme types `variant` by those names. A function written in the theme file itself fails the build, as an inline registry always has. Themes without function entries or an icon variant list build the same output as before.
7+
@imdreamrunner
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
'@astryxdesign/cli': patch
4+
---
5+
6+
[feat] `Icon` takes an optional `variant` (an `IconVariant` name) that requests the active theme's alternate artwork for a semantic icon: `<Icon icon="info" variant="filled" />`. The theme's icon entry receives the variant only when the active theme lists it in `iconVariants` and, for an inherited entry, the theme that defined the entry lists it too; otherwise it receives `undefined` and draws its normal artwork. `astryx theme build` keeps each inherited entry's defining list, so a built theme passes the same variants as its runtime theme. A `registerIcons()` entry receives the variants the active theme lists, and a node entry ignores `variant`. An icon component passed directly never receives `variant`, and `variant` is never written to the DOM or reflected on the `icon` theming target. Icons without `variant` render as before.
7+
@imdreamrunner

‎.changeset/sidenav-rail-motion.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[fix] SideNav's rail no longer snaps when it collapses or expands. Layout snaps to the new width at once, the rail covers or reveals its labels with a clip and ends in its real collapsed state, and inside AppShell the content slides with it, its old line wrapping fading out over the new one, all on one motion (`springs.settle`). Under Reduce Motion it cross-fades with a finger and changes at once otherwise. Nothing animates a width, and no new props.
6+
7+
@cixzhang
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/cli': patch
3+
---
4+
5+
[fix] `astryx theme build` reports a theme module that fails to load (an import it cannot resolve, or an error it throws) instead of building the theme from the text of its `defineTheme()` or default-export object; a theme module whose default export is a plain object builds as before, and a theme outside a project that imports Core builds with the Core the CLI answers with.
6+
7+
@vjeux
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/cli': patch
3+
---
4+
5+
[fix] `astryx theme build` fails, naming it and its import error, when the project's installed `@astryxdesign/core` (or, outside a project, the Core the CLI release carries) does not load or lacks `defineTheme` or `generateThemeRulesSplit`, instead of building with the CLI's own Core. A project with no Core installed still builds with the CLI's.
6+
7+
@vjeux

‎apps/storybook/stories/AppShell.stories.tsx‎

Lines changed: 225 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,13 @@ function AppTopNav({
133133
* The TopNav already displays the app name, so the SideNav omits its header
134134
* to avoid doubling the identity.
135135
*/
136-
function SideNavWithoutHeader() {
136+
function SideNavWithoutHeader({
137+
collapsible,
138+
}: {
139+
collapsible?: React.ComponentProps<typeof SideNav>['collapsible'];
140+
}) {
137141
return (
138-
<SideNav>
142+
<SideNav collapsible={collapsible}>
139143
<SideNavSection title="Main" isHeaderHidden>
140144
<SideNavItem
141145
label="Dashboard"
@@ -544,6 +548,7 @@ export const AutoHeightWithFields: Story = {
544548
*/
545549
export const ControlledCollapse: Story = {
546550
render: function ControlledCollapseStory() {
551+
const [isCollapsed, setIsCollapsed] = useState(false);
547552
return (
548553
<AppShell
549554
contentPadding={6}
@@ -553,21 +558,237 @@ export const ControlledCollapse: Story = {
553558
heading={<TopNavHeading heading="Acme App" />}
554559
endContent={
555560
<Button
556-
label="Toggle sidebar"
561+
label={isCollapsed ? 'Expand sidebar' : 'Collapse sidebar'}
557562
variant="ghost"
558563
icon={<Bars3Icon style={{width: 16, height: 16}} />}
559564
isIconOnly
565+
onClick={() => setIsCollapsed(collapsed => !collapsed)}
560566
/>
561567
}
562568
/>
563569
}
564-
sideNav={<SideNavWithoutHeader />}>
570+
sideNav={
571+
<SideNavWithoutHeader
572+
collapsible={{
573+
isCollapsed,
574+
onCollapsedChange: setIsCollapsed,
575+
hasButton: false,
576+
}}
577+
/>
578+
}>
565579
<MockContent />
566580
</AppShell>
567581
);
568582
},
569583
};
570584

585+
/** Placeholder page text only: long lines that rewrap as the rail moves. */
586+
function PlaceholderPageText() {
587+
return (
588+
<div {...stylex.props(styles.longContent)}>
589+
<Text type="large">Quarterly planning</Text>
590+
<Text type="body">
591+
Twelve projects are active this quarter and three are archived. Each
592+
card shows its owner, its last update and its next milestone, so a long
593+
description wraps to the width of the page.
594+
</Text>
595+
<Text type="body">
596+
Collapse the side navigation and the page gets wider: these sentences
597+
rewrap. The old wrapping fades out while the new one fades in, as both
598+
slide with the rail on one motion. Expand it again and they slide back.
599+
</Text>
600+
<Text type="body">
601+
Nothing animates a width: the layout takes its final size at once, the
602+
rail covers or reveals its labels with a clip, and it ends in the real
603+
collapsed state, icons only.
604+
</Text>
605+
</div>
606+
);
607+
}
608+
609+
/**
610+
* The rail-collapse stories' code as an app writes it, for the docs' code
611+
* panel (Storybook's own source would show the story object around it).
612+
* SYNC: When modified, update the render of RailCollapseMotion and
613+
* RailCollapseMotionPhone, which run exactly this.
614+
*/
615+
const RAIL_COLLAPSE_CODE = `function App() {
616+
const [isCollapsed, setIsCollapsed] = useState(false);
617+
return (
618+
<AppShell
619+
contentPadding={6}
620+
mobileNav={{breakpoint: 'none'}}
621+
sideNav={
622+
<SideNav collapsible={{isCollapsed, onCollapsedChange: setIsCollapsed}}>
623+
<SideNavSection title="Main" isHeaderHidden>
624+
<SideNavItem
625+
label="Dashboard"
626+
icon={HomeIcon}
627+
selectedIcon={HomeIconSolid}
628+
isSelected
629+
href="#"
630+
/>
631+
<SideNavItem
632+
label="Analytics"
633+
icon={ChartBarIcon}
634+
selectedIcon={ChartBarIconSolid}
635+
href="#"
636+
/>
637+
<SideNavItem
638+
label="Projects"
639+
icon={FolderIcon}
640+
selectedIcon={FolderIconSolid}
641+
href="#"
642+
endContent={<Badge label={12} />}
643+
/>
644+
</SideNavSection>
645+
<SideNavSection title="Organization">
646+
<SideNavItem
647+
label="Team"
648+
icon={UserGroupIcon}
649+
selectedIcon={UserGroupIconSolid}
650+
href="#"
651+
/>
652+
<SideNavItem
653+
label="Settings"
654+
icon={Cog6ToothIcon}
655+
selectedIcon={Cog6ToothIconSolid}
656+
href="#"
657+
/>
658+
</SideNavSection>
659+
</SideNav>
660+
}>
661+
<PlaceholderPageText />
662+
</AppShell>
663+
);
664+
}`;
665+
666+
/**
667+
* The side nav's collapse motion (`component:SideNav` FR6,
668+
* `component:AppShell` FR17): an AppShell with a collapsible SideNav whose
669+
* collapsed state the app holds. Press the collapse button at the bottom of
670+
* the rail: the layout snaps, the rail covers or reveals its labels with a
671+
* clip, and the page's old and new wrapping cross-fade as they slide on one
672+
* motion. Reduce Motion cross-fades with a finger and changes at once with a
673+
* mouse.
674+
*/
675+
export const RailCollapseMotion: Story = {
676+
name: 'Rail collapse motion',
677+
parameters: {docs: {source: {code: RAIL_COLLAPSE_CODE, language: 'tsx'}}},
678+
render: function RailCollapseMotionStory() {
679+
const [isCollapsed, setIsCollapsed] = useState(false);
680+
return (
681+
<AppShell
682+
contentPadding={6}
683+
mobileNav={{breakpoint: 'none'}}
684+
sideNav={
685+
<SideNav
686+
collapsible={{isCollapsed, onCollapsedChange: setIsCollapsed}}>
687+
<SideNavSection title="Main" isHeaderHidden>
688+
<SideNavItem
689+
label="Dashboard"
690+
icon={HomeIcon}
691+
selectedIcon={HomeIconSolid}
692+
isSelected
693+
href="#"
694+
/>
695+
<SideNavItem
696+
label="Analytics"
697+
icon={ChartBarIcon}
698+
selectedIcon={ChartBarIconSolid}
699+
href="#"
700+
/>
701+
<SideNavItem
702+
label="Projects"
703+
icon={FolderIcon}
704+
selectedIcon={FolderIconSolid}
705+
href="#"
706+
endContent={<Badge label={12} />}
707+
/>
708+
</SideNavSection>
709+
<SideNavSection title="Organization">
710+
<SideNavItem
711+
label="Team"
712+
icon={UserGroupIcon}
713+
selectedIcon={UserGroupIconSolid}
714+
href="#"
715+
/>
716+
<SideNavItem
717+
label="Settings"
718+
icon={Cog6ToothIcon}
719+
selectedIcon={Cog6ToothIconSolid}
720+
href="#"
721+
/>
722+
</SideNavSection>
723+
</SideNav>
724+
}>
725+
<PlaceholderPageText />
726+
</AppShell>
727+
);
728+
},
729+
};
730+
731+
/**
732+
* The same motion on a phone: `mobileNav={{breakpoint: 'none'}}` keeps the
733+
* rail inline at 390 px instead of the mobile drawer.
734+
*/
735+
export const RailCollapseMotionPhone: Story = {
736+
name: 'Rail collapse motion (phone)',
737+
globals: {viewport: {value: 'mobile1', isRotated: false}},
738+
parameters: {docs: {source: {code: RAIL_COLLAPSE_CODE, language: 'tsx'}}},
739+
render: function RailCollapseMotionPhoneStory() {
740+
const [isCollapsed, setIsCollapsed] = useState(false);
741+
return (
742+
<AppShell
743+
contentPadding={6}
744+
mobileNav={{breakpoint: 'none'}}
745+
sideNav={
746+
<SideNav
747+
collapsible={{isCollapsed, onCollapsedChange: setIsCollapsed}}>
748+
<SideNavSection title="Main" isHeaderHidden>
749+
<SideNavItem
750+
label="Dashboard"
751+
icon={HomeIcon}
752+
selectedIcon={HomeIconSolid}
753+
isSelected
754+
href="#"
755+
/>
756+
<SideNavItem
757+
label="Analytics"
758+
icon={ChartBarIcon}
759+
selectedIcon={ChartBarIconSolid}
760+
href="#"
761+
/>
762+
<SideNavItem
763+
label="Projects"
764+
icon={FolderIcon}
765+
selectedIcon={FolderIconSolid}
766+
href="#"
767+
endContent={<Badge label={12} />}
768+
/>
769+
</SideNavSection>
770+
<SideNavSection title="Organization">
771+
<SideNavItem
772+
label="Team"
773+
icon={UserGroupIcon}
774+
selectedIcon={UserGroupIconSolid}
775+
href="#"
776+
/>
777+
<SideNavItem
778+
label="Settings"
779+
icon={Cog6ToothIcon}
780+
selectedIcon={Cog6ToothIconSolid}
781+
href="#"
782+
/>
783+
</SideNavSection>
784+
</SideNav>
785+
}>
786+
<PlaceholderPageText />
787+
</AppShell>
788+
);
789+
},
790+
};
791+
571792
/**
572793
* No navigation at all — just content. Useful for full-bleed pages,
573794
* auth screens, or embedded views.

‎docs/architecture/interaction-modality.md‎

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ verified_by:
2525
packages/core/src/Selector/Selector.test.tsx,
2626
packages/core/src/Slider/Slider.test.tsx,
2727
]
28-
deciding_specs: [spec:AST-100/DEC-1]
28+
deciding_specs: [spec:AST-100/DEC-1, spec:AST-094/DEC-17]
2929
---
3030

3131
# Interaction modality architecture
@@ -188,6 +188,17 @@ work.
188188
path, through the animator or a CSS custom property alike. Scroll snapping and momentum stay native. It adds no
189189
module and is internal (`spec:AST-017` FR21).
190190

191+
- **INV13 — Press tracking across a group has one owner.** In
192+
`@astryxdesign/core`, one internal module, `actionGroupTracker`, tracks a
193+
held pointer across a group's actions for every `family:action-groups`
194+
member other than menus and Selector's and MultiSelector's options, whose
195+
tracking and public `menuPressStep` belong to
196+
`module:DropdownMenu/useMenuPress` (OQ1; implementation gaps: MultiSelector,
197+
and TopNav's, SideNavHeading's, TopNavHeading's, NavHeadingMenu's,
198+
BreadcrumbItem's and TabMenu's menus,
199+
do not mount it yet). No other member keeps its own copy of the tracking. It is not exported (`spec:AST-017`
200+
FR21).
201+
191202
## Allowed variation
192203

193204
Component families keep their shipped interaction models:
@@ -252,19 +263,23 @@ is asked to carry a new decision.
252263
- `architecture:react-component-runtime` owns shared lifecycle and resource
253264
mechanisms. This record owns only the cross-cutting modality-path,
254265
no-stale-interaction-outcome, gesture-velocity-source, hover-intent
255-
(INV11), and scroll-progress-source (INV12) requirements.
266+
(INV11), scroll-progress-source (INV12), and group press-tracking (INV13)
267+
requirements.
256268
- The Core velocity tracker and its release filter (INV10) — the one source of
257269
gesture velocity for Core components; not exported.
258270
- The hover recognizer, `HoverGestureRecognizer`, and its `intent` setting
259271
(INV11) — the one source of hover-show timing for Core components; not
260272
exported.
261273
- The native-scroll module's progress and its subscription (INV12) — the one
262274
source of scroll progress for Core components; not exported.
275+
- The action-group tracker (INV13) — the one press tracker for action groups
276+
outside menus and Selector's and MultiSelector's options; not exported.
263277

264278
## Deciding specs
265279

266-
`spec:AST-100/DEC-1` decides one release velocity per kind of surface (INV10).
267-
Otherwise no separate specification changes this record. The last-input rule was approved as
280+
`spec:AST-100/DEC-1` decides one release velocity per kind of surface (INV10),
281+
and `spec:AST-094/DEC-17` decides one press tracking for every action group
282+
(INV13). Otherwise no separate specification changes this record. The last-input rule was approved as
268283
a system architecture decision by `cixzhang` on 2026-08-30. Essential-action
269284
reachability, newer-intent precedence, and the evidence/scope guard were approved by
270285
`cixzhang` on 2026-09-10.
@@ -284,6 +299,7 @@ reachability, newer-intent precedence, and the evidence/scope guard were approve
284299
| INV10 | Source boundary check over Core and Lab, a Lab-to-Core comparison on one recorded stream, and release-filter unit tests over recorded iOS pan and scroll-view streams | A Core component with its own sample buffer, velocity math, or release filter; a Lab component with its own sample buffer, velocity math, or release filter; a Lab component reporting a different velocity than Core for the same stream; an export of the tracker; a non-zero release after a still pause |
285300
| INV11 | Evidence gap: not implemented yet; the shared hover recognizer and its adopters' move onto it are pending. Then: unit tests of the hover recognizer's intent and browser tests of its adopters with a mouse, a pen, a finger, and the keyboard | A show without the owner's entry delay, a missed handoff within a group, a delayed keyboard show, a hover-shown surface that closes before the pointer reaches it, a finger served by it, or a second hover-timing implementation fails |
286301
| INV12 | Unit tests of native scroll's progress and real-browser proofs of its adopters | Progress routed through React state, a missing edge, travel under Reduce Motion, use where native scroll-driven animation is supported, or a public export fails |
302+
| INV13 | Source boundary check over Core and each family member's pointer-stream tests | A member outside menus and Selector's and MultiSelector's options that tracks a held pointer across its actions with its own code, or a public export of the tracker, fails |
287303

288304
Real-browser evidence is required when the behavior depends on
289305
`:focus-visible`, pointer capability, touch or pen synthesis, rendered focus
@@ -297,3 +313,8 @@ indicator on pointer press, and keeping internal action focus owned by the
297313
action. The benchmark also verifies programmatic editor focus after both
298314
keyboard and pointer input before the behavior is treated as complete. A
299315
benchmark demonstrates the invariants; it does not carry authority for them.
316+
317+
## Open questions
318+
319+
- **OQ1 — When do menus and Selector's and MultiSelector's options move onto
320+
the shared tracker?** (`engineering`) Open.

0 commit comments

Comments
 (0)