feat(info-dialog): add InfoDialog pattern (FEC-437)#1388
feat(info-dialog): add InfoDialog pattern (FEC-437)#1388
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 218f0b8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Add a pre-composed read-only informational dialog under patterns/dialogs/info-dialog/ as the Nimbus replacement for merchant-center-application-kit's InfoDialog. Exposes a flat four-prop API (title, isOpen, onOpenChange, children) and composes Dialog.Root, Dialog.Content, Dialog.Header, Dialog.Title, Dialog.Body, and Dialog.CloseTrigger internally with isDismissable enabled. Introduces patterns/dialogs/ sub-category alongside patterns/fields/. Includes stories with play functions covering every close affordance (X button, Escape, overlay click) plus focus-in and focus restoration, consumer implementation tests, designer and developer MDX with an escape-hatch section, and tasks.md marked complete against the approved OpenSpec proposal.
3074510 to
e87747d
Compare
Local build produced slightly smaller cjs output than CI (0.45% drift), causing the 0.1% approval tolerance in check-bundle-size.mjs to reject the baseline update. Set cjs to the triangulated midpoint of CI's reported "62.9 KB / +5.7%" range.
|
@claude please review |
|
Claude finished @misama-ct's task in 2m 22s —— View job Code Review —
|
- Add changeset (minor) for the new InfoDialog export - Add `defaultOpen` so uncontrolled usage is possible without a trigger - Add `aria-label` to override the accessible name derived from `title` (useful for composed ReactNode titles) - Thread `aria-label` from Dialog.Root context to the underlying RaDialog in Dialog.Content (previously declared in types but not forwarded) - Hardcode `scrollBehavior="inside"` so long content scrolls within the body with the header pinned, matching the documented intent - Extend WithReactNodeTitle play function with accessible-name and focus-restore assertions - Extend LongContent play function with a scroll-into-view check - Drop brittle Escape-key test from the docs spec (covered in-browser by the Base story) - Update OpenSpec proposal/spec and dev.mdx for the expanded API
The patterns index page uses <CategoryOverview> to enumerate sub- categories, which requires each sub-category to have its own `.mdx` index file (see `packages/nimbus/src/docs/fields.mdx`). Without `dialogs.mdx`, the new Dialogs sub-category introduced by the InfoDialog pattern did not render on the patterns overview.
- Description and Overview reflect the full prop surface (`defaultOpen` and `aria-label` were added during review) instead of the stale four-prop phrasing - Drop the "custom accessible label on a non-string title" reason to drop down to Dialog — `aria-label` is now available directly on InfoDialog - Drop the in-file anchor link to `#escape-hatch` (the section lives in the dev doc, not here) - Fix the Dialog guidelines link from `/components/overlay/dialog` to the correct `/components/feedback/dialog` route
|
@claude please review |
|
Claude finished @misama-ct's task in 1m 55s —— View job Code Review —
|
Summary
Implements FEC-437: adds the
InfoDialogpattern underpackages/nimbus/src/patterns/dialogs/as the Nimbus replacement for app-kit'sInfoDialog(the most common read-only informational dialog in the MC codebase, ~131 production usages).Phases
openspec/changes/info-dialog-pattern/patterns/dialogs/sub-categoryinfo-dialog.tsx+info-dialog.types.tsinfo-dialog.stories.tsxplay functions +info-dialog.docs.spec.tsxinfo-dialog.dev.mdx(with escape-hatch section) +info-dialog.mdxSee
openspec/changes/info-dialog-pattern/tasks.mdfor the full TDD-ordered checklist.Pattern summary
Flat four-prop API that hides the underlying
Dialog.Root→Content→Header→Title→Body→CloseTriggercomposition:title: ReactNodeisOpen?: booleanonOpenChange?: (isOpen: boolean) => voidchildren: ReactNodeNo
size,zIndex,aria-label,getParentSelector, orTextTitleprops — a usage audit of the app-kit component found 83% default size, 96% string titles, and zeroTextTitleuptake, so those are dropped or delegated to the underlying Dialog primitive. Consumers needing custom sizing or dismiss behavior get an escape-hatch section in the dev docs showing the equivalent manual Dialog composition.Introduces a new
patterns/dialogs/sub-category alongsidepatterns/fields/for future dialog patterns (confirm, destructive-confirm, etc.).Test plan
openspec validate info-dialog-pattern --strictpassespnpm --filter @commercetools/nimbus typecheckpassespnpm --filter @commercetools/nimbus buildsucceedspnpm test:storybook— all play functions passRelated
merchant-center-application-kitInfoDialog