Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNew ComponentsDialogHeroHeader (@astryxdesign/lab) · View in Storybook
Component Size
Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included. Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: No accessibility violations detected. Visual Regression55 of 502 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 35 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
78cacd4 to
0461c87
Compare
0461c87 to
5b28b9a
Compare
There was a problem hiding this comment.
Thank you for building the media-led Dialog header and for wiring its focus, naming, and showcase paths.
Approval is waiting on a maintainer decision. This PR adds a new public DialogHeroHeader API and design in the lab package and a new stable @astryxdesign/core/Dialog/DialogContext subpath, and the description notes the core subpath still needs maintainer acceptance. Please have a maintainer provide or identify the governing current spec for both surfaces — the header's required and optional props, full-bleed and overlay anatomy, and the exported context, hook, and value shape — so the accepted contract is discoverable for future reviewers and consumers.
Two independent fixes will still be needed once that is settled:
- For a custom heading element, initial focus currently lands on a generic wrapper around the heading rather than on the heading itself. Please put the focus and labelling handshake on the actual heading and cover the post-open focused element in a regression test.
- As a new full-bleed participant, please add a focused regression that verifies the media's computed edge compensation across representative Dialog padding and in RTL.
The Dialog post-open focus ordering, naming, and inline behaviour otherwise follow the current Dialog contract on inspection, and the docsite, CLI, and export projections are consistent with the new surfaces.
[Automated review]
5b28b9a to
827a1c6
Compare
|
Thanks for the review. I rebased onto Custom heading focus (42659a4). The title id and focus request now go on the rendered heading element, never on a wrapper. So the post-open target keeps its heading role and name (Dialog spec AR3).
All five fail on the previous implementation. Full-bleed regression (bb06064). Rebase. #6340 now imports nested core subpaths into the playground, so I dropped this PR's generator and test changes there. On the governing spec: the header's props and anatomy follow @cixzhang's reference API on #4182 and the media-mode follow-up. The |
There was a problem hiding this comment.
Thank you for building the media-led Dialog header and for wiring its focus, naming, and showcase paths.
Approval is waiting on a maintainer decision. This PR adds a new public DialogHeroHeader API and design in the lab package and a new stable @astryxdesign/core/Dialog/DialogContext subpath, and the description notes the core subpath still needs maintainer acceptance. Please have a maintainer provide or identify the governing current spec for both surfaces — the header's required and optional props, full-bleed and overlay anatomy, accepted custom-title element contract, and the exported context, hook, and value shape — so the accepted contract is discoverable for future reviewers and consumers.
The two fixes from the earlier review are addressed in this revision: a custom heading now receives the focus and labelling handshake on the heading element itself, with a regression asserting the post-open focused element, and the new media bleed geometry story covers representative Dialog padding, a theme override, and RTL as required CI. The Dialog post-open focus ordering, naming, and inline behaviour otherwise follow the current Dialog contract on inspection, and the docsite, CLI, and export projections are consistent with the new surfaces.
[Automated review]
827a1c6 to
5e8895d
Compare
|
Rebased onto Validation: 144 focused Dialog/DialogHeroHeader/export/integration tests, Lab docs typecheck, strict lint/repository checks, full package build, and Storybook build pass. The DialogHeroHeader media-bleed story passes across its padding/theme/RTL fixtures. The full story guard still reports two failures in the unchanged PowerSearch near-full-token-row fixtures; I have not described that aggregate as green. @cixzhang Please re-review the updated head and provide or identify the governing current contract for the header's public props/anatomy/custom-heading requirements and the The formal review-request API rejects my account's permissions in this repository, so this comment is the re-review request; existing reviewer assignments are retained. |
There was a problem hiding this comment.
Approval is waiting on a maintainer to provide or identify the governing spec for the new lab DialogHeroHeader API and design (props, full-bleed media with the overlaid close button, the accepted custom-title element contract, and default title focus) and for the new stable @astryxdesign/core/Dialog/DialogContext subpath and its exports. Independently of that decision, these need fixing:
- With a custom
Headingtitle, the first parent re-render after the modal opens moves focus from the heading to the page body in Chromium, because the layout effect keyed ontitleremoves thetabindexit added before re-adding it; key it on the heading node and add a browser test that re-renders after opening. - A custom heading that renders after the header mounts, or changes element, never receives the title id, so the dialog loses its accessible name.
.changeset/integration-component-import-hints.mdannounces a CLI fix, but the CLI change is a file header and the new test already passes on the base; test-only changes need no Changeset.
The branch also needs a rebase onto main.
[Automated review]
…, and Lab reads the Dialog context through an internal entry
…so a re-render keeps its focus and a late heading still names the dialog
5e8895d to
3da9bc5
Compare
|
Rebased onto The core export is now an internal entry. This PR no longer adds the public Focus loss on re-render. The handshake now follows the rendered heading node, not the Late or replaced heading. A Changeset. I removed Local results are in the PR description. In short: the focused suites, the docsite generate and tests, and the core and lab typechecks pass. In @cixzhang With the core subpath gone, the one open decision is the lab |
…eader discover entries
There was a problem hiding this comment.
Approval is waiting on an engineering owner to provide or identify the governing spec for the Lab DialogHeroHeader API and design: its props, the always-on full-bleed media, the close button overlaid on the media, the custom-title element contract, and the hero title as the dialog's default focus target. An engineering owner records that decision by commenting /approve-spec followed by the full head SHA on this pull request; the author may do so if they are an engineering owner. Separately, the change is 2,146 authored lines, over the 2,000-line scope limit, so please split it, for example by landing the Core portion (the Dialog focus fall-through and title ordering, the internal/dialog-context entry and syncDefaultName, with their tests and Changesets) first, which brings this pull request under the limit. The re-render focus, late-heading and Changeset issues from the previous review are fixed.
[Automated review]
Closes #4182
User need
Add a media-led header for onboarding, announcements, and featured Dialog content. It composes through
Layout.header, with full-bleed media above the title and a close button over the media's trailing corner. It lands in the canary-only@astryxdesign/labpackage.Problem and solution fit
showModal(), with eligible explicit descendant requests taking priority. Hidden and inline titles do not request focus; closing restores the invoker.Heading, so the post-open focus target keeps its heading role (Dialog spec AR3). The custom heading is not cloned; attributes the caller already set (id,tabIndex) are left alone.titleprop. A re-render with a new title element changes nothing, so focus stays on the heading. A heading that the caller's component renders later, or replaces with another element, receives the handshake when it appears, and Dialog then checks its default name again.startContentout of the dialog's accessible name, and preserve the close button's DOM identity when media mode changes.@astryxdesign/core/internal/dialog-context, registered in the export generator next tointernal/tokenizer-presentation.Current specification
The anatomy and media-mode choice follow the issue's reference API and media-theme follow-up. Focus timing, eligibility, restoration, and inline behavior follow the current Dialog contract (FR1–FR6, AR3). Bleed follows the current container-padding contract.
The Core entry follows
spec:AST-017FR21 andarchitecture:react-component-runtimeINV13. A module without a public contract is exported only through Core's./internal/*subpaths: undocumented, outside the compatibility promise, versioned in lockstep with Core, and allowed by lint only in Core and Lab. The labDialogHeroHeaderAPI itself still needs maintainer acceptance.Public delta and caller burden
DialogHeroHeaderexportsDialogHeroHeaderPropsandDialogHeroHeaderMediaModefrom lab. Required props aretitle: string | ReactElementandmedia: ReactNode. Optional props aremediaMode,isTitleHidden,startContent,maxLines,onOpenChange, andhasDivider, plus BaseProps/ref.Callers choose the header, supply the media, and specify its light/dark luminance when needed. As with the current
DialogHeader, passingonOpenChangeenables the close button; omitting it hides the button. The callback receivesfalse.maxLinesfollows Heading naming and only applies to string titles. Existing DialogHeader callers require no changes.Core's public API is unchanged. The internal entry re-exports
useDialogContextonly. The internal context value gains an optionalsyncDefaultName(), which Dialog provides so a composed header can ask it to check its default name again after the title element changes.Dialog's initial focus now skips a
data-autofocusrequest that is hidden, inert, or cannot take focus, and tries the next request. A header's default title request comes after every explicit request.Design and alternatives
A distinct header reflects the different anatomy. MediaTheme controls close-button contrast; no per-icon color override or new theme token is added. The component retains lab placement, and actions stay in LayoutFooter.
Evidence
MediaBleedGeometry(Storybook) measures the media against the dialog surface in real Chromium: inline-start, inline-end, and block-start edges at theme-default,padding0/2/8, a public--astryx-dialog-paddingoverride, and RTL. The title must stay inset by the cancelled padding, so the fixtures cannot pass trivially.CustomHeadingFocusAfterRerender(Storybook) opens a modal with a customh1title and re-renders the header three times. Focus andaria-labelledbymust stay on the heading. Against the previous implementation, Chromium reportedfocus left the custom heading after a re-render: <body>.Both stories are registered in
story-play-guard.js, so CI runs them as required checks.Browser checks cover a real modal, opening/closing focus, light/dark media, narrow screens, RTL, custom padding, hidden/custom headings, and default rendering. The showcase is available through
astryx template DialogHeroHeaderShowcase --package @astryxdesign/labin a consumer with lab installed.Scope
Testing
Rebased onto
mainat 8f6f000.story-play-guard.jsagainst a fresh Storybook build: both DialogHeroHeader stories pass.CustomHeadingFocusAfterRerenderfailed against the previous implementation. The two PowerSearch near-full-token-row fixtures fail locally; this PR does not touch PowerSearch.uiVitest project: 16,078 passed, 1 failed (packages/core/src/postinstall.test.mjs, outside this PR's files).nodeVitest project: the official package list test now passes afterpnpm bundle:cli-official-packages. The remaining local failures are macOS-environment tests outside this PR's files (BSDcp, bash 3.2, a case-insensitive filesystem, the global CLI cache); Linux CI is the confirmation.generate+test: passed. The ShadCN route-lock check passes withoutUPDATE_SHADCN_ROUTE_LOCK.sync-exports --check, core and lab typechecks,lab:readiness:check, changeset, knowledge, and SYNC checks: passed.