Skip to content

fix(core): reset.css leaves hidden="until-found" content findable - #7520

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:reset-hidden-until-found
Oct 14, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:reset-hidden-until-found

Conversation

@vjeux

@vjeux vjeux commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

User impact

Apps that load @astryxdesign/core/reset.css cannot use hidden="until-found". The reset's :where([hidden]) { display: none } matches it too, so find in page and text fragment links never find collapsed content, and the browser never reveals it. In Chromium 149 and WebKit 26.5, a #:~:text= link to text in an until-found section scrolls nowhere and fires no beforematch.

Problem and solution fit

  • Why it occurs: the HTML Standard renders the until-found state with content-visibility: hidden, which keeps the content searchable. The reset's author rule wins over that and removes the content from layout and from search.
  • Why it harms: readers cannot search into collapsed sections or follow a deep link to them.
  • Why that matters: until-found exists so accordions, transcripts and long docs stay findable. The adoption report in Adoption feedback: migrating a real Next.js 16 app to Astryx (0.1.8) — 10 findings + suggestions #4276 kept native <details> for find in page.

Expected behavior and authority

  • HTML Standard, the hidden attribute: until-found content is revealed by find in page and fragment navigation, with beforematch. Its rendering section pairs [hidden]:not([hidden=until-found i]) with display: none and [hidden=until-found i] with content-visibility: hidden.
  • The reset's own comment, "Ensure hidden elements are actually hidden": until-found content stays hidden until the browser reveals it.

No record governs reset.css.

Smallest restoration

  • reset.css: the selector becomes :where([hidden]:not([hidden='until-found' i])), still in @layer reset. Plain hidden keeps display: none.
  • The GitHub Pages copy and its manifest hash, which pages-landing.test.mjs requires to match.

No API change. [fix], patch: the HTML Standard defines what until-found does, and no valid use of it relies on the content being unfindable. A browser without until-found support treats the value as plain hidden, which its own [hidden] rule still hides. No Astryx component uses until-found today.

Evidence

  • Reproduction before the change: with main's reset, the until-found element computes display: none; after the text fragment navigation, the attribute stays, beforematch never fires and the page does not scroll.
  • Result after the change: display: block with content-visibility: hidden; the navigation removes the attribute, fires beforematch and scrolls the content into view.
  • Representative unchanged path: plain hidden content stays display: none and out of reach.
  • Regression test: reset.until-found.a11y.browser.spec.ts (both tests fail on main in both engines) and a static guard in reset.until-found.test.ts (fails on main).

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec playwright test packages/core/src/reset.until-found.a11y.browser.spec.ts --project=chromium (Chromium 149) and --project=webkit (WebKit 26.5, run locally): 2 passed each. With main's reset.css, both tests fail in both engines. CI runs Chromium only.
  • pnpm vitest run packages/core/src/reset.until-found.test.ts packages/core/src/reset.test.ts .github/scripts/pages-landing.test.mjs: 16 passed; the new guard fails with main's reset.css.
  • eslint --max-warnings=0 on the new files, pnpm -F @astryxdesign/core typecheck, pnpm check:changesets and the pre-commit check:repo are clean.

The reset's `:where([hidden]) { display: none }` also matched
`hidden="until-found"`. The browser renders that state with
`content-visibility: hidden`, which find in page and text fragment links
can search and reveal; `display: none` took the content out of both, so a
link to text inside a collapsed section scrolled nowhere and fired no
`beforematch`.

The rule now skips the until-found state
(`:where([hidden]:not([hidden='until-found' i]))`), which is how the HTML
Standard's own rendering rules split the two. Plain `hidden` elements keep
`display: none`, still in `@layer reset`. A browser without until-found
support treats the value as plain `hidden`, and its own `[hidden]` rule
still hides it.

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.
@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 14, 2026 2:52pm UTC

Request Review

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

astracat-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 14, 2026, 3:14 PM UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

44 of 454 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 754,077
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,188
Chat Full AI Chat probe light 238,081
Chat Full AI Chat probe dark 237,048
Markdown Default probe light 159,625
Markdown Default probe dark 158,986
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 33,205
Chat Default neutral light 32,876
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
TableRowExpansion Detail Panel neutral dark 5,150
TableRowExpansion Detail Panel neutral light 4,068

and 24 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@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.

No blocking issues found: narrowing the reset's [hidden] rule restores the browser's own hidden="until-found" rendering, and the new browser spec passes in Chromium and WebKit with this change and fails with the current reset, while plain hidden stays display: none. Nothing else is required. Optionally, the changeset could note that an until-found element with its own padding, border or background now shows that empty box while collapsed, as it does without the reset.

[Automated review]

@cixzhang cixzhang 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.

CodeBunny approved at this head; review text read, no blocking notes. Approved.

@cixzhang
cixzhang merged commit 2aa23a8 into meta:main Oct 14, 2026
50 checks passed
@vjeux
vjeux deleted the reset-hidden-until-found branch October 14, 2026 15:49
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 14, 2026
… 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.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 20, 2026
… 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.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 22, 2026
… 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.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 22, 2026
… 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.

This branch was successfully deployed

1 active deployment
Preview — 756eabe3 Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants