Repository navigation
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack: #8084 → #8095
#8084 lands first. Review only this pull request's change: vjeux/astryx@62c9b4a...8226b5e
User need
On a phone, AlertDialog stacks its two buttons at full width, so "Cancel" and "Delete" take two rows. Under a finger on a compact screen, two short actions now share one row in equal halves, Cancel leading. A label too long for its half stacks them, the destructive action above Cancel: as before on a portrait phone, and new on a landscape phone, where the actions used to sit in a trailing row. With a mouse nothing changes.
Problem and solution fit
Current specification
Specs decision, 2026-11-04: compact touch screens get the shared row (
component:AlertDialogDEC-5). The rule is iOS's: per label, never by the two widths together (alertController.actions.rowShare). The row itself is Astryx's: Astryx Buttons, the footer'sStackgap token, and the theme's type and colors. Nothing of iOS's styling is copied.spec:AST-012FR9 defines a compact window. The record gains FR3's compact touch layout, PR1's title observation and DEC-5.Public delta and caller burden
No API change, and no decision for callers: a label too long for its half stacks the actions on its own. Under a finger on a compact screen, two short actions share a row; with a mouse nothing changes.
Design and alternatives
flex-wrap. No script, but it wraps on the sum of both widths and keeps the DOM order when it wraps, so Cancel would land on top, and visual and tab order would disagree.Only option 3 expresses the per-label rule and keeps visual, DOM and tab order together. It watches the alert's title, whose size the actions never change, so a decision never resizes what it watches and starts no resize observer loop. It also listens for web fonts, which change a label's width without changing the title's size. It commits before the first paint.
Evidence
On a phone, on this head's preview:
The spec owner's real-phone check of the action layout, edge cases and long labels included, passed (2026-11-05).
Real Chromium renders of the inline alert story under a coarse pointer, 320 px on the left, 390 px on the right. They were taken at 1f61aea; at this head the same cases render the same pixels, apart from the loading spinner's angle.
Review follow-ups
The earlier review's items, on this rebuild:
pointerTypes: ['touch', 'pen']), as on main. The usage doc now says so; it still read "every pointer".flushSyncduring the observer's registration call inside the layout effect. A unit case renders under StrictMode and logs no React error; it fails with the old hook.[feat].component:AlertDialogFR3, PR1 and DEC-5 record the specs decision (2026-11-04).This round's review, at 1f61aea:
isOpenfalse, then opened) each fail without that.isInerttracker option.And at 93ae42e:
equalHalfAction, without a comment restating it.One test change outside the layout: #8084's busy-main-thread proof now counts a frame as "the alert changed" by the mean absolute change of the region's pixels, not by the change of their mean. With the row's shorter alert, a frame came where the alert changed but the region's mean luminance moved by only 0.044: the fade's gain was cancelled by text crossing the region's edge as the alert scaled. That missed frame failed 6 of 9 runs on two cores; with the new measure 6 of 6 pass. A still alert during the block still reads as missed on every frame of the control (58 of 58).
Scope
Testing
Local gates at 8226b5e, on #8084's head 62c9b4a (main 252b45b):
CI=true pnpm lint(no errors), the build,pnpm typecheck, Storybook,pnpm test:ui(20,121),check:knowledgeandcheck:repopass. Inpnpm test:node16,453 passed, and only feat(AlertDialog): under a finger the alert appears and leaves the way iOS's does #8084's twoci-interaction-webkit.test.mjscases failed, both onmodalOutlet.ts; ci: the WebKit interaction lane covers the modal outlet #10018 clears them.api:report --checkreports drift already on main (DropdownMenu, the CLI), none of it from this change.Writing rubric results
component:AlertDialog: FR3 states the compact touch layout, with visual, DOM and tab order together and Cancel's initial focus in every layout; PR1 adds the title observation and the web-font listener; DEC-5 records the decision and the rejected alternative; the Behavior row and the FR1–FR5 verification row name the layout and its tests; the Compatibility bullet adds FR3.alertController.actions.rowShare(measured, iOS 26.2); the decision's is DEC-5.