Skip to content

🪟 feat: Give OGDialog Theme Roles for Its Edge, Padding and Title - #16546

Open
berry-13 wants to merge 4 commits into
canaryfrom
berry-13/theme-dialog-chrome
Open

berry-13 wants to merge 4 commits into
canaryfrom
berry-13/theme-dialog-chrome

Conversation

@berry-13

@berry-13 berry-13 commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

OGDialogTemplate cleared the dialog edge with border-none, and OGDialogTitle set a fixed text-lg, semibold, display-family heading in the inherited body ink. A theme could therefore not draw Click UI's framed dialog, its 2rem inline padding, or its 700 1.25rem/1.5 title, and the ClickHouse theme showed an unframed dialog with an 18px semibold title.

Every non-bare OGDialogContent now reads its edge stroke width (painted in border-light), inline padding and title-to-description gap from appearance roles (dialogStroke, dialogPaddingX, dialogHeaderGap), and its title reads dialogTitleSize, dialogTitleLeading, dialogTitleFontWeight, dialogTitleFontFamily and a dialog-title color role. The template no longer clears the edge, and its legacy confirm button uses the Button's primary fill and height roles. Every default reproduces today's dialog, so the default and high-contrast themes are unchanged; a theme that names only textLg, displayFontFamily or text-primary keeps its dialog titles on them. The scrims already read the scrim roles, and the ClickHouse dark scrim keeps the black overlay canary documents.

The ClickHouse theme takes Click UI's dialog.stroke.default, dialog.space.x, dialog.title.space.gap, dialog.typography.title.default and dialog.color.title.default. The drift guard pins them, and its parity probes now read the dialog stroke and the scrim utilities: dialog decisions match Click UI in both modes except the documented dark scrim, and the floors rise to 13/12 color and 14 shape.

It also carries two fixes for review findings on #16530, which merged before they landed: the stock --button-primary fills now read var(--surface-inverted) and its hover, so a stylesheet that repaints only the inverted surface still reaches primary buttons, and the template's legacy selection action takes the Button's height and primary fill roles instead of a fixed h-10 beside the themed cancel button. Seven dialogs that pinned text-text-primary on their title drop it, so the new title ink reaches them.

Closes berry-13#138

Type of change

  • Feature

Testing

Tested environments/configuration:

  • Chromium, desktop light and dark plus mobile emulation, through the mock e2e harness
  • Default theme, stored ClickHouse definition, and a legacy definition naming only fontFamily, textLg and rgb-text-primary

Automated tests:

  • packages/client: npx jest src/theme src/components src/utils (all suites pass), including a deliberately different reference theme (3px stroke, 3rem padding, a 2rem/1.2 800-weight serif title in magenta), the chained inheritance of the title family through the display role, the validators for every new role, and dialog title contrast on the ClickHouse dialog surface
  • New OGDialogTemplate.spec.tsx: the template keeps the themed edge, the title reads its roles, and a caller's own title size, weight and padding still win
  • Button.spec.tsx: a templated dialog's legacy confirm action reads the Button's height and fill roles; defaults.spec.ts: split color roles are declared as the role they split from, in both modes
  • client: related tests for the seven dialogs whose title override was removed (181 passed); their design-rule counts were pruned
  • New scenarios in e2e/specs/mock/scenarios/dialog-chrome.spec.ts: default dialog unchanged, ClickHouse dialogs at 1px / 32px with a 20px/30px 700 Inter title in #1e1d1f / #f9f9f9, and a legacy type theme
  • ESLint (including the design rules), Prettier and import order on the changed files

Screenshots / recordings

ClickHouse theme, the "Confirm Archive" dialog (a plain OGDialogTemplate): Click UI's 1px stroke, 2rem inline padding and 700 1.25rem/1.5 title replace the unframed dialog and its 18px semibold title. The default and high-contrast themes are unchanged.

Before After
Light Before, light After, light
Dark Before, dark After, dark

Risk / compatibility

OGDialogTitle now paints its ink (dialog-title, which defaults to text-primary) instead of inheriting it, so a title placed inside a differently colored container takes the primary ink; no OGDialogContent or OGDialogHeader in the app sets another ink for its title to inherit. Callers that pass their own padding, title size or weight keep them through Tailwind Merge. The title keeps LibreChat's tracking-tight. An older reader ignores the new appearance keys and color, as it does any token it does not know.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors
  • User-facing or complex behavior is documented where necessary
  • Required dependency changes have been merged/published
  • Required documentation PR: N/A

@berry-13
berry-13 marked this pull request as ready for review September 30, 2026 06:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-09-30T08:20:08.669204Z bcdabad New commits
🔒 Security Review ✅ Completed 2026-09-30T06:42:56.830483Z e352040 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e352040fea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/client/src/theme/registry.ts Outdated
'rgb-status-success-strong',
'rgb-text-on-status',
'rgb-surface-dialog',
'rgb-dialog-title',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep dialog titles out of the verified-mark neighborhood

When a partial theme defines only the new rgb-dialog-title role and omits rgb-status-verified, this entry makes ownsMarkSurroundings true, causing both resolveTheme and the legacy applyTheme adapter to replace the bundled verified blue with rgb-status-success-strong. The dialog title is unrelated to the ToolCard surfaces against which the verified mark is measured, so merely customizing dialog typography unexpectedly changes native-tool badges and removes their deliberate distinction from the green selected-state badge.

AGENTS.md reference: AGENTS.md:L42-L45

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in b90005c: rgb-dialog-title is out of MARK_NEIGHBOURHOOD, which holds only the surfaces the mark sits on. A registry.spec case (a theme naming only the title ink keeps the stock verified color) failed before the change and passes on 059b4ea.

Comment on lines +420 to 422
'font-theme-dialog-title font-theme-dialog-title-weight text-dialog-title text-(length:--theme-dialog-title-size) leading-(--theme-dialog-title-leading) tracking-tight',
focusOutlineVariants({ focusOutline }),
className,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove legacy color overrides from dialog titles

Because the caller-provided className is merged last, existing titles such as McpOAuthDialog.tsx:67, KeyboardShortcutsDialog.tsx:381, and SkillsDialog.tsx:247 retain text-text-primary, which Tailwind Merge replaces text-dialog-title with. Consequently, themes that deliberately make rgb-dialog-title differ from body ink affect only some dialogs, while these visible dialogs silently ignore the new role; the redundant per-feature color classes need to be removed or migrated as part of introducing the shared semantic role.

AGENTS.md reference: AGENTS.md:L92-L97

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 059b4ea: the seven titles (McpOAuthDialog, KeyboardShortcutsDialog, SkillsDialog, AssistantToolsDialog, ActionsInput, Avatar, ItemDialogHeader) drop text-text-primary, so text-dialog-title reaches them; MermaidDialog keeps its deliberate text-text-secondary toolbar title. The role defaults to text-primary, so nothing changes by default; related client tests pass and the design-rule counts were pruned.

@berry-13
berry-13 added this pull request to stack #16548 September 30, 2026 06:56
@berry-13
berry-13 force-pushed the berry-13/theme-dialog-chrome branch from e352040 to f6827d3 Compare September 30, 2026 06:58
Base automatically changed from berry-13/theme-button-roles to canary September 30, 2026 06:59
@berry-13
berry-13 force-pushed the berry-13/theme-dialog-chrome branch 2 times, most recently from d9beab2 to 059b4ea Compare September 30, 2026 07:17
@berry-13
berry-13 force-pushed the berry-13/theme-dialog-chrome branch from 059b4ea to c40baa6 Compare September 30, 2026 07:46
…cy Dialog Action

A stylesheet that repainted --surface-inverted or its hover no longer
reached primary buttons, because the stock CSS declared their fills from
palette steps. They now read the inverted surface they split from.

A templated dialog's legacy selection action kept a fixed h-10 and the
inverted fill beside the shared cancel Button, so a theme's button height
split the two. It now reads the Button's height and primary fill roles.
A templated dialog cleared its edge with border-none and set its title at a
fixed text-lg, semibold, display-family heading in the body ink, so a theme
could not draw Click UI's framed dialog or its 700 1.25rem/1.5 title.

OGDialog now reads a stroke width (in border-light), its inline padding and
header gap, and its title's size, leading, weight, family and ink from theme
roles. Every default reproduces today's dialog; the title size, family and
ink follow textLg, displayFontFamily and text-primary for a theme that names
only those. The ClickHouse theme takes Click UI's dialog stroke, space.x,
title gap, title typography and title color, the drift guard pins them, and
the parity probes now read the dialog stroke and scrim.
The dialog title color was added to the surfaces the verified mark is
measured against, so a theme that named only the title ink took the
verified fallback. It is a text color, not a surface the mark sits on.
Seven dialogs set text-text-primary on their OGDialogTitle, which Tailwind
Merge kept over the new dialog-title role, so a theme that gives dialog
titles their own ink reached only some of them. The redundant classes are
gone; the role defaults to the primary ink, so nothing changes by default,
and the design-rule counts for those files drop by the override each
removed.
@berry-13
berry-13 force-pushed the berry-13/theme-dialog-chrome branch from c40baa6 to bcdabad Compare September 30, 2026 08:19

This branch has not been deployed

No deployments
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.

1 participant