Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Approval needs a maintainer to provide or identify the governing spec for this new breaking reset.css contract (no current spec covers reset.css, so spec:AST-017 FR33 makes it an owner decision) and to settle its release, since FR31 refuses the [breaking] changeset while main declares 0.7.1 (the routes are an owner bump to 0.8.0 or an opt-in for 0.7.1). Whatever they decide, two fixes are needed:
- Rebase on
main, where #7520 landed the same until-found selector, so all three reset files now conflict. - Update the
reset.cssheader, which still says unlayered consumer styles always override every Astryx layer.
[Automated review]
| :where([hidden]) { | ||
| display: none; | ||
| :where([hidden]:not([hidden='until-found' i])) { | ||
| display: none !important; |
There was a problem hiding this comment.
With !important here, this file's header (lines 29–30) stops being true: it still says unlayered consumer styles always override all Astryx layers and that the reset can be overridden by any other layer. Unlayered and later-layer display declarations now lose to this rule even when they are !important themselves (Chromium 149 computes display: none for both). Please carve the [hidden] rule out in that header.
There was a problem hiding this comment.
Fixed in ba58741: the header now says the [hidden] rule's display: none !important is the one exception, beating any display from a later layer or an unlayered style, !important included. The Pages copy and its hash moved with it.
|
|
||
| [breaking] `reset.css` now keeps a `hidden` element hidden when its own styles set `display`. The reset's `[hidden]` rule had zero specificity in the lowest layer, so a `display` from a class, a later layer, an unlayered rule or an inline style showed the element again. The rule is now `display: none !important`, which outranks every layer and unlayered rule; `hidden="until-found"` keeps the browser's own rendering, so find in page can still reveal it. | ||
|
|
||
| To keep an element visible while it carries `hidden`, remove the attribute, or set an inline `style="display: … !important"`, the one declaration that still wins. There is no codemod: whether a stylesheet shows a hidden element on purpose cannot be read from its source. |
There was a problem hiding this comment.
Inline !important is not the only declaration that still wins: an !important in a cascade layer declared before reset also beats this rule (Chromium 149 computes display: flex). Line 5's "outranks every layer" and the rule's comment in reset.css ("only an inline !important style still wins") overstate it the same way; consider dropping the exclusivity or naming that case.
There was a problem hiding this comment.
Fixed in ba58741: the changeset says the rule outranks every later layer and unlayered rule, !important ones included, and the migration names both overrides, inline !important or !important in a layer declared before reset. The rule's comment says the same, and the browser spec checks the earlier-layer case (flex in Chromium 149 and WebKit 26.5).
530e8ca to
963606f
Compare
|
Real Safari check (iOS simulators, Safari 18.6 and Safari 26.2): hidden elements with a later-layer class, an unlayered rule and an inline |
|
Maintainer decision (ENGOWNER), for ba58741:
|
There was a problem hiding this comment.
Approval needs a maintainer decision first: spec:AST-080 FR3 says a product's unlayered CSS stays above every Astryx layer, and this rule's display: none !important deliberately makes hidden elements beat that CSS, so a maintainer has to amend FR3 to carve out the [hidden] rule or decline the change. If FR3 is amended, the [breaking] changeset can merge only once main declares the 0.8.0 minor (spec:AST-017 FR31, FR48); it declares 0.7.2 today. Independently of that decision, please rebase on main: .github/pages/assets/manifest.json conflicts, so both reset.css copies need main's changes plus this rule and a recomputed hash.
[Automated review]
ba58741 to
69e9433
Compare
|
Acknowledged: |
There was a problem hiding this comment.
Approval needs a maintainer decision first: spec:AST-080 FR3 says a product's unlayered CSS stays above every Astryx layer, and this rule's display: none !important deliberately makes hidden elements beat that CSS, so a maintainer has to update FR3 to carve out the [hidden] rule or decline the change. If FR3 is amended, the [breaking] changeset can merge only once main declares the 0.8.0 minor (spec:AST-017 FR31, FR48); it declares 0.7.2 today. Nothing else needs work: the branch now sits on current main, both reset.css copies and the manifest hash match, and the new tests fail on the old rule and pass on this one.
[Automated review]
69e9433 to
f0bee9d
Compare
There was a problem hiding this comment.
Approval needs a maintainer to update an existing spec first: spec:AST-080 FR3 says a product's unlayered CSS stays above every Astryx layer, and this rule's display: none !important deliberately makes hidden elements beat that CSS, so FR3's owner has to carve out the [hidden] rule or decline the change. If FR3 is amended, the [breaking] changeset can merge only once main declares the 0.8.0 minor (spec:AST-017 FR31, FR48); it declares the patch 0.7.3 today, which is why check:changesets fails. The code itself needs no changes: both reset.css copies and the manifest hash match main plus this rule, and the new tests fail on the old rule and pass on this one. When you rebase for the release, the unrelated pr-a11y failure (a step for a spec file main added after this branch's base) clears too.
[Automated review]
… set
The reset's `:where([hidden]) { display: none }` had zero specificity in
the lowest layer, so any `display` from a class, a later layer, an
unlayered rule or an inline style beat it and the hidden element showed:
`<div hidden class="flex">` computed `display: flex` in Chromium and
WebKit. Astryx's own BottomSheet, DropdownMenuSubMenu and menu drill-in
wrapper each pair `hidden` with a separate `display: none` class for that
reason.
The rule is now `display: none !important`, which in the lowest layer
outranks every later layer and unlayered rule; an inline `!important`
style still wins. Tailwind Preflight and Bootstrap Reboot, which the file
names as models, do the same. The selector already skips
`hidden="until-found"` (meta#7520), so the `!important` cannot take that
content out of find in page.
Pages that show an element carrying `hidden` through their own `display`
will now hide it, so the changeset is [breaking] (spec:AST-017 FR32) and
names the migration. `check:changesets` rejects it while main declares a
patch, so this commit skipped the pre-commit hook after its other steps
ran by hand.
The GitHub Pages landing serves a byte-identical copy of the file, which
its test requires to match, so the copy and its manifest hash move with it.
f0bee9d to
4db0837
Compare
There was a problem hiding this comment.
Approval needs a maintainer to update an existing spec first: spec:AST-080 FR3 says a product's unlayered CSS stays above every Astryx layer, and this rule's display: none !important deliberately makes hidden elements beat that CSS, so FR3's owner has to carve out the [hidden] rule or decline the change. If FR3 is amended, the [breaking] changeset can merge only once main declares the 0.8.0 minor (spec:AST-017 FR31, FR48); it still declares the patch 0.7.3, which is why check:changesets fails. The code itself needs no changes: both reset.css copies and the manifest hash match main plus this rule, and the new tests fail on the old rule and pass on this one. The pr-rtl failure comes from its vega shard failing to install pnpm before any test ran, so a re-run should clear it.
[Automated review]
The reset's header said every later layer and unlayered style overrides the reset; the `[hidden]` rule's `display: none !important` is now the one exception, and the header says so. The rule's comment and the changeset no longer call an inline `!important` the only override: an `!important` in a layer declared before `reset` also wins, and the browser spec now checks that case.
4db0837 to
8805a9f
Compare
There was a problem hiding this comment.
Approval needs a maintainer to update an existing spec first: spec:AST-080 FR3 says a product's unlayered CSS stays above every Astryx layer, and this rule's display: none !important deliberately makes hidden elements beat that CSS, so FR3's owner has to carve out the [hidden] rule or decline the change. If FR3 is amended, the [breaking] changeset can merge only once main declares the 0.8.0 minor (spec:AST-017 FR31, FR48); it now declares the patch 0.7.4, which is why check:changesets fails. The code itself needs no changes: both reset.css copies and the manifest hash match main plus this rule, and the new tests fail on the old rule and pass on this one.
[Automated review]
…#8381) ## User impact **Why:** Keyboard and screen reader users lose their place when a dialog inside an iframe closes: both ways to close it (2 of 2: Escape or a button) send focus to the frame's empty page. **What:** The dialog now returns focus to the control that opened it, with a ring after a key, none after a click. Picture-in-Picture windows were already fine. **How to check:** In the "Dialog in a second document" story, open the frame's dialog and press Escape: focus returns to "Open dialog", with its ring. ## Problem and solution fit What led here: we hit this moving one product onto Astryx, which renders some UI in a second window. Dialog remembers its opener as the page's `document.activeElement`, which for focus inside an iframe is the `<iframe>`. Focusing that `<iframe>` on close moves the frame's focus to its `<body>`. Options: - Follow the page's active element into iframes: misses Picture-in-Picture windows, which the page cannot see into. - Always read the dialog's own document: a page control opening a dialog inside an iframe would lose focus. - Read the dialog's own document while it has focus, else the page's: covers both. Chosen. For the ring, Dialog tracks its own document's input, which the page never hears. Skipping its focus call would change the page, where it hides WebKit's ring after a click. ## Expected behavior and authority `component:Dialog` (current) FR4 and AR2: closing returns focus to the element that opened it. `architecture:interaction-modality` (current) INV1: programmatic focus shows the ring only after keyboard input. Neither is page-only; #7356 fixed this for Popover. ## Smallest restoration - `Dialog.tsx`: record the opener as above, take the entry direction from its window, return focus with its document's modality. - Internal utils: `trackInteractionModalityIn(doc)`, counted so the last mounted Dialog removes its listeners; an optional document for `getInteractionModality`; an optional modality for `focusForLastInput`, which checks text fields against their own window. The page's tracker and other callers are unchanged. No public API, visual or timing change. ## Evidence - Reproduction before the change: main fails the iframe cases in Chromium and WebKit. - Result after the change: every case passes. - Representative unchanged path: the page Dialog passes before and after; the page's modality ignores other documents. - Regression test or other mutation-sensitive proof: the Testing cases, red without the fix. ## Scope - [x] One defect is restored. - [x] Separable contradictory or unsettled tagalongs were removed or split. - [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label. - [x] Public text and artifacts contain no internal Meta context. ## Testing - Unit tests (Vitest), 115 files and 3137 tests: Dialog and every other component that returns focus or reads the last input. New cases cover a control inside an iframe, a control in the page, a text field, and the input listeners going away when the last Dialog unmounts. Each new case fails on the code from before the fix it covers. - Browser test in Chromium, 10 cases (`DialogSecondDocument.a11y.browser.spec.ts`): the dialog in the page, an iframe and a Picture-in-Picture window, closed with Escape, with a click, and after a text field opened it, plus a page button that opens a dialog in the iframe. All pass. With the code from before the last review round (0d47027), the iframe and Picture-in-Picture text-field cases fail; with main's `Dialog.tsx`, the iframe cases fail. - The same test in WebKit 26.5: 7 pass, and the 3 Picture-in-Picture cases are skipped, since only Chromium has that window. - CI finds the test by its file name (#8367), and its routing line also covers its story and the two utilities. Locally, `pnpm test:a11y-contract:pr origin/main` picks it and passes 115 browser tests. - Typecheck, repo checks, ESLint and Prettier pass. Merged with our open #7732, #8014 and #7524, typecheck and the utility tests (516) pass; #7525, #7527 and #7529 each merge cleanly with this change.
|
Closing this, since |
User impact
Why: anyone who hides a styled element with
hiddenunder Astryx's reset: if its styles setdisplay, it stays visible. Astryx itself works around this in three places.What led to it: one product we're moving onto Astryx carries its own
[hidden]fix.Problem and solution fit
Options and tradeoffs:
!importantin the reset (this PR; breaking, since pages that show a hidden element throughdisplaysee it hide); adisplay: noneclass beside eachhidden, as BottomSheet and the menus do (every product must remember); or a stronger selector without!important(still loses to later layers and unlayered rules).Why this choice:
hiddenshould hide, as in Tailwind Preflight and Bootstrap Reboot, the resets this file names as models.Expected behavior and authority
spec:AST-017FR32 makes this[breaking], admitted only in a declared minor (FR31).spec:AST-080FR3 (current) keeps a product's unlayered CSS above every Astryx layer, and this!importantdeliberately beats it. The one owner decision: whether FR3 carves out the[hidden]rule.Smallest restoration
reset.css:display: none !importanton[hidden](an inline or earlier-layer!importantstill wins; the header notes it), keeping fix(core): reset.css leaves hidden="until-found" content findable #7520's until-found exclusion. The Pages copy and its pinned hash follow.No API change. Migration (in the changeset): drop
hidden, or setdisplaywith!importantinline or in a layer beforereset; no codemod can detect reliance on the old result.Evidence
main's reset, hidden elements with a later-layer class, an unlayered rule or an inlinedisplaycomputeflex,grid,block; here, allnone.!importantstill win, until-found keepscontent-visibility: hidden, and elements withouthiddenkeep their display. No Astryx component changes: everyhiddenhas nodisplayor already pairs withdisplay: none.Scope
Testing
How to check:
<div hidden class="flex">under the reset computesnonehere andflexonmain.Evidence:
reset.hidden.a11y.browser.spec.tspasses in Chromium (CI) and WebKit 26.5 (local), and its display test fails withmain's reset in both; real Safari 18.6 and 26.2 (iOS simulators) match (comment below).reset.hidden.test.tsfails onmainand passes here, with the reset, until-found and Pages tests. Lint, typecheck andcheck:repopass exceptcheck:changesets, which rejects[breaking]on a patch plan, so the commit skipped the hook and ran lint-staged by hand.