feat(layer-dialog): add responsive layer dialog - #793
Conversation
|
/bonk give me a thorough code review |
|
I'm Bonk, and I've done a quick review of your PR. 2 findings posted inline. No additional actionable findings. Review notes
|
commit: |
|
I'm Bonk, and I've done a quick review of your PR. Posted 1 new inline finding. Review notes
|
📐 Bundle SizeConsumer fixtures bundled against
npm tarball: 534 files, 1.47 MB packed, 6.84 MB unpacked.
|
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://feat-strict-layer-dialog-kumo-docs.design-engineering.workers.dev (commit 026c119)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
- Add LayerDialog.Description, rendered beneath the title inside the sticky title frame and wired as the dialog's accessible description. Without it, the body copy describes the dialog so alerts still announce consequences. - Only block user-initiated dismissal reasons, so programmatic closes via actionsRef or a controlled `open` work for alerts and while dismissDisabled. Escape now cancels alerts, matching Base UI's AlertDialog. - Pass alert state as a prop instead of inheriting context, so a plain Root nested inside an Alert no longer becomes an alert. - Move Body's title/close-button slots to a private context so they are not part of the public props. - Resolve size and verticalAlign through resolveVariant to avoid crashes on unknown values. - Replace the nonexistent shadow-m utility with an explicit shadow. - Export LayerDialogProps as a real type and categorize the component as Overlay so the registry documents the root props. - Add Installation, Usage, and API Reference sections to the docs page and move demo intro copy into Description. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVfWmxDS5smTdZh5mx9cbq
The ScrollArea viewport is always `overflow: scroll`, so WebKit rubber-bands it even with no overflow. `overscroll-contain` only stops chaining; switch to `overscroll-none` so the element's own bounce is disabled too. Drawer swipe detection reads scroll height, not overscroll-behavior, so swipe-to-close is unaffected. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVfWmxDS5smTdZh5mx9cbq
The popup hardcoded `max-h-[calc(100dvh-3rem)]` while the top-aligned variant added 4rem of viewport padding, so a max-height dialog could extend past the bottom edge. Follow Base UI's inside-scroll pattern: each verticalAlign variant reserves vertical padding on the viewport and the popup fills it with `max-h-full`, so the cap can never drift from the alignment. Mobile sheets keep their 85dvh cap. Add a test pinning the contract and a "Maximum height" docs section with a tall-content demo for both placements. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVfWmxDS5smTdZh5mx9cbq
|
One design detail I've been noodling on is the 'sticky' behavior for the title + description. From a spacing perspective, I think it looks way nicer for the title + description to be visually grouped together, but it adds a lot of height once it becomes sticky. Could we do something fancy like this to de-emphasize the description? I could also be overthinking this and we should just put description in the body content and not worry about this :) Particularly curious what you think @hkfoster FancyCleanShot.2026-09-09.at.22.00.26.mp4Less FancyCleanShot.2026-09-09.at.22.08.07.mp4 |
Once the body scrolls past the header threshold, the description collapses under the title (grid-template-rows 1fr -> 0fr plus opacity) and unfolds again at the top. It stays in the DOM so aria-describedby keeps resolving. Collapsing gives the description's height to the scroll viewport, which shrinks the scroll range. If the content only barely overflows, that would clamp scrollTop under the threshold and re-expand in a loop, so the handler only condenses when enough overflow survives the collapse. Measured in headless Chromium at 120Hz with 600 rows each holding an Input: collapse/expand max frame 9.1ms vs 8.8ms idle, zero frames over 20ms. At 3000 rows the only 16.7ms frames match plain scrolling. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVfWmxDS5smTdZh5mx9cbq
Alerts no longer force a red primary action. Actions.Primary accepts variant="primary" (default) or variant="destructive", so a critical but non-destructive confirmation keeps brand styling while deletes opt into danger explicitly. Documented in the API reference alongside the existing loading prop. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVfWmxDS5smTdZh5mx9cbq
The X button's accessible name and the footer dismiss text were hardcoded English. Content now takes closeLabel for the X, and Actions' dismissLabel is plain text instead of a close/cancel enum, defaulting to Close (Cancel inside Alert). Both are documented under Localization. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVfWmxDS5smTdZh5mx9cbq





























































































Summary
LayerDialogcomponent built on Base UI Draweralertdialogsemantics, and custom portal-container supportValidation
pnpm --filter @cloudflare/kumo lintpnpm --filter @cloudflare/kumo test— 55 files and 1,320 tests passedpnpm --filter @cloudflare/kumo buildpnpm --filter @cloudflare/kumo-docs-astro typecheck— 0 errors