Skip to content

fix(Dialog, Drawer): the header row contains its title and controls - #12588

Merged
josephfarina merged 2 commits into
mainfrom
josephfarina/dialog-header-contains-title
Nov 18, 2026
Merged

josephfarina merged 2 commits into
mainfrom
josephfarina/dialog-header-contains-title

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A theme that paints a Dialog's or Drawer's header row (a Windows 98 title bar, for example) saw the title spill above and below the painted bar. In such a theme the bar was 14px tall around a 19–25px heading line. The header row was never as tall as its own title, because the title block and the close button sat in it with negative block margins. With this change the header row contains its title, close button and end content, and every one of them stays where it was.

Problem and solution fit

  • Why does it occur? The title block takes a negative block margin that centres its first line on the medium close button, and the close button's wrapper takes a negative spacing-2 margin for its visual padding. Negative margins make a flex row shorter than its children, so the row (dialog-header) was 16px tall around a 28px title even in the default theme. No official theme paints the row, so nobody saw it.
  • Why does it harm the task? A painted title bar that does not contain its title reads as broken.
  • Why does that matter? Painting the header row is how a theme draws a title bar.

The row now takes the most negative block offset its slots need (min(title offset, end offset, 0)), and each slot takes its own offset minus the row's, which is never negative. Each slot's position and the space the row takes in the layout are unchanged; only the row's own box grows to its contents.

Expected behavior and authority

module:Dialog/DialogHeader FR6 and FR7: the close action keeps its released block and inline-end inset, and an explicit endContentEdgeCompensation selects the axes. Both still hold. The block inset is now carried by the row, so the end wrapper sits exactly where it did. FR1 (dialog-header on the row element) is unchanged, and so are DrawerHeader's equivalents.

Smallest restoration

  • packages/core/src/Dialog/DialogHeader.tsx and packages/core/src/Drawer/DrawerHeader.tsx: the title offset and the end offset become private custom properties on the row; the row takes their minimum as its block margin, and the title block, start slot and end slot each take their offset minus that.

Evidence

  • Before: with a Windows 98 style theme that paints dialog-header, the bar is 14px tall around the heading (19px on desktop, 25px on a phone), and the look gate flags six collapsed boxes on the dialog page.
  • After: the bar contains the heading in all five header shapes (title with close, with subtitle, without close, with start content, with end content), and the look gate's collapsed-box check finds none. The heading's and close button's centres are unchanged.
  • Official themes: the same five header shapes render pixel-identical to main in butter, chocolate, gothic, matcha, neutral, stone and y2k, light and dark. The look gate (deterministic checks, compared with main) finds no new problem in any of the seven.
  • Regression test: DialogHeader.containsSlots.test.tsx holds each slot's offset to its own minus the row's, for Dialog and Drawer. It fails on main.

Scope

Components: Dialog, Drawer

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • CI=1 pnpm vitest run packages/core/src/Dialog packages/core/src/Drawer (261 passed)
  • Rendered the five header shapes with astryx experimental render in the seven official themes and a Windows 98 style theme. Compared full-page screenshots with main pixel by pixel and measured the header row, heading and close button.

look gate: no new findings vs main on the seven official themes; the collapsed title bar is fixed on a theme that paints the header row

The title block and the close action each kept a negative block margin (the title's centring on the medium close action, the action's spacing-2 bleed), so the row was shorter than both, and a theme that painted it saw the title spill out. The row now takes the most negative of those offsets and each slot the difference, which is never negative. Every slot sits where it did, and the row contains them.
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 18, 2026 5:11am UTC

Request Review

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 18, 2026
@astracat-bot

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 5:31 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · f4797a1

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
DrawerHeader 69.4 kB (+102 B) · 13.9 kB CSS (+111 B) — ✓ · ✓ · ✓
DialogHeader 69.3 kB (+104 B) · 12.5 kB CSS (+89 B) — ✓ · ✓ · ✓
lab/Comments 377.2 kB (+100 B) · 2.5 kB CSS (0) — — · — · —
3 more components
Component Size LoC Visual · A11y · RTL
lab/CommentThread 370.4 kB (+100 B) · 2.4 kB CSS (0) — — · — · —
Dialog 25.7 kB (0) · 7.0 kB CSS (0) — ✓ · ✓ · —
Drawer 54.8 kB (0) · 8.5 kB CSS (0) — ✓ · ✓ · ✓

Package size: @astryxdesign/core 7.66 MB packed (+1.3 kB); no new dependencies.

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes for one wording fix in the release note. The code change itself checks out.

Blocking

  • The changeset says the header row "now contains its title, close button and start content", but on main the start slot already sat inside the row (its box matches the row, 0 to 32px), so drop "start content", for example: "now contains its title, close button and end content".

