Skip to content

FEC-434: feat(detail-page): create DetailPage compound component#1167

Open
misama-ct wants to merge 31 commits intomainfrom
CRAFT-2166-create-detail-page-component
Open

FEC-434: feat(detail-page): create DetailPage compound component#1167
misama-ct wants to merge 31 commits intomainfrom
CRAFT-2166-create-detail-page-component

Conversation

@misama-ct
Copy link
Collaborator

@misama-ct misama-ct commented Feb 26, 2026

image

Summary

Adds the DetailPage compound component — a page skeleton with back navigation, header, scrollable content area, and optional footer. Replaces the structural layout of MC's TabularDetailPage, InfoDetailPage, CustomFormDetailPage, and FormDetailPage.

Component parts

Part Description
DetailPage.Root Page container (flex column layout)
DetailPage.Header CSS grid header with named areas
DetailPage.BackLink React Aria useLink with i18n default label ("Go back")
DetailPage.Title Page title (<h1>)
DetailPage.Subtitle Optional subtitle
DetailPage.HeaderActions Action buttons alongside title
DetailPage.Content Scrollable <main> content area
DetailPage.Footer Optional footer with top border

Key decisions (deviations from CRAFT-2166)

  • Content is decoupled from PageContent — consumers compose PageContent inside DetailPage.Content when they need width constraints, rather than a pass-through variant prop
  • Tabs go inside DetailPage.Content — maintains a single <main> landmark and proper scroll propagation (not as siblings between header and footer)
  • CSS grid header instead of a TitleRow wrapper component — simpler API, HeaderActions positioned via grid named areas

Also includes

  • Tabs flex chain fix: flex: 1 + minHeight: 0 on Tabs root for proper scrolling in flex parents (separate OpenSpec proposal at openspec/changes/update-tabs-flex-layout/)
  • i18n: Back link default label with de, en, es, fr-FR, pt-BR translations
  • Full documentation: .dev.mdx, .mdx index page, .docs.spec.tsx consumer tests
  • OpenSpec proposals: Retroactive proposals for both DetailPage and Tabs changes

Test plan

  • 4 Storybook stories pass (InfoDetailPage, FormDetailPage, WithHeaderActions, TabularDetailPage)
  • 4 consumer implementation tests pass (.docs.spec.tsx)
  • 11 existing Tabs stories still pass (no regression)
  • TypeScript compiles clean
  • Build succeeds
  • Lint passes

Related

@changeset-bot
Copy link

changeset-bot bot commented Feb 26, 2026

🦋 Changeset detected

Latest commit: 56d57bd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@commercetools/nimbus Major
@commercetools/nimbus-tokens Major
@commercetools/nimbus-icons Major
@commercetools/nimbus-design-token-ts-plugin Major

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

@vercel
Copy link

vercel bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nimbus-documentation Ready Ready Preview, Comment Mar 20, 2026 10:57am
nimbus-storybook Ready Ready Preview, Comment Mar 20, 2026 10:57am

Request Review

Copy link
Contributor

@ByronDWall ByronDWall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is looking really good. It has caused me to make some changes in the MainPage PR as well. I definitely think it needs an Actions section in the header, and it's worth considering using grid instead of flex for the recipe.

…ges to Patterns/Pages

- Align DetailPage recipe to MainPage grid blueprint (gridTemplateRows, header margin/padding, footer inset, headerActions gridRow span)
- Add minHeight: 0 to content slot to prevent 1fr overflow with tall content
- Add StickyTableHeader story with Box height constraint to demonstrate DataTable sticky header
- Fix WithCustomHeaderContent Toolbar placement with gridColumn="1 / -1"
- Move DetailPage, MainPage, PageContent stories to Patterns/Pages category
…o TabNav

Replace Tabs (content-switching widget with role="tablist") with TabNav
(nav landmark with aria-current="page" links) for page-level navigation
in DetailPage and MainPage stories, docs, and specs.

Add DetailPage.TabNav and MainPage.TabNav layout container sub-components
(recipe slot) that position themselves in the header grid's last row at
full width. Consumers wrap TabNav.Root inside, or use as={TabNav.Root}
for a flatter DOM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants