Skip to content

docs(ScrollableArea): add block examples for the docsite - #6490

Merged
cixzhang merged 5 commits into
mainfrom
docsite/scrollable-area-blocks
Sep 24, 2026
Merged

cixzhang merged 5 commits into
mainfrom
docsite/scrollable-area-blocks

Conversation

@ernestt

@ernestt ernestt commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Reader impact

The ScrollableArea page had no worked examples — a reader arrived at prop tables and had to infer from axis, overscroll, and stickyContainment what each one produces on screen. The behaviors that most need showing are the ones hardest to infer from a signature: which viewport becomes the sticky containing block, and where a scroll gesture goes when it reaches an edge.

After this change the page carries six examples covering block-axis scrolling, axis="inline" with isFullBleed, sticky section labels, axis="both", sticky pass-through against stickyContainment="always", and overscroll allow against contain.

Source of truth

  • packages/core/src/ScrollableArea/ScrollableArea.spec.md (authority: current) — FR2 content-box sizing, FR5 padding and full bleed, FR6 fitting clip and the stickyContainment="always" opt-in, AR1 conditional keyboard access.
  • packages/core/src/ScrollableArea/ScrollableArea.doc.mjs — public props and defaults.
  • docs/design/template-composition.md — DR1–DR3 for the examples' composition.

Correction

Missing guidance, not incorrect guidance: the component had a specification and prop tables but no consumer examples, so packages/cli/assets/templates/blocks/components/ScrollableArea/ did not exist.

All six blocks deliberately render the same content — a workspace file panel of labelled sections holding a two-column grid of muted cards. Reading them in order, the only thing that changes is the behavior being demonstrated, so a reader does not re-learn a new domain per example. Each block's panel heading sits inside its viewport and scrolls with the content; the inline rail keeps its heading outside, because that viewport scrolls on the inline axis only and a heading inside it would never move.

ScrollableArea.tsx gains one line: the existing SYNC: block now names the new block directory, which pnpm check:sync requires once that directory exists.

Evidence

Verified in a real browser against the running docsite, not only by build:

Claim Measured
Overflowing viewports take a conditional tab stop (AR1) tabindex="0" on every overflowing viewport; absent on the fitting one
Fitting viewport clips and passes Sticky outward (FR6) overflow: clip both axes; its label pinned at 0px from the panel's top edge while its own box sat at −120px
stickyContainment="always" retains the boundary (FR6) overflow-y: auto while fitting; label left with its box at −348px
overscroll="allow" chains at the edge wheeling past the section's end moved the panel 496px
overscroll="contain" stops at the edge same gesture left the panel at 0px
axis="both" overflows both axes (FR2) scrollWidth > clientWidth and scrollHeight > clientHeight on one viewport
Panel headings scroll with content each heading moved the full 120px when its viewport scrolled 120px
Inline rail block-end padding 16px clear under the cards

Generated artifacts: apps/docsite/src/generated/blockRegistry.ts and exampleRegistry.ts pick the blocks up (six new entries, one of them the hero showcase); internal/shadcn-registry/routes.lock.json gains the five new example routes plus the showcase route, additively.

Scope

  • This PR changes documentation only, or names every necessary generated artifact.
  • Runtime, API, visual, and policy changes were removed or split.
  • Public text and artifacts contain no internal Meta context.

No runtime or API change: the only file outside the block directory and the route lock is the one-line SYNC: comment.

Testing

  • pnpm check:repo — clean, including check:sync and check:knowledge.
  • pnpm -F @astryxdesign/docsite test — 518 passed, 6 skipped.
  • pnpm -F @astryxdesign/docsite typecheck — clean.
  • eslint and prettier — clean on the new files.
  • Rendered review of every block on the local docsite at /components/ScrollableArea, plus the browser probes tabulated above.

Add four ScrollableArea blocks so the component page has worked examples
instead of only the API tables:

- Showcase: a fixed-height review queue scrolling on the block axis.
- Inline Rail: axis="inline" with isFullBleed, so a card rail runs to the
  panel edges while content padding keeps the first card aligned.
- Sticky Group Headers: day headings pinned to the viewport's top edge,
  showing the viewport as the sticky containing block.
- Nested Log: a two-axis build log inside a scrolling panel with
  overscroll="contain".

Also reference the block directory from the component's SYNC block.
… blocks

Two more blocks, both using Item rows for their content:

- Sticky Passthrough: a support queue panel where a nested area whose
  content fits clips rather than scrolling, so its sticky heading passes
  outward and pins to the panel edge. The neighbouring queue sets
  stickyContainment="always" and keeps its heading in its own box.
- Overscroll Chaining: an order panel whose nested item list keeps the
  default overscroll="allow", so a gesture that reaches the list's end
  carries on scrolling the panel - the counterpart to the contained
  build log.
Each block told its own story - a review queue, a metrics rail, a bank
statement, a deploy log, a support queue, an order - so reading the
examples in order meant learning six unrelated domains before the
scrolling behavior was visible.

All six now render the same workspace file panel: labelled sections
holding a two-column grid of muted cards. The only thing that differs
between examples is the behavior each demonstrates.

- Showcase: block-axis scrolling.
- Inline Rail: axis="inline" with isFullBleed.
- Sticky Section Labels: labels pinned to the viewport edge.
- Two-Axis Board: axis="both", replacing the nested log example.
- Sticky Passthrough: a fitting viewport against stickyContainment.
- Overscroll: allow against contain, on identical sections.

The nested areas in the overscroll example carry a hairline frame, so
the edge the gesture meets is visible.
Move each panel heading inside its viewport so it scrolls away with the
content rather than sitting pinned above it. In the sticky-labels
example this now reads as intended: the heading leaves while the section
labels below it pin to the viewport's top edge.

The inline rail keeps its heading outside - its viewport scrolls on the
inline axis only, so there is no block scrolling for a heading to travel
with - and gains block-end content padding so the cards and the
scrollbar are not flush against the card's bottom edge.
@vercel

vercel Bot commented Sep 23, 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 Sep 24, 2026 1:47am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 23, 2026
@github-actions github-actions Bot added the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Sep 23, 2026
@astracat-bot

astracat-bot Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Sep 24, 2026, 1:46 AM UTC

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

Thanks for adding these worked examples — the shared file-panel content across all six blocks makes the axis, sticky, and overscroll differences easy to compare, and the browser measurements for the fitting, containment, and chaining behaviour are convincing.

One fix is needed before this is ready:

  • The showcase description says the panel scrolls while its heading stays put, but the showcase places its heading inside the scrollable area so it scrolls away with the content — which is also what the in-code comment and the measured heading movement show. Please update that description in ScrollableAreaShowcase.doc.mjs to match, since the hero example is the first thing readers will learn from.

Everything else checks out: no runtime or API change, and the sync, routing, and changeset pieces are in place.

[Automated review]

github-actions Bot added a commit that referenced this pull request Sep 24, 2026
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

ScrollableArea (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 214 -
Complexity N/A High (20) -

Bundle Size Summary

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

Accessibility Audit

Status: 36 accessibility violation(s) found — 2 critical, 34 serious.

Button pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/19 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposerInput - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatReasoning - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatToolCalls - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 10/11 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Checkbox pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/33 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CheckboxList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/17 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ClickableCard - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditor - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/7 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditorPerf - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/2 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditorTheme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 13/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeTheme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 14/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
DateRangeInput - 1 issue(s)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/21 stories · Learn more
    • WCAG: 4.1.2 (Level A)
FileInput - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/15 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
GridMasonry - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/3 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Heading - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Icon - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
LogStream - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/3 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
MediaTheme Auto - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
PowerSearch - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/26 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ProgressBar - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Radio group pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/26 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
RadioList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
RichTextEditor - 2 issue(s)
  • 🟠 serious: Ensure every ARIA input field has an accessible name
    • Rule: aria-input-field-name · Affects 2/18 stories · Learn more
    • WCAG: 4.1.2 (Level A)
  • 🔴 critical: Ensure every form element has a label
    • Rule: label · Affects 1/18 stories · Learn more
    • WCAG: 4.1.2 (Level A)
SelectableCard - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/4 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Stepper - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/30 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
TableGroupedRows - 1 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 3/3 stories · Learn more
    • WCAG: 4.1.2 (Level A)
TableTree - 1 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 8/9 stories · Learn more
    • WCAG: 4.1.2 (Level A)
Text - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/23 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Theme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
PopArt - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/6 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Thumbnail - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/12 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Timestamp - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/20 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Token - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/10 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Tokenizer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/24 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Visual Regression

19 of 422 shot(s) changed. View the report

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
Slider Default probe light 15,617
Slider Default probe dark 15,615
Chat With Attachments probe light 12,964
Chat With Attachments probe dark 12,114
InputGroup With Typeahead probe light 11,012
InputGroup With Typeahead probe dark 9,189
ComplexSelector Tree list with search probe light 6,245
TextArea Vertical Form Alignment probe light 5,634
ComplexSelector Tree list with search probe dark 5,602
TextArea Vertical Form Alignment probe dark 5,047
ComplexSelector Fruit ripeness selector neutral light 4,007
ComplexSelector Fruit ripeness selector neutral dark 3,825
ToggleButton Group Single probe dark 1,538
ToggleButton Group Single probe light 1,538
MediaTheme On Dark neutral dark 838
Banner Collapsible Content (Expanded) probe dark 92
Banner Collapsible Content (Expanded) probe light 90
AlertDialog Delete neutral light 71
TableRowStatus Default neutral light 23
Slider — Default — probe light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
Slider — Default — probe dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
Chat — With Attachments — probe light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame

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

The description still said the heading stays put, which described the
block before the heading moved inside the viewport. It now scrolls away
with the content, as the in-code comment and the rendered block show.
@ernestt

ernestt commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Good catch — fixed in 4b2c3a7.

The description was written when the heading sat outside the viewport; it went stale when the headings moved inside so they scroll with the content. It now reads:

A fixed-height file panel that scrolls on the block axis; the heading sits inside the viewport, so it scrolls away with the content.

I also re-read the other five descriptions against their blocks for the same kind of drift — they are accurate. The inline rail is the one block that still keeps its heading outside the viewport, because that viewport scrolls on the inline axis only, so its description is correct as written.

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

Thanks for adding these worked examples — the shared file-panel content across all six blocks makes the axis, sticky and overscroll differences easy to compare, and the browser measurements for fitting, containment and chaining are convincing.

The showcase description fix is correct: it now says the heading sits inside the viewport and scrolls away with the content, matching the showcase code and the measured heading movement. The other descriptions also match their blocks, including the inline rail keeping its heading outside its inline-only viewport.

No runtime or API change, and the sync, routing and changeset pieces are in place. This is ready to approve.

[Automated review]

@cixzhang
cixzhang enabled auto-merge (squash) September 24, 2026 17:02
@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Sep 24, 2026
@cixzhang
cixzhang merged commit db4e378 into main Sep 24, 2026
41 checks passed
@github-actions
github-actions Bot deleted the docsite/scrollable-area-blocks branch September 25, 2026 06:23

This branch was successfully deployed

1 active deployment
Preview — 4b2c3a7c Deployed Sep 24, 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