Every slot keeps its position to the pixel in all seven official themes. A theme that paints the row now gets a bar that contains its title. The new test fails on main and passes here. Optional: the new comments at the top of DialogHeader.tsx and DrawerHeader.tsx could use shorter, one-topic sentences, as the source-comment guideline asks.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim (changeset): the row now contains its title, close button and start content. False for start content, which was already inside the row on main; true for the title and close button.
  • Claim (changeset): a theme that paints the row no longer sees the title spill. Verified with a theme that paints the row.
  • Claim (changeset): every slot stays where it was, so an unpainted row draws the same pixels. Verified by measured slot boxes and pixel-identical frames.
  • Claim (description): in the default theme the row was 16px tall around a 28px title. Verified.
  • Claim (description): the row takes the minimum of the title offset, the end offset and zero, and each slot takes the non-negative difference. Verified in both headers.
  • Claim (description): slot positions and the space the header takes are unchanged. Verified by measurement in five Dialog shapes and two Drawer shapes.
  • Claim (description): the close action keeps its released block and inline-end inset, and an explicit end-content compensation still selects the axes. Verified.
  • Claim (description): the header-row target stays on the row element, and the Drawer equivalents hold. Verified.
  • Claim (description): the header shapes are pixel-identical to main in the seven official themes. Verified for all seven (light, plus dark for neutral and gothic).
  • Claim (description): the new test fails on main. Verified (both cases fail on main and pass here).
  • Claim (description): the Dialog and Drawer suites pass (261 tests). Verified.
  • Claim (description): measurements with a Windows 98 style theme and the look-gate results. Not reproducible here, because neither is in the repository; a repository theme that paints the row shows the same defect and fix.
  • File .changeset/core-dialog-header-contains-title.md: the blocking wording finding above.
  • File packages/core/src/Dialog/DialogHeader.containsSlots.test.tsx: clear.
  • File packages/core/src/Dialog/DialogHeader.tsx: clear, with the optional comment note.
  • File packages/core/src/Drawer/DrawerHeader.tsx: clear, with the optional comment note.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved: no blocking findings, and CI passed on this head.

The header row in DialogHeader and DrawerHeader now contains its title, close button and end content, and every slot keeps its position. All seven official themes render the same pixels in light and dark, and a theme that paints the row now gets a bar around its title. The release note is now accurate, and the new test fails on main and passes here.

  • Optional: the new module comment opens with "Each slot keeps its released block offset from the header row", but each slot's offset from the row changes; what stays the same is its position in the header (for example, "Each slot keeps its released block position in the header.").
Claims and files checked

Review mode: incremental; reason: none

  • Recipe unchanged since the last review: changed rules (0).
  • Claim (changeset): the row now contains its title, close button and end content. Verified: at this head the row's box holds the title block and the end slot in all five Dialog shapes and the Drawer shape; on main the title and the end slot sat outside it.
  • Claim (changeset): a theme that paints the row no longer sees the title spill above and below it. Verified with a theme that paints every header target.
  • Claim (changeset): every slot stays where it was, so an unpainted row draws the same pixels. Verified by identical slot and header boxes and by pixel-identical frames.
  • Claim (description): in the default theme the row was 16px tall around a 28px title. Verified.
  • Claim (description): the title block's centring margin and the close wrapper's spacing-2 bleed are negative block margins that shrink the row. Verified in main's source.
  • Claim (description): no official theme paints the row. Verified: none of the seven styles either header row target.
  • Claim (description): the row takes the minimum of the title offset, the end offset and zero, and each slot takes the difference, which is never negative. Verified in both headers.
  • Claim (description): slot positions and the space the header takes are unchanged; only the row's box grows. Verified, also inside a layout with zero padding.
  • Claim (description): the close action keeps its block and inline-end inset, explicit end-content compensation still selects the axes, and the header-row target stays on the row. Verified for Dialog and Drawer.
  • Claim (description): the five header shapes are pixel-identical to main in the seven official themes, light and dark. Verified.
  • Claim (description): the new test fails on main. Verified (both cases fail on main and pass here).
  • Claim (description): the Dialog and Drawer suites pass with 261 tests. Verified.
  • Claim (description): no new public API, visual representation, default or interaction model. Verified: the API comparison lists no change.
  • Claim (description): measurements with a Windows 98 style theme and the look gate. Not reproducible here, because neither is in the repository; a repository theme that paints the row shows the same defect and fix.
  • File .changeset/core-dialog-header-contains-title.md: clear.
  • File packages/core/src/Dialog/DialogHeader.containsSlots.test.tsx: clear.
  • File packages/core/src/Dialog/DialogHeader.tsx: clear, with the optional comment note.
  • File packages/core/src/Drawer/DrawerHeader.tsx: clear, with the optional comment note.

Automated review (maintainer link)


registerEnglishFallback(english);

// Each slot keeps its released block offset from the header row. The title

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Optional (source comment): after this change each slot's offset from the row differs (the title block sits 2px inside the row's edge, the start slot 8px); what stays the same is its position in the header. For example: "Each slot keeps its released block position in the header." The same sentence opens the comment in DrawerHeader.tsx.

@josephfarina
josephfarina merged commit a914dc0 into main Nov 18, 2026
85 checks passed
@github-actions
github-actions Bot deleted the josephfarina/dialog-header-contains-title branch November 18, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — f4797a1d Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant