Skip to content

perf(Layer): in the loading document, the entrance side restyles only the layer and its direct child - #12375

Open
cixzhang wants to merge 17 commits into
mainfrom
perf/layer-entrance-side-restyle
Open

cixzhang wants to merge 17 commits into
mainfrom
perf/layer-entrance-side-restyle

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Primary intent

Narrow the restyle an anchored layer's entrance side causes, in the document that loads Astryx: the four entrance-side values reach the layer and the element directly inside it, not every element inside the layer. The entrance is unchanged in Chromium and WebKit.

User impact

  • People opening a menu, popover, hover card, tooltip or selector: a Popover open restyles about 145 elements instead of 190, because the side no longer passes to the layer's content. At 4× CPU on a phone viewport, the press handler that opens a Popover finishes 3.4 ms sooner than on main, with 1.4 ms less forced layout (18 interleaved runs, pairwise medians).
  • Everyone: the entrance is the same from its first painted frame. Each layer still slides from, and scales about, the side it lands on, in Chromium and in WebKit.
  • Builders: layerAnimations gives the landed side on the layer element or its direct child (as usePopover applies it). An element nested deeper plays its placement's default side, as before the entrance side existed.

Change

  • Layer/layerEntranceSide.ts:
    • registerLayerEntranceProperties() registers the four --_astryx-layer-enter-* properties with inherits: false. It never throws. Without CSS.registerProperty (a server, an older browser) it does nothing, and the properties inherit as before. A name another copy already registered is expected; any other failure warns in development only.
    • writeLayerEntranceSide writes the values on the layer and on each of its direct element children. WebKit does not pass a registered, non-inherited property to a child that asks to inherit it.
  • Layer/useLayer.tsx: calls the registration as its module loads. The side is still written in the show's own task, as on main: WebKit resolves an entrance's keyframes when the entrance starts, so a later write misses its first frame.
  • Layer/layerAnimations.stylex.ts: each entrance class inherits the four properties explicitly. The JSDoc says to apply layerAnimations to the layer or its direct child.
  • docs/architecture/layer-runtime.md INV20: layerAnimations reads the side on the layer element or its direct child.
  • Tests:
    • layerEntranceSide.test.ts: registration, its absence, a duplicate, and an unexpected failure that does not throw.
    • New LayerEntranceSideScope.interaction.browser.spec.ts: the entrance element computes the written side and the content inside it computes none. It fails on main.
    • New LayerEntranceFirstPaint.interaction.browser.spec.ts (Chromium; it throttles the CPU through a CDP session): at 6× CPU, a Popover and a DropdownMenu placed above, below, at the start and at the end each paint their first entrance frame with the landing side.
  • Changeset: [perf] patch.

Authority

  • Layer runtime: architecture:layer-runtime INV20, amended here with the direct-child line.
  • Performance: architecture:react-component-runtime INV18.

Evidence

  • WebKit, same entrance: LayerEntranceSide (20 cases) and LayerEntranceSideScope (2 cases) in a Playwright WebKit container (CI settings, 1 worker, no retries): 0 misses in 5 cold runs on empty shader caches (110 cases) and in 3 warm runs (66 cases). Main: 0 misses under the same conditions. Two earlier attempts that wrote the side after the show's task (at the first resize observation, then at the next animation frame) missed the side on 2–14 % of cold first frames in WebKit; this head keeps the write in the task.
  • Chromium, same entrance: LayerEntranceSide 20/20, LayerEntranceSideScope 2/2, LayerEntranceFirstPaint 8/8.
  • Chromium, 4× CPU, phone touch open of the Popover story, production Storybook builds, 18 interleaved runs against main 8a5008a (pairwise medians):
Measure main this PR Change
Press handler 90.3 ms 88.1 ms −3.4 ms
Forced layout in the handler 42.1 ms 39.5 ms −1.4 ms
Style and layout in the 500 ms after the press 72.4 ms 72.0 ms +0.2 ms
Press to first visible frame (frame start) 105.8 ms 108.3 ms +2.3 ms
Press to first visible frame (presented) 197.4 ms 203.8 ms +8.8 ms, within one frame
  • Restyle (trace, 1×): a Popover open restyles 190 elements on main and about 145 here.
  • Unit suites: Layer, Popover, DropdownMenu, Selector, Tooltip, Carousel, HoverCard, ContextMenu, ComplexSelector, Breadcrumbs and PowerSearch, 2,744/2,744. tsc, eslint, knowledge and changesets are clean.

Known limits

  • Most of feat(Layer): an entrance slides from the side its layer lands on #10771's added press-handler cost remains: the side write still runs in the show's task, and moving it out fails in WebKit. That residual stays tracked separately.
  • A caller that applies the public layerAnimations to an element nested deeper than directly inside the layer is not guaranteed the landed side.
  • The property registration belongs to the document that loads Astryx. A layer in a same-origin iframe or a Picture-in-Picture window gets its side written on the layer and its direct children (a cross-window check), but its content still inherits the side there, as on main.

Writing rubric results

Run over the architecture:layer-runtime INV20 line ("layerAnimations reads the side on the layer element or its direct child").

  • R1 narration: none.
  • R2 research in the record: none.
  • R3 evidence naming a change: none.
  • R4 rejected alternatives over one line or outside a decision: none.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none.
  • R7 project status in the record: none.

Owner and land path

  • Owner: Astryx maintainers, fix-loop lane 1.
  • Land path: code review, CI, merge.

Readers of the entrance side

Every reader of --_astryx-layer-enter-* is a layerAnimations class, and each sits on the layer or its direct child:

  • Through usePopover({xstyle}) (the layer's surface, its direct child): Popover, DropdownMenu, ComplexSelector, Selector, PowerSearch, BreadcrumbItem's menu, ContextMenu, and Lab Schedule (TimeGridView, useScheduleViewPopover).
  • On the layer itself: Tooltip (useTooltip) and HoverCard (useHoverCard), whose surface is the layer element.
  • DropdownMenuSubMenu: the flyout's frame (with regions) or its menu (plain flyout), each the flyout layer's direct child.

Chromium entrance frames at 0, 16, 33, 50 and 66 ms, plus at rest, are byte-identical to main for Popover, DropdownMenu, a sub-menu flyout and Tooltip, in LTR and RTL, and for Popover under Reduce Motion. In those frames the animated element sits at depth 1, or 0 for Tooltip. The only deeper animations are the sub-menu rows' hover transitions, which read no side.

…ays the entrance

The layer runtime writes four --_astryx-layer-enter-* properties as an
anchored layer shows. As inherited custom properties they restyled every
element inside the layer, and the popover's focus move then forced that
restyle in the input task. They are now registered as not inherited, once as
layerEntranceSide.ts loads, and layerAnimations inherits them explicitly on
the element that plays the entrance: the layer itself, or the surface
directly inside it. The registration skips where CSS.registerProperty does
not exist and accepts a name another copy registered first.

The entrance is unchanged: LayerEntranceSide's twenty cases pass. A new
browser case proves the entrance element computes the written side and the
content inside it does not.
@vercel

vercel Bot commented Nov 17, 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 Nov 25, 2026 6:22pm UTC

Request Review

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

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 25, 2026, 7:29 PM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 77a92ad

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
DateTimeInput 237.0 kB (+270 B) · 20.9 kB CSS (+37 B) — — · — · —
TableSelectionToolbar 80.7 kB (+254 B) · 14.7 kB CSS (+47 B) — — · — · —
ChatLayout 93.9 kB (+255 B) · 11.8 kB CSS (+31 B) — — · — · —
125 more components
Component Size LoC Visual · A11y · RTL
DrawerHeader 73.5 kB (+243 B) · 14.4 kB CSS (+38 B) — — · — · —
FileInput 80.2 kB (+249 B) · 13.0 kB CSS (+32 B) — — · — · —
Popover 108.8 kB (+240 B) · 15.8 kB CSS (+41 B) — — · — · —
SideNavHeading 91.8 kB (+249 B) · 12.7 kB CSS (+31 B) — — · — · —
Banner 72.2 kB (+246 B) · 11.8 kB CSS (+33 B) — — · — · —
FieldLabel 59.1 kB (+246 B) · 6.5 kB CSS (+33 B) — — · — · —
Thumbnail 74.6 kB (+250 B) · 12.9 kB CSS (+29 B) — — · — · —
Calendar 81.3 kB (+245 B) · 11.9 kB CSS (+31 B) — — · — · —
DialogHeader 73.4 kB (+242 B) · 13.0 kB CSS (+34 B) — — · — · —
TopNavMegaMenu 85.0 kB (+245 B) · 13.3 kB CSS (+31 B) — — · — · —
Button 70.0 kB (+246 B) · 11.3 kB CSS (+29 B) — — · — · —
DateInput 213.0 kB (+232 B) · 19.1 kB CSS (+43 B) — — · — · —
IconButton 70.1 kB (+246 B) · 11.3 kB CSS (+29 B) — — · — · —
ChatDictationButton 70.6 kB (+242 B) · 11.4 kB CSS (+31 B) — — · — · —
TextInput 104.0 kB (+241 B) · 13.0 kB CSS (+31 B) — — · — · —
NumberInput 109.0 kB (+239 B) · 13.2 kB CSS (+32 B) — — · — · —
TopNavMenu 90.9 kB (+235 B) · 12.7 kB CSS (+36 B) — — · — · —
ChatComposer 94.2 kB (+238 B) · 13.7 kB CSS (+32 B) — — · — · —
TopNavHeading 91.5 kB (+239 B) · 12.7 kB CSS (+30 B) — — · — · —
ChatSendButton 70.5 kB (+236 B) · 11.3 kB CSS (+31 B) — — · — · —
SideNavCollapseButton 70.9 kB (+237 B) · 11.4 kB CSS (+30 B) — — · — · —
MultiSelector 108.3 kB (+229 B) · 19.2 kB CSS (+37 B) — — · — · —
ChatComposerInput 91.3 kB (+235 B) · 12.7 kB CSS (+30 B) — — · — · —
BaseTypeahead 87.2 kB (+233 B) · 12.3 kB CSS (+30 B) — — · — · —
ChatComposerTokenElement 91.3 kB (+233 B) · 12.7 kB CSS (+30 B) — — · — · —
TabMenu 88.0 kB (+226 B) · 12.6 kB CSS (+35 B) — — · — · —
MoreMenu 137.5 kB (+211 B) · 20.1 kB CSS (+49 B) — — · — · —
Typeahead 98.9 kB (+226 B) · 14.6 kB CSS (+34 B) — — · — · —
CheckboxList 78.7 kB (+224 B) · 8.5 kB CSS (+35 B) — — · — · —
CodeBlock 86.2 kB (+227 B) · 13.0 kB CSS (+32 B) — — · — · —
AppShell 94.3 kB (+226 B) · 15.1 kB CSS (+32 B) — — · — · —
SideNavItem 85.9 kB (+228 B) · 12.5 kB CSS (+30 B) — — · — · —
Switch 114.1 kB (+224 B) · 10.9 kB CSS (+34 B) — — · — · —
TopNav 73.6 kB (+227 B) · 12.3 kB CSS (+31 B) — — · — · —
ContextMenu 110.3 kB (+216 B) · 19.9 kB CSS (+41 B) — — · — · —
Pagination 153.9 kB (+220 B) · 20.3 kB CSS (+37 B) — — · — · —
DropdownMenuSubMenu 83.2 kB (+223 B) · 11.5 kB CSS (+33 B) — — · — · —
ToggleButton 97.6 kB (+224 B) · 11.4 kB CSS (+32 B) — — · — · —
ComplexSelector 87.1 kB (+223 B) · 13.5 kB CSS (+32 B) — — · — · —
MobileNavToggle 71.9 kB (+224 B) · 11.9 kB CSS (+31 B) — — · — · —
ChatLayoutScrollButton 70.6 kB (+220 B) · 11.5 kB CSS (+31 B) — — · — · —
Tokenizer 117.0 kB (+217 B) · 22.1 kB CSS (+34 B) — — · — · —
TableCell 111.4 kB (+214 B) · 20.5 kB CSS (+36 B) — — · — · —
PowerSearch 323.5 kB (+214 B) · 27.6 kB CSS (+35 B) — — · — · —
Carousel 80.8 kB (+217 B) · 12.3 kB CSS (+31 B) — — · — · —
Slider 119.3 kB (+214 B) · 9.6 kB CSS (+34 B) — — · — · —
Stepper 71.8 kB (+214 B) · 11.4 kB CSS (+34 B) — — · — · —
AvatarGroupOverflow 54.6 kB (+211 B) · 6.4 kB CSS (+36 B) — — · — · —
Link 60.0 kB (+211 B) · 7.8 kB CSS (+36 B) — — · — · —
CheckboxInput 73.7 kB (+212 B) · 11.0 kB CSS (+34 B) — — · — · —
Field 63.6 kB (+209 B) · 8.0 kB CSS (+37 B) — — · — · —
RadioList 65.1 kB (+211 B) · 8.0 kB CSS (+34 B) — — · — · —
DropdownMenu 137.3 kB (+195 B) · 20.1 kB CSS (+49 B) — — · — · —
TableHeaderCell 111.3 kB (+207 B) · 20.3 kB CSS (+37 B) — — · — · —
Toast 110.1 kB (+213 B) · 11.6 kB CSS (+31 B) — — · — · —
BreadcrumbItem 106.7 kB (+212 B) · 14.3 kB CSS (+31 B) — — · — · —
CheckboxListItem 85.4 kB (+208 B) · 13.0 kB CSS (+34 B) — — · — · —
TimeInput 184.8 kB (+205 B) · 18.0 kB CSS (+37 B) — — · — · —
InputGroup 65.8 kB (+207 B) · 9.2 kB CSS (+34 B) — — · — · —
ListItem 84.5 kB (+207 B) · 13.0 kB CSS (+34 B) — — · — · —
Selector 120.6 kB (+204 B) · 20.0 kB CSS (+37 B) — — · — · —
lab/DialogHeroHeader 94.8 kB (+241 B) · 372 B CSS (0) — — · — · —
Drawer 60.4 kB (+206 B) · 9.1 kB CSS (+34 B) — — · — · —
Tooltip 34.7 kB (+202 B) · 5.2 kB CSS (+38 B) — — · — · —
SegmentedControl 105.6 kB (+199 B) · 7.6 kB CSS (+40 B) — — · — · —
MobileNav 82.5 kB (+207 B) · 11.9 kB CSS (+31 B) — — · — · —
richtext/RichTextView 290.3 kB (+237 B) · 2.4 kB CSS (0) — — · — · —
DateRangeInput 109.8 kB (+201 B) · 14.4 kB CSS (+35 B) — — · — · —
InfoTip 53.7 kB (+203 B) · 6.1 kB CSS (+33 B) — — · — · —
Markdown 214.5 kB (+200 B) · 23.8 kB CSS (+34 B) — — · — · —
lab/ListInput 100.7 kB (+232 B) · 1.3 kB CSS (0) — — · — · —
AlertDialog 136.8 kB (+191 B) · 16.4 kB CSS (+40 B) — — · — · —
lab/CommentThread 388.5 kB (+230 B) · 2.4 kB CSS (0) — — · — · —
lab/TourStep 99.6 kB (+229 B) · 691 B CSS (0) — — · — · —
RadioListItem 81.5 kB (+198 B) · 11.6 kB CSS (+30 B) — — · — · —
Table 129.7 kB (+192 B) · 21.5 kB CSS (+36 B) — — · — · —
richtext/RichTextEditor 313.6 kB (+228 B) · 2.7 kB CSS (0) — — · — · —
Lightbox 154.0 kB (+196 B) · 12.5 kB CSS (+31 B) — — · — · —
SideNav 118.4 kB (+195 B) · 12.7 kB CSS (+31 B) — — · — · —
AvatarGroup 51.4 kB (+191 B) · 6.5 kB CSS (+34 B) — — · — · —
HoverCard 31.4 kB (+186 B) · 4.8 kB CSS (+39 B) — — · — · —
StatusDot 36.4 kB (+187 B) · 6.1 kB CSS (+38 B) — — · — · —
Avatar 48.6 kB (+187 B) · 6.3 kB CSS (+35 B) — — · — · —
lab/TransferList 143.6 kB (+222 B) · 1.4 kB CSS (0) — — · — · —
TextArea 97.4 kB (+182 B) · 10.4 kB CSS (+38 B) — — · — · —
lab/ChatReactionBar 133.5 kB (+220 B) · 1.1 kB CSS (0) — — · — · —
lab/CommentPin 63.5 kB (+219 B) · 1.2 kB CSS (0) — — · — · —
lab/AudioPlayer 243.0 kB (+215 B) · 1.8 kB CSS (0) — — · — · —
lab/SelectableCardGroup 74.0 kB (+215 B) · 162 B CSS (0) — — · — · —
richtext/RichTextEditorToolbar 320.6 kB (+215 B) · 454 B CSS (0) — — · — · —
lab/Schedule 121.8 kB (+210 B) · 3.9 kB CSS (0) — — · — · —
lab/DiffViewer 99.2 kB (+206 B) · 2.3 kB CSS (0) — — · — · —
lab/EmojiPicker 123.8 kB (+204 B) · 751 B CSS (0) — — · — · —
lab/Comments 395.3 kB (+202 B) · 2.5 kB CSS (0) — — · — · —
lab/TabBarMoreList 107.9 kB (+202 B) · 1.8 kB CSS (0) — — · — · —
lab/CommentComposer 190.9 kB (+201 B) · 1.9 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 132.2 kB (+192 B) · 773 B CSS (0) — — · — · —
lab/TransferListSelector 155.9 kB (+186 B) · 1.6 kB CSS (0) — — · — · —
lab/MediaFullscreenButton 233.0 kB (+171 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaSeekButton 233.0 kB (+171 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaPlaybackRate 233.0 kB (+170 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaPlayButton 233.0 kB (+170 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaVolume 233.0 kB (+170 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaCaptionsButton 233.0 kB (+168 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaTime 233.0 kB (+168 B) · 1.5 kB CSS (0) — — · — · —
lab/MediaTimeSlider 233.0 kB (+168 B) · 1.5 kB CSS (0) — — · — · —
charts/Chart 256.4 kB (+164 B) · 516 B CSS (0) — — · — · —
charts/ChartTooltip 232.7 kB (+157 B) · 451 B CSS (0) — — · — · —
lab/VideoPlayer 240.8 kB (+155 B) · 2.1 kB CSS (0) — — · — · —
CommandPalette 86.7 kB (+113 B) · 14.0 kB CSS (+39 B) — — · — · —
TabList 49.0 kB (+93 B) · 6.8 kB CSS (0) — — · — · —
Toolbar 48.6 kB (+88 B) · 8.6 kB CSS (0) — — · — · —
ChatToolCalls 33.8 kB (+24 B) · 9.2 kB CSS (+34 B) — — · — · —
CommandPaletteInput 34.9 kB (+14 B) · 8.3 kB CSS (+37 B) — — · — · —
Timestamp 28.5 kB (+16 B) · 11.5 kB CSS (+31 B) — — · — · —
Heading 13.0 kB (+13 B) · 6.2 kB CSS (+31 B) — — · — · —
ChatMessageList 29.2 kB (+7 B) · 7.8 kB CSS (+36 B) — — · — · —
Spinner 25.8 kB (+4 B) · 7.0 kB CSS (+36 B) — — · — · —
ProgressBar 12.5 kB (0) · 7.0 kB CSS (+38 B) — — · — · —
Timer 14.6 kB (+1 B) · 6.8 kB CSS (+34 B) — — · — · —
Text 12.1 kB (0) · 6.2 kB CSS (+31 B) — — · — · —
NavHeadingMenuItem 20.0 kB (−6 B) · 7.1 kB CSS (+29 B) — — · — · —
LayerProvider 4.4 kB (0) · 20 B CSS (0) — — · — · —
lab/LineClamp 14.6 kB (−1 B) · 168 B CSS (0) — — · — · —
charts/ChartLegend 43.5 kB (−25 B) · 224 B CSS (0) — — · — · —

Package size: @astryxdesign/core 8.07 MB packed (+2.5 kB); no new dependencies.

API changes: core +0 · ~1 · −0

1 API change (advisory)
Package Where Signature Usage
~ core ./Layer · Values · const layerAnimations const layerAnimations: Readonly<{ readonly below: Readonly<{ readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration", string>; readonly animationTimingFunction: styl … #3a6b9939 → const layerAnimations: Readonly<{ readonly below: Readonly<{ readonly animationDuration: stylex.StyleXClassNameFor<"animationDuration", string>; readonly animationTimingFunction: styl … #043dbac7 import {layerAnimations} from '@astryxdesign/core/Layer'

Wide change (shared styles: packages/core/src/Layer/layerAnimations.stylex.ts): add ci:run-visual for Visual, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

…it from useLayer

The side write left style dirty for the reads that follow a show in its own
task: the popover's focus move and the touch-target measurement each
restyled the layer again. The write now runs in the next animation frame,
before that frame's style pass and paint, so the entrance still starts from
the side (LayerEntranceSide's first-frame cases pass). In tests that hold
animation frames, the side's frame is not a wait for the trigger's box.

useLayer calls registerLayerEntranceProperties as its module loads, so the
registration does not rest on a side effect of a module imported for
values. The registration never throws; an unexpected failure warns in
development and costs only the restyle saving.

INV20, the layerAnimations doc and the changeset say layerAnimations reads
the side on the layer element or its direct child.
@cixzhang cixzhang changed the title perf(Layer): the entrance side properties stop at the element that plays the entrance perf(Layer): the entrance side restyles only its layer, in the next frame Nov 17, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec bb7a74f

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: one claim in the description does not hold yet.

  • The description says every layer keeps its landed side "from its first painted frame", but a layer opened from the anchor settle wait (its trigger had no box at the press) shows inside an animation-frame callback, so its first frame paints before the side is written one frame later; please write the side synchronously in that path, or describe the guarantee as the first visible frame.

Everything else holds up: an engineering owner approved the INV20 amendment for this head, the side reaches the element that plays the entrance and stops there, and the in-repo layers' visible entrance matches the base. That one frame is at opacity 0, so the fix is about accuracy, not anything a person sees. Optional suggestions are inline (cancel the side's frame on hide and unmount, and one comment's wording), and the changeset's 15 ms differs from the description's 16 ms.

Claims and files checked

Review mode: same-head; reason: none

Changed rules (0): none since the earlier review at this head.

Claims:

  • Opening a layer restyles less because the side no longer passes into the layer's content: verified (in Chromium the content inside the surface computes no side on this branch and inherits it on main).
  • The four properties are registered as not inherited; the call does nothing without the registration API, ignores a name that is already registered and warns on any other failure: verified (layerEntranceSide.ts:151-179, layerEntranceSide.test.ts).
  • The registration runs as useLayer loads: verified (useLayer.tsx:89).
  • The side is written in the next animation frame, before that frame's paint: verified (useLayer.tsx:696-721; in Chromium it lands in the next frame's callbacks).
  • Each entrance class inherits the four properties, and the JSDoc names the layer or its direct child: verified (layerAnimations.stylex.ts:134-145).
  • INV20 states when the side is written and where layerAnimations reads it: verified (layer-runtime.md:705-709).
  • Every layer keeps its landed side from its first painted frame: false for a show from the anchor settle wait (useLayer.tsx:958-980, then :720); true for press, hover and key opens.
  • The visible entrance is unchanged: verified (settled frames match the base; every first frame is at opacity 0).
  • An element deeper than the direct child plays its placement's default side: verified (the keyframe fallbacks in layerAnimations.stylex.ts:51-104).
  • The new scope spec fails on main: verified (on main the content computes the side).
  • Tests that hold frames skip the side's frame, and one test flushes a frame: verified (useLayer.test.tsx, useTooltip.test.tsx).
  • The unit suites pass: verified for the Layer, Tooltip and Popover suites at this head (305 tests); the other listed suites were not run here.
  • A Popover opens about 16 ms sooner and a menu about 6 ms sooner, with fewer restyled elements: not reproduced; the changeset says 15 ms.
  • First load grows by about 0.14-0.22 KB gzip: consistent with this branch's 0.2-0.3 KB per entry.
  • The changeset is a [perf] patch with the scope sentence: verified.

Files:

  • .changeset/layer-entrance-side-restyle.md: 15 ms vs the description's 16 ms (non-blocking).
  • docs/architecture/layer-runtime.md: clear (amendment approved for this head).
  • packages/core/src/Layer/__tests__/LayerEntranceSideScope.interaction.browser.spec.ts: clear.
  • packages/core/src/Layer/layerAnimations.stylex.ts: clear.
  • packages/core/src/Layer/layerEntranceSide.test.ts: clear.
  • packages/core/src/Layer/layerEntranceSide.ts: clear.
  • packages/core/src/Layer/useLayer.test.tsx: clear.
  • packages/core/src/Layer/useLayer.tsx: settle-wait first frame (blocking, description claim); uncancelled frame and comment wording (non-blocking).
  • packages/core/src/Tooltip/useTooltip.test.tsx: flushes the side's frame rather than expecting it cancelled (non-blocking).

Automated review (maintainer link)

Comment thread packages/core/src/Layer/useLayer.tsx Resolved
Comment thread packages/core/src/Layer/useLayer.tsx Resolved
…rvation

An animation frame callback queued by a show that itself runs in an
animation frame lands a frame late, so the entrance's first painted frame
could take the default side. The side is now written in the layer's first
resize observation, which runs after the next frame's layout and before its
paint, wherever the show runs; its read finds layout clean.

A new browser spec reads the first painted frame at 6x CPU, for a Popover
and a DropdownMenu placed above, below, at the start and at the end, from a
resize observer made after the layer's own. It fails when the write lands
after the first paint. In tests that hold resize observers, the entrance
side's observer is not a wait for the trigger's box or an overflow watch.
The registration's development warning is behind the production check, so
bundlers drop it.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 02e0a4e

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: one finding needs a fix before this can be approved.

  • writeEntranceSide (useLayer.tsx:716-725) adds its own one-shot ResizeObserver for a first notification after layout, which observeResizeAfterLayout in utils/sharedResizeObserver.ts already provides (text truncation and Selector use it for the same reason, and useLayer already uses that module); please build on it, extending it for the layer's own window and for an element it already watches, or say in the description and the JSDoc why it cannot serve.

The first-frame concern from the earlier revision stays fixed: a flipped Popover opened from the anchor settle wait paints its first entrance frame from its landed side, exactly as on main. An engineering owner approved the INV20 amendment for this head, so the narrower reach of layerAnimations is settled. The inline suggestions on this head still apply: a shorter JSDoc sentence, and the changeset's menu figure, which the description's tables put at 4-5 ms.

Claims and files checked

Review mode: same-head; reason: none

Claims:

  • Title: the entrance side restyles only its layer, in the next frame: verified in substance (the layer and the entrance element directly inside it take the side; the write lands at the next frame's resize observation, or the same frame's when the show runs inside an animation-frame callback).
  • Opening a layer restyles less because the side no longer passes into the layer's content: verified (in Chromium the content inside the surface computes no side on this branch and inherits it on main).
  • The four properties are registered as not inherited; the call does nothing without the registration API, ignores a name another copy registered and warns only in development on any other failure: verified (layerEntranceSide.ts:151-182, layerEntranceSide.test.ts).
  • The registration runs as useLayer loads: verified (useLayer.tsx:89).
  • The side is written at the layer's first resize observation, after the next layout and before that frame's paint, wherever the show runs: verified (useLayer.tsx:697-726; in Chromium the side is in the first painted frame for press-opened and settle-wait shows).
  • A write in the show's own task restyled the layer again for the focus move and the touch-target measurement: not reproduced (the author's profile).
  • Each entrance class inherits the four properties, and the JSDoc names the layer or its direct child: verified (layerAnimations.stylex.ts:134-147).
  • INV20 states when the side is written and where layerAnimations reads it: verified (layer-runtime.md:705-710).
  • The entrance is the same from its first painted frame, with the landing side's translate and origin: verified in Chromium for Popover and DropdownMenu (same first-frame values as main; settled frames identical).
  • The new scope spec fails on main: verified with an equivalent probe (on main the content computes the side); the spec itself was not run.
  • The first-paint spec checks four placements of Popover and DropdownMenu at 6x CPU, and a late write fails it: not run; its read (an observer made after the layer's own) is the one the probe used.
  • Tests that stub ResizeObserver skip the side's observer: verified (useLayer.test.tsx:4436-4441, Popover.test.tsx:472-488).
  • The earlier entrance-side browser spec passes all 20 cases, and WebKit runs in CI: not run; CI skipped this draft head.
  • Layer, Popover, DropdownMenu, Selector, HoverCard, Tooltip, ContextMenu, ComplexSelector, Breadcrumbs and PowerSearch unit suites pass: verified (2,609 tests); eslint is clean on the changed files; tsc, knowledge and changesets checks were not rerun.
  • Open-latency, profile and restyle-count figures: not reproduced.
  • The changeset's popover figure (about 15 ms) fits the tables; its menu figure (about 6 ms) is above their 4-5 ms (non-blocking).
  • First-load cost of +0.14-0.22 KB gzip: consistent (0.1-0.2 KB on the entries that reach the layer runtime, nothing on Text, Heading or List).
  • Known limit, a deeper element gets the default side: verified (keyframe fallbacks, layerAnimations.stylex.ts:51-104).

Files:

  • .changeset/layer-entrance-side-restyle.md: menu figure (non-blocking).
  • docs/architecture/layer-runtime.md: clear.
  • packages/core/src/Layer/__tests__/LayerEntranceFirstPaint.interaction.browser.spec.ts: clear (not run).
  • packages/core/src/Layer/__tests__/LayerEntranceSideScope.interaction.browser.spec.ts: clear (not run).
  • packages/core/src/Layer/layerAnimations.stylex.ts: clear.
  • packages/core/src/Layer/layerEntranceSide.test.ts: clear.
  • packages/core/src/Layer/layerEntranceSide.ts: clear.
  • packages/core/src/Layer/useLayer.test.tsx: clear.
  • packages/core/src/Layer/useLayer.tsx: the shared-observer finding above; JSDoc wording (non-blocking).
  • packages/core/src/Popover/Popover.test.tsx: clear.

Automated review (maintainer link)

Comment thread packages/core/src/Layer/useLayer.tsx Resolved
Comment thread packages/core/src/Layer/useLayer.tsx Resolved
@cixzhang cixzhang removed the needs:design-review Affects visuals — Design should review label Nov 20, 2026
# Conflicts:
#	docs/architecture/layer-runtime.md
#	packages/core/src/Layer/useLayer.tsx
@github-actions github-actions Bot added needs:design-review Affects visuals — Design should review needs:spec-owner-review Current knowledge records await owner approval labels Nov 20, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 2023dda

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 20, 2026
@cixzhang
cixzhang marked this pull request as draft November 21, 2026 03:38
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 21, 2026
@cixzhang cixzhang changed the title perf(Layer): the entrance side moves out of the press handler perf(Layer): the entrance side restyles only the layer and its direct child Nov 21, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec d8e9829

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 21, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI. CI has not run on this head yet because the pull request is a draft, so its WebKit interaction leg still has to confirm the entrance specs before merge. In Chromium the entrance is unchanged: 20 of 20 entrance-side cases, 8 of 8 first-paint cases and 2 of 2 scope cases pass, and the first-paint spec now skips outside Chromium.

Non-blocking:

  • Three comments still say a write restyles only the layer and that the entrance element takes the side from its parent (layerAnimations.stylex.ts:129-133, layerEntranceSide.ts:146-148, useLayer.tsx:87), but the runtime now writes each direct child too.
  • "A deeper element plays its placement's default side" (the changeset and the layerAnimations JSDoc) overstates the limit, since in Chromium an element two levels down that carries the class still inherits the side; "a deeper element is not guaranteed the side" holds in every engine.
  • The description has no ## Writing rubric results section, which docs/contributing/pull-requests.md asks for when a pull request changes a record.
Claims and files checked

Review mode: full; reason: spec-record

  • Claim: the side values reach the layer and its direct child, not the content inside: verified (registration and write loop in layerEntranceSide.ts; scope spec 2 of 2 in Chromium; a browser probe shows the content computing no side).
  • Claim: the entrance is unchanged in Chromium and WebKit: verified in Chromium (20 of 20 entrance-side cases, 8 of 8 first-paint cases, 19 of 19 touch-motion cases, identical frames paused mid-entrance); WebKit stated from the author's runs, pending CI.
  • Claim: a Popover open restyles about 145 elements instead of 190, and its press handler finishes 3.4 ms sooner with 1.4 ms less forced layout: stated from the author's Chromium traces; consistent with the mechanism.
  • Claim: layerAnimations gives the landed side on the layer or its direct child: verified; the sentence that a deeper element plays its default side overstates the limit (non-blocking).
  • Claim: the registration is non-inherited, never throws, does nothing without the browser API, accepts a duplicate and warns only in development otherwise: verified (layerEntranceSide.ts:155-186; unit tests).
  • Claim: the write covers the layer and each direct element child: verified (layerEntranceSide.ts:214-224).
  • Claim: the registration runs as the layer module loads, and the side is still written in the show's own task: verified (useLayer.tsx:91, useLayer.tsx:797-816).
  • Claim: each entrance class inherits the four properties, and the docs name the layer or its direct child: verified (layerAnimations.stylex.ts:134-145).
  • Claim: the layer runtime record's entrance invariant names where the side is read: verified; approved by an engineering owner for this head.
  • Claim: the unit tests cover registration, its absence, a duplicate and an unexpected failure: verified (they pass).
  • Claim: the scope spec fails on main: consistent (on the base the content computes the side).
  • Claim: the first-paint spec runs in Chromium only and proves the landing side for four placements of a Popover and a DropdownMenu: verified (8 of 8; it skips in other engines).
  • Claim: the changeset is a perf patch: verified; the changeset check passes.
  • Claim: WebKit container runs show no misses, and the earlier deferred writes missed cold first frames: stated.
  • Claim: the timing table against an earlier main: stated.
  • Claim: the unit suites pass 2,744 of 2,744, and type check, lint, knowledge and changeset checks are clean: verified at this head.
  • Claim: most of the earlier press-handler cost remains, and deeper elements get the default side: consistent with the code.
  • File: .changeset/layer-entrance-side-restyle.md: deeper-element wording (non-blocking).
  • File: docs/architecture/layer-runtime.md: clear (owner-approved sentence).
  • File: packages/core/src/Layer/__tests__/LayerEntranceFirstPaint.interaction.browser.spec.ts: clear; the earlier WebKit finding is fixed.
  • File: packages/core/src/Layer/__tests__/LayerEntranceSideScope.interaction.browser.spec.ts: clear.
  • File: packages/core/src/Layer/layerAnimations.stylex.ts: stale comment and deeper-element wording (non-blocking).
  • File: packages/core/src/Layer/layerEntranceSide.test.ts: clear.
  • File: packages/core/src/Layer/layerEntranceSide.ts: stale JSDoc sentence (non-blocking).
  • File: packages/core/src/Layer/useLayer.tsx: stale comment sentence (non-blocking).

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 0136a9e

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested. The restyle narrowing works in the page, but the new write misses layers that render in another window's document.

  • Miss: writeLayerEntranceSide skips every element that is not instanceof HTMLElement (packages/core/src/Layer/layerEntranceSide.ts:218), and a layer portalled into a same-origin iframe or a Picture-in-Picture window belongs to that window, so no side is written and its entrance scales about the centre and, after a flip, moves toward its trigger; use isHTMLElement from ../utils/nodeType and add a second-document test.
  • Miss: the changeset's "The entrance is unchanged" (.changeset/layer-entrance-side-restyle.md:5) does not hold in a second document at this head, and it holds again once the guard is fixed.

The earlier non-blocking notes (stale comments about who receives the side, the deeper-element wording, and the missing ## Writing rubric results section) still apply. CI has not run on this draft head, so its WebKit leg still has to confirm the entrance.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: the side values reach the layer and its direct child, not the content inside: verified in the page (browser probe; scope spec); false in a second document, where nothing is written.
  • Claim: the entrance is unchanged in Chromium and WebKit, from its first painted frame: verified in the page in Chromium (probe; entrance-side, first-paint and touch-motion specs on unchanged package code); false in a same-origin iframe (probe); WebKit stated by the author, pending CI.
  • Claim: a Popover open restyles about 145 elements instead of 190, and its press handler finishes 3.4 ms sooner with 1.4 ms less forced layout: stated from the author's traces; consistent with the mechanism.
  • Claim: layerAnimations gives the landed side on the layer or its direct child, and a deeper element plays its default side: verified in the page; the deeper-element half overstates the limit (non-blocking).
  • Claim: the registration is non-inherited, never throws, does nothing without the browser API, accepts a duplicate and warns only in development otherwise: verified (layerEntranceSide.ts:155-186; unit tests).
  • Claim: the write covers the layer and each direct element child: verified for elements of the page's own window; false for another window's elements (layerEntranceSide.ts:218).
  • Claim: the registration runs as the layer module loads, and the side is still written in the show's own task: verified (useLayer.tsx:91, useLayer.tsx:793-816).
  • Claim: each entrance class inherits the four properties, and the docs name the layer or its direct child: verified (layerAnimations.stylex.ts:129-145).
  • Claim: the layer runtime record's entrance invariant now names where the side is read: verified; approved by an engineering owner for this head.
  • Claim: the unit tests cover registration, its absence, a duplicate and an unexpected failure: verified (they pass).
  • Claim: the scope spec fails on main: consistent (on the base the content computes the side).
  • Claim: the first-paint spec runs in Chromium only, for four placements of a Popover and a DropdownMenu: verified (it skips other engines).
  • Claim: the changeset is a perf patch: verified.
  • Claim: WebKit container runs show no misses, and the earlier deferred writes missed cold first frames: stated.
  • Claim: the timing table against an earlier main: stated.
  • Claim: the unit suites pass 2,744 of 2,744, and type check, lint, knowledge and changeset checks are clean: unit suites and the Core type check verified at this head; lint, knowledge and changeset checks unchanged since they last passed.
  • Claim: most of the earlier press-handler cost remains, and deeper elements get the default side: consistent with the code.
  • File: .changeset/layer-entrance-side-restyle.md: false entrance claim (blocking); deeper-element wording (non-blocking).
  • File: .github/playwright-leg-durations.json: clear (two planning entries for the new specs).
  • File: docs/architecture/layer-runtime.md: clear (owner-approved sentence).
  • File: packages/core/src/Layer/__tests__/LayerEntranceFirstPaint.interaction.browser.spec.ts: clear.
  • File: packages/core/src/Layer/__tests__/LayerEntranceSideScope.interaction.browser.spec.ts: covers the page only; the second-document case is missing.
  • File: packages/core/src/Layer/layerAnimations.stylex.ts: stale comment and deeper-element wording (non-blocking).
  • File: packages/core/src/Layer/layerEntranceSide.test.ts: clear.
  • File: packages/core/src/Layer/layerEntranceSide.ts: cross-window guard (blocking); stale JSDoc sentence (non-blocking).
  • File: packages/core/src/Layer/useLayer.tsx: stale comment sentence (non-blocking).

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 55f4ea1

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested. The entrance is unchanged in Chromium, in the page and in a same-origin iframe, and the exact-head spec approval covers the layerAnimations depth change; one wording-or-registration fix remains.

  • Miss: the title and changeset say every anchored layer restyles fewer elements, but registerLayerEntranceProperties() registers the properties only in the window that loads useLayer (packages/core/src/Layer/useLayer.tsx:91), so a layer in a same-origin iframe or a Picture-in-Picture window still passes the side to all of its content; either say "in the document that loads Astryx" in the title, changeset and description, or register the properties in the layer's own window and run the scope spec on the second-document story.

The earlier non-blocking notes (stale comments about who receives the side, the deeper-element wording, and the missing ## Writing rubric results section) still apply. CI has not run on this draft head, so its WebKit leg still has to confirm the entrance.

Claims and files checked

Review mode: same-head; reason: none

  • Changed rules (0): none.
  • Claim: the side values reach the layer and its direct child, not the content inside: verified in the page (browser probe); false in a second document, where the content still inherits them (blocking).
  • Claim: the entrance is unchanged in Chromium and WebKit, from its first painted frame: verified in Chromium in the page and in a same-origin iframe (probes and pixel-identical frames); WebKit stated by the author, pending CI.
  • Claim: a Popover open restyles about 145 elements instead of 190, and its press handler finishes 3.4 ms sooner with 1.4 ms less forced layout: stated from the author's traces; consistent with the mechanism in the page only.
  • Claim: layerAnimations gives the landed side on the layer or its direct child, and a deeper element plays its default side: the first half verified; the second half overstates the limit (non-blocking).
  • Claim: the registration is non-inherited, never throws, does nothing without the browser API, accepts a duplicate and warns only in development otherwise: verified (layerEntranceSide.ts:156-187; unit tests pass).
  • Claim: the write covers the layer and each direct element child: verified, for any window's elements (layerEntranceSide.ts:218-225; the cross-window unit case guards it).
  • Claim: the registration runs as the layer module loads, and the side is still written in the show's own task: verified (useLayer.tsx:91, useLayer.tsx:797-816).
  • Claim: each entrance class inherits the four properties, and the docs name the layer or its direct child: verified (layerAnimations.stylex.ts:129-145).
  • Claim: the layer runtime record's entrance invariant now names where the side is read: verified; approved by an engineering owner for this head.
  • Claim: the unit tests cover registration, its absence, a duplicate and an unexpected failure: verified (16 of 16 pass).
  • Claim: the scope spec fails on main: consistent (on the base the content computes the side); it opens page stories only.
  • Claim: the first-paint spec runs in Chromium only, for four placements of a Popover and a DropdownMenu: verified (it skips other engines).
  • Claim: the changeset is a perf patch for Core: verified; the changeset check passes.
  • Claim: WebKit container runs show no misses, and the earlier deferred writes missed cold first frames: stated.
  • Claim: the timing table against an earlier main: stated.
  • Claim: the unit suites pass, and type check, lint, knowledge and changeset checks are clean: Layer, Popover, Tooltip and DropdownMenu suites (1,387 of 1,387), the Core build's type check, lint on the changed files and the changeset check verified at this head; the knowledge check not run.
  • Claim: most of the earlier press-handler cost remains, and deeper elements get the default side: consistent with the code.
  • File: .changeset/layer-entrance-side-restyle.md: restyle claim too broad (blocking); deeper-element wording (non-blocking).
  • File: .github/playwright-leg-durations.json: clear (two planning entries for the new specs).
  • File: docs/architecture/layer-runtime.md: clear (owner-approved sentence).
  • File: packages/core/src/Layer/__tests__/LayerEntranceFirstPaint.interaction.browser.spec.ts: clear.
  • File: packages/core/src/Layer/__tests__/LayerEntranceSideScope.interaction.browser.spec.ts: covers the page only; the second-document case is part of the blocking fix.
  • File: packages/core/src/Layer/layerAnimations.stylex.ts: stale comment and deeper-element wording (non-blocking).
  • File: packages/core/src/Layer/layerEntranceSide.test.ts: clear (the cross-window case guards the direct-child write).
  • File: packages/core/src/Layer/layerEntranceSide.ts: stale JSDoc sentence (non-blocking).
  • File: packages/core/src/Layer/useLayer.tsx: registration reaches only the loading window (blocking); stale comment sentence (non-blocking).

Automated review (maintainer link)

Comment thread packages/core/src/Layer/useLayer.tsx Resolved
…yx; comments name the elements the side is written on
@cixzhang cixzhang changed the title perf(Layer): the entrance side restyles only the layer and its direct child perf(Layer): in the loading document, the entrance side restyles only the layer and its direct child Nov 21, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec b366a74

@cixzhang cixzhang added ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) lane:1 Astryx fix-loop lane 1 owns this labels Nov 21, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI. The restyle saving is now described for the document that loads Astryx, in the title, changeset and description, which clears the last blocker, and the entrance-side invariant's added sentence has an engineering owner's approval for this head. CI has not run on this draft head yet, so its WebKit interaction leg still has to confirm the entrance before merge.

  • Non-blocking: the description's Builders line says an element nested deeper "plays its placement's default side"; in Chromium a grandchild that carries the class still inherits the side, so "is not guaranteed the landed side", as the changeset and the layerAnimations docs now say, would match them.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: in the loading document the side values reach the layer and its direct child, not the content inside: verified (browser probe: 1 of 41 Popover descendants and 1 of 14 menu descendants compute the side, against all of them on the base).
  • Claim: the entrance is unchanged in Chromium and WebKit, from its first painted frame: verified in Chromium (identical first painted frames, pixel-identical settled frames for a flipped Popover and a DropdownMenu); WebKit stated by the author, pending CI.
  • Claim: a Popover open restyles about 145 elements instead of 190, and its press handler finishes 3.4 ms sooner with 1.4 ms less forced layout: stated from the author's traces; consistent with the 40 fewer elements that compute the side.
  • Claim: layerAnimations gives the landed side on the layer or its direct child, and a deeper element plays its default side: the first half verified; the second half is narrower than the code (non-blocking).
  • Claim: the registration is non-inherited, never throws, does nothing without the browser API, accepts a duplicate and warns only in development otherwise: verified (layerEntranceSide.ts:157-188; unit tests pass).
  • Claim: the write covers the layer and each direct element child, with a cross-window check: verified (layerEntranceSide.ts:219-226; the cross-window unit case guards it).
  • Claim: the registration runs as the layer module loads, and the side is still written in the show's own task: verified (useLayer.tsx:91; the write's call sites are unchanged from the base).
  • Claim: each entrance class inherits the four properties, and the docs name the layer or its direct child: verified (layerAnimations.stylex.ts:129-143).
  • Claim: the layer runtime record's entrance invariant now names where the side is read: verified; approved by an engineering owner for this head.
  • Claim: the unit tests cover registration, its absence, a duplicate and an unexpected failure: verified (the Layer suites pass).
  • Claim: the scope spec fails on the base: consistent (on the base the deepest content computes the side).
  • Claim: the first-paint spec runs in Chromium only, for four placements of a Popover and a DropdownMenu: verified (it skips other engines).
  • Claim: the changeset is a perf patch for Core, credited to its contributor: verified; the changeset check passes.
  • Claim: WebKit container runs show no misses, and the earlier deferred writes missed cold first frames: stated.
  • Claim: the Chromium spec counts and the timing table: stated.
  • Claim: the unit suites pass, and type check, lint, knowledge and changeset checks are clean: seven of the eleven named suites (1,961 tests), the Core build, lint and formatting on the changed files, and the knowledge and changeset checks verified at this head.
  • Claim: most of the earlier press-handler cost remains, deeper elements are not guaranteed the side, and second documents keep inheriting the side: consistent with the code.
  • File: .changeset/layer-entrance-side-restyle.md: clear.
  • File: .github/playwright-leg-durations.json: clear (two planning entries for the new specs).
  • File: docs/architecture/layer-runtime.md: clear (owner-approved sentence).
  • File: packages/core/src/Layer/__tests__/LayerEntranceFirstPaint.interaction.browser.spec.ts: clear.
  • File: packages/core/src/Layer/__tests__/LayerEntranceSideScope.interaction.browser.spec.ts: clear.
  • File: packages/core/src/Layer/layerAnimations.stylex.ts: clear.
  • File: packages/core/src/Layer/layerEntranceSide.test.ts: clear.
  • File: packages/core/src/Layer/layerEntranceSide.ts: clear.
  • File: packages/core/src/Layer/useLayer.tsx: clear.

Automated review (maintainer link)

# Conflicts:
#	.github/playwright-leg-durations.json
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 77a92ad

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI. The entrance-side invariant's added sentence has an engineering owner's approval for this head, no blocking finding remains, and CI's interaction legs now pass the entrance-side spec in both Chromium and WebKit. The unit-test jobs are still running on this head and have to pass before merge.

  • Non-blocking: the description's Builders line says an element nested deeper "plays its placement's default side"; in Chromium a grandchild that carries the class still inherits the side, so "is not guaranteed the landed side", as the changeset and the layerAnimations docs say, would match them.
Claims and files checked

Review mode: same-head; reason: none

  • Claim: in the loading document the side values reach the layer and its direct child, not the content inside: verified (layerEntranceSide.ts:157-188, :219-226; the scope spec passes on CI in Chromium and WebKit).
  • Claim: the entrance is unchanged in Chromium and WebKit, from its first painted frame: verified (the entrance-side spec passes 20 of 20 in each engine on CI; the first-paint spec passes 8 of 8 in Chromium).
  • Claim: a Popover open restyles about 145 elements instead of 190, and its press handler finishes 3.4 ms sooner with 1.4 ms less forced layout: stated from the author's traces; consistent with the 40 fewer elements that compute the side.
  • Claim: layerAnimations gives the landed side on the layer or its direct child, and a deeper element plays its default side: the first half verified (layerAnimations.stylex.ts:141-143); the second half is narrower than the code (non-blocking).
  • Claim: the registration is non-inherited, never throws, does nothing without the browser API, accepts a duplicate and warns only in development otherwise: verified (layerEntranceSide.ts:157-188).
  • Claim: the write covers the layer and each direct element child, with a cross-window check: verified (layerEntranceSide.ts:219-226).
  • Claim: the registration runs as the layer module loads, and the side is still written in the show's own task: verified (useLayer.tsx:91, :1877).
  • Claim: each entrance class inherits the four properties, and the docs name the layer or its direct child: verified (layerAnimations.stylex.ts:129-143).
  • Claim: the layer runtime record's entrance invariant now names where the side is read: verified (layer-runtime.md:738-739); approved by an engineering owner for this head.
  • Claim: the unit tests cover registration, its absence, a duplicate, an unexpected failure and the cross-window write: verified (layerEntranceSide.test.ts:135-205).
  • Claim: the scope spec checks the entrance element against its deepest content and fails on the base: passes at this head (LayerEntranceSideScope.interaction.browser.spec.ts:52-92); on the base the deepest content inherits the side, so it fails there.
  • Claim: the first-paint spec runs in Chromium only, at 6× CPU, for four placements of a Popover and a DropdownMenu: verified (LayerEntranceFirstPaint.interaction.browser.spec.ts:102-116; CI ran 8 cases in Chromium and skipped them in WebKit).
  • Claim: the changeset is a perf patch for Core, credited to its contributor: verified.
  • Claim: WebKit runs show no misses with the write kept in the show's task: consistent with CI's WebKit leg on this head.
  • Claim: the Chromium spec counts and the clean type check, lint and changeset checks: verified on CI; the timing table and unit-suite totals are stated, and CI's unit jobs are still running.
  • Claim: every reader of the side is a layerAnimations class on the layer or its direct child, in the listed components: verified (the callers are the same at base and head).
  • Claim: Chromium entrance frames match main frame for frame: stated; consistent with identical first frames probed on this patch earlier.
  • Claim: most of the earlier press-handler cost remains, deeper elements are not guaranteed the side, and second documents keep inheriting the side: consistent with the code.
  • File: .changeset/layer-entrance-side-restyle.md: clear.
  • File: .github/playwright-leg-durations.json: clear (planning entries for the two new specs).
  • File: docs/architecture/layer-runtime.md: clear (owner-approved sentence).
  • File: packages/core/src/Layer/__tests__/LayerEntranceFirstPaint.interaction.browser.spec.ts: clear.
  • File: packages/core/src/Layer/__tests__/LayerEntranceSideScope.interaction.browser.spec.ts: clear.
  • File: packages/core/src/Layer/layerAnimations.stylex.ts: clear.
  • File: packages/core/src/Layer/layerEntranceSide.test.ts: clear.
  • File: packages/core/src/Layer/layerEntranceSide.ts: clear.
  • File: packages/core/src/Layer/useLayer.tsx: clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 25, 2026 19:03

This branch was successfully deployed

1 active deployment
Preview — 77a92ad1 Deployed Nov 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot. lane:1 Astryx fix-loop lane 1 owns this needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant