Skip to content

🧭 feat: Give the Mobile Drawer Edge a Role and Move the Last Page Colours Onto Roles - #16631

Merged
berry-13 merged 4 commits into
devfrom
berry-13/theme-leakage-followups
Oct 2, 2026
Merged

berry-13 merged 4 commits into
devfrom
berry-13/theme-leakage-followups

Conversation

@berry-13

@berry-13 berry-13 commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Four places still painted colours no theme could reach. The mobile drawer drew its edge with dark-only utilities (dark:border-r dark:border-border-xheavy, added with the drawer rework in #16248). The web source image caption used bg-gray-900/80 text-white. The prompt panel's mobile backdrop used bg-black/20. The Insights agent picker popover used bg-surface-primary dark:bg-chart-widget-surface.

A new drawer-edge role carries the drawer's trailing edge. It defaults to the drawer's own fill in light, where the scrim already separates the drawer, and to border-xheavy in dark, so dark mode keeps today's edge. A theme that sets only surface-primary-alt or border-xheavy keeps the edge its mode drew, and ClickHouse sources both modes from the same Click UI tokens as those roles. The source caption reads the media overlay roles from #16596. The prompt panel backdrop takes bg-scrim, the page scrim the mobile drawer already uses. MultiSelect gains surface="widget", which the Insights picker uses in place of its dark override.

Audit (themable rubric, 2026-10-01), origin/dev to this head: C6 c6.sh hits 13 to 7, outside the allowlist 11 to 5. The 5 left are Artifacts.tsx (2, owned by #15911) and AgentConfig.tsx (3, owned by #16523). C7 c7refined.sh is unchanged at 127, 1 outside the allowlist (ArtifactCodeEditor.tsx:64, #15911). Design-rule suppressions 2506 to 2503.

Closes berry-13#222

Type of change

  • Feature
  • Tests / tooling / CI

Testing

Tested environments/configuration:

  • Mock e2e harness, Chromium, 390px mobile viewport for the drawer, default theme and the ClickHouse definition, light and dark.

Automated tests:

  • New e2e/specs/mock/scenarios/drawer-edge-theme.spec.ts: a definition that sets rgb-drawer-edge repaints the drawer's 1px edge in light and in dark.
  • mobile-drawer-controls.spec.ts boundary scenarios (default and ClickHouse, light and dark) still hold. The light case now checks that the edge paints exactly the drawer fill instead of checking that no border exists.
  • registry.spec.ts: a theme that sets only surface-primary-alt and border-xheavy keeps the drawer edge on the fill in light and the heavy border in dark, and an explicit rgb-drawer-edge wins.
  • New MultiSelect.spec.tsx: the popover keeps the shared menu surface by default and takes the widget surface with surface="widget".
  • packages/client theme suites: 505 passed. client jest --findRelatedTests on the four touched components: 6579 passed.
  • npx tsc --noEmit in client, packages/client and packages/data-provider: clean. The new fallback is typed Partial<IThemeRGB>: resolveTheme spreads every role fallback into one literal, and an untyped one pushed a full packages/client check past CI's 6 GB heap; typed, it peaks at about 4 GB. ESLint, Prettier, import sort and the design-rule suppression check pass.

Screenshots / recordings

Captured on this branch (mock harness, Chromium, 390px). Dark mode draws the same edge as dev; in light the edge is the drawer's own fill, so the drawer looks as it did.

Light Dark
Mobile drawer, no theme Drawer light Drawer dark
Mobile drawer, ClickHouse Drawer ClickHouse light Drawer ClickHouse dark

The source caption, prompt panel backdrop and Insights popover are not captured: the caption needs web search results and the backdrop the advanced prompt editor on a phone, neither of which the mock harness serves. Their changes are described under Risk.

Risk / compatibility

Not every default stays pixel-identical, and these are deliberate:

  • Mobile drawer, light mode: the drawer now always draws a 1px edge, in its own fill, so its content is 1px narrower. Dark mode is unchanged.
  • Source caption: moves from #0d0d0d at 80% to black at 80%, at most about 10 levels after compositing over the thumbnail.
  • Prompt panel backdrop (mobile, light): moves from black at 20% to the theme page scrim, matching the drawer's scrim. Dark keeps a black scrim at the theme's scrim opacity.

PromptForm.tsx also carries Prettier's class-order fix-ups on lines dev had left unformatted, which the commit hook applies. #16611 edits the drawer class line directly above the edge line this PR changes, so whichever merges second resolves a one-line conflict.

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

Copilot AI balanced review requested due to automatic review settings October 1, 2026 16:20

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The semantic role migration is internally consistent, backward-compatible, and covered by focused unit and browser tests.

Review effort: Balanced
Findings: None

What changed in this PR

Adds semantic theme roles to remove remaining hard-coded page colors while preserving mode-specific drawer behavior.

Changes:

  • Adds and documents the drawer-edge theme role across all palettes.
  • Applies semantic overlay, scrim, and widget surfaces to affected UI.
  • Adds unit and end-to-end coverage for theme resolution and rendering.
File Description
packages/​data-provider/​src/​theme.ts Registers the drawer-edge token.
packages/​client/​src/​theme/​types/​index.ts Adds drawer-edge theme types.
packages/​client/​src/​theme/​tokens.css Exposes the Tailwind color variable.
packages/​client/​src/​theme/​themes/​highContrast.ts Defines high-contrast edge colors.
packages/​client/​src/​theme/​themes/​default.ts Defines the light edge color.
packages/​client/​src/​theme/​themes/​dark.ts Defines the dark edge color.
packages/​client/​src/​theme/​themes/​clickui.spec.ts Records Click UI token sources.
packages/​client/​src/​theme/​themes/​clickhouse.ts Defines ClickHouse edge colors.
packages/​client/​src/​theme/​registry.ts Resolves backward-compatible edge fallbacks.
packages/​client/​src/​theme/​registry.spec.ts Tests fallback and explicit overrides.
packages/​client/​src/​theme/​README.md Documents the new utility.
packages/​client/​src/​theme/​defaults.spec.ts Updates token-count coverage.
packages/​client/​src/​theme/​defaults.css Adds mode-specific CSS defaults.
packages/​client/​src/​components/​MultiSelect.tsx Adds the widget surface variant.
packages/​client/​src/​components/​MultiSelect.spec.tsx Tests popover surface selection.
eslint-suppressions.json Reduces resolved design-lint suppressions.
e2e/​specs/​mock/​scenarios/​mobile-drawer-controls.spec.ts Updates drawer boundary assertions.
e2e/​specs/​mock/​scenarios/​drawer-edge-theme.spec.ts Tests custom edge theming.
client/​src/​components/​Web/​Sources.tsx Uses media-overlay roles for captions.
client/​src/​components/​UnifiedSidebar/​UnifiedSidebar.tsx Applies the drawer-edge role.
client/​src/​components/​Prompts/​forms/​PromptForm.tsx Uses the semantic scrim role.
client/​src/​components/​Insights/​InsightsView.tsx Uses the widget popover surface.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codegraph-librechat codegraph-librechat Bot added the 🗺️ Chat UI Shell codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) label Oct 1, 2026
@berry-13
berry-13 marked this pull request as ready for review October 1, 2026 16:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 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 ✅ Completed 2026-10-02T21:58:28.703416Z bda163c New commits
🔒 Security Review ✅ Completed 2026-10-01T16:34:49.121807Z f389255 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.

@codegraph-librechat codegraph-librechat Bot added the 🗺️ UI Design System codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) label Oct 1, 2026
…rs Onto Roles

The mobile drawer drew its edge with dark-only border utilities, the web source caption with gray-900 and white, the prompt panel's mobile backdrop with black at 20%, and the Insights agent picker popover with a dark-only override, so no theme could reach them.

drawer-edge paints the drawer's trailing edge: the drawer's own fill in light, where the scrim already separates it, and border-xheavy in dark, so dark mode keeps today's edge; a theme that sets only those two roles keeps the edge its mode drew. The source caption reads the media overlay roles, the prompt panel backdrop takes the page scrim the mobile drawer uses, and MultiSelect gains a widget surface that the Insights picker uses in place of its dark override.
resolveTheme spreads every role fallback into one object literal, and each untyped conditional spread doubles the union the checker builds. One more pushed tsc for packages/client past CI's 6 GB heap. Typing the fallback as Partial<IThemeRGB> keeps it from adding to that union; a full check now peaks at about 4 GB.
@berry-13
berry-13 force-pushed the berry-13/theme-leakage-followups branch from cfd97ad to bda163c Compare October 2, 2026 21:55
@berry-13
berry-13 merged commit 2d35614 into dev Oct 2, 2026
45 checks passed
@berry-13
berry-13 deleted the berry-13/theme-leakage-followups branch October 2, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗺️ Chat UI Shell codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) 🗺️ UI Design System codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants