Repository navigation
docs(ScrollableArea): add block examples for the docsite - #6490
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
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 inScrollableAreaShowcase.doc.mjsto 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]
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsScrollableArea (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 36 accessibility violation(s) found — 2 critical, 34 serious. Button pattern - 1 issue(s)
ChatComposer - 1 issue(s)
ChatComposerInput - 1 issue(s)
ChatReasoning - 1 issue(s)
ChatToolCalls - 1 issue(s)
Checkbox pattern - 1 issue(s)
CheckboxList - 1 issue(s)
ClickableCard - 1 issue(s)
CodeEditor - 1 issue(s)
CodeEditorPerf - 1 issue(s)
CodeEditorTheme - 1 issue(s)
CodeTheme - 1 issue(s)
DateRangeInput - 1 issue(s)
FileInput - 1 issue(s)
GridMasonry - 1 issue(s)
Heading - 1 issue(s)
Icon - 1 issue(s)
LogStream - 1 issue(s)
MediaTheme Auto - 1 issue(s)
PowerSearch - 1 issue(s)
ProgressBar - 1 issue(s)
Radio group pattern - 1 issue(s)
RadioList - 1 issue(s)
RichTextEditor - 2 issue(s)
SelectableCard - 1 issue(s)
Stepper - 1 issue(s)
TableGroupedRows - 1 issue(s)
TableTree - 1 issue(s)
Text - 1 issue(s)
Theme - 1 issue(s)
PopArt - 1 issue(s)
Thumbnail - 1 issue(s)
Timestamp - 1 issue(s)
Token - 1 issue(s)
Tokenizer - 1 issue(s)
Visual Regression19 of 422 shot(s) changed. View the report A change here is a question, not a failure: check whether the after is the
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.
|
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:
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. |
There was a problem hiding this comment.
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]









Reader impact
The ScrollableArea page had no worked examples — a reader arrived at prop tables and had to infer from
axis,overscroll, andstickyContainmentwhat 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"withisFullBleed, sticky section labels,axis="both", sticky pass-through againststickyContainment="always", andoverscrollallow against contain.Source of truth
packages/core/src/ScrollableArea/ScrollableArea.spec.md(authority: current) — FR2 content-box sizing, FR5 padding and full bleed, FR6 fittingclipand thestickyContainment="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.tsxgains one line: the existingSYNC:block now names the new block directory, whichpnpm check:syncrequires once that directory exists.Evidence
Verified in a real browser against the running docsite, not only by build:
tabindex="0"on every overflowing viewport; absent on the fitting oneoverflow: clipboth axes; its label pinned at 0px from the panel's top edge while its own box sat at −120pxstickyContainment="always"retains the boundary (FR6)overflow-y: autowhile fitting; label left with its box at −348pxoverscroll="allow"chains at the edgeoverscroll="contain"stops at the edgeaxis="both"overflows both axes (FR2)scrollWidth > clientWidthandscrollHeight > clientHeighton one viewportGenerated artifacts:
apps/docsite/src/generated/blockRegistry.tsandexampleRegistry.tspick the blocks up (six new entries, one of them the hero showcase);internal/shadcn-registry/routes.lock.jsongains the five new example routes plus the showcase route, additively.Scope
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, includingcheck:syncandcheck:knowledge.pnpm -F @astryxdesign/docsite test— 518 passed, 6 skipped.pnpm -F @astryxdesign/docsite typecheck— clean.eslintandprettier— clean on the new files./components/ScrollableArea, plus the browser probes tabulated above.