Skip to content

fix(apollo-vertex): theme Toaster through CSS variables - #1407

Open
ruudandriessen wants to merge 1 commit into
mainfrom
fix/vertex-sonner-css-theme
Open

ruudandriessen wants to merge 1 commit into
mainfrom
fix/vertex-sonner-css-theme

Conversation

@ruudandriessen

@ruudandriessen ruudandriessen commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to bb4a5b4 ("follow the shell theme in Toaster"). That change swapped next-themes for the shell's useTheme, so the Toaster still needs a theme provider, and the registry entry pulls in all of @uipath/shell for it.

The hook only fed Sonner's theme prop, which sets data-sonner-theme. Almost everything that attribute drives is already overridden by our CSS variables (--normal-bg/text/border) and the dark: classes on the status toasts. What was left were three Sonner dark-theme rules: description color, close button color and cancel button background. This PR covers those with token classes and drops the hook.

Result:

  • <Toaster /> follows the .dark class on the document. No provider needed.
  • The sonner registry entry no longer depends on @uipath/shell.
  • The theme prop stays ignored, so it can't disagree with the .dark class.
  • Docs setup and the notification example go back to a bare <Toaster />.

Trade-offs:

  • Apps must set .dark on an ancestor (the shell provider, next-themes and the docs all do).
  • Sonner's dark hover background on the close button is gone. The button is already transparent with no border, so this is barely visible.
  • If a future Sonner release adds theme-specific styles, they'll need a matching class here.

Testing: unit test, typecheck, lint and format pass. I checked plain, info, success, warning and error toasts, including a plain toast with a Cancel button, on the docs page in light and dark mode.

Toaster read resolvedTheme from the shell ThemeProvider only to set
Sonner's theme attribute. Its colors already come from CSS variables and
dark: classes, so drop the hook and cover the remaining Sonner dark-theme
styles (description, close button, cancel button) with token classes.
The toaster now follows the .dark class without a provider, and the
registry entry no longer pulls in @uipath/shell.

Assisted-by: Anthropic:claude-opus-5-5

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

🟢 Approval recommended

The implementation, registry metadata, tests, and documentation consistently remove provider coupling, with no unresolved findings.

No open issues 🎉

What changed in this PR

Decouples Apollo Vertex’s Toaster from the shell theme provider, using CSS variables and .dark classes instead.

Changes:

  • Adds theme overrides while continuing to ignore the theme prop.
  • Removes the shell registry dependency.
  • Updates tests, documentation, and examples for provider-free usage.
File Description
packages/​apollo-vertex/​registry/​sonner/​sonner.tsx Replaces the theme hook with CSS overrides.
packages/​apollo-vertex/​registry/​sonner/​sonner.test.tsx Tests provider-free rendering and ignored theme input.
packages/​apollo-vertex/​registry.json Removes the shell dependency.
apps/​apollo-vertex/​content/​docs/​guidelines/​notifications/​notification-examples.tsx Removes the example’s theme provider.
apps/​apollo-vertex/​content/​docs/​components/​sonner.mdx Documents provider-free setup and CSS-driven theming.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • ✅ 1947 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1713
ISC 91
Apache-2.0 56
BSD-3-Clause 28
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core — — — — —
@uipath/apollo-react — — — — —
@uipath/apollo-ui-icons — — — — —
@uipath/apollo-vertex 85.0% — (6 untracked) 330.0 KB 1.86 MB −7 B
@uipath/apollo-wind — — — — —
@uipath/ap-chat — — — — —

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@github-actions

Copy link
Copy Markdown
Contributor

Storybook visual diff

✅ No stories are affected by this PR's changes; nothing to compare. Logs

Updated (PT): Oct 19, 2026, 02:15:53 AM

@ruudandriessen
ruudandriessen marked this pull request as ready for review October 19, 2026 10:17
@ruudandriessen
ruudandriessen requested a review from a team as a code owner October 19, 2026 10:17

This branch was successfully deployed

4 active deployments
preview/apollo-vertex — 94e1be87 Deployed Oct 19, 2026 by github-actions[bot]
preview/apollo-design — 94e1be87 Deployed Oct 19, 2026 by github-actions[bot]
preview/apollo-landing — 94e1be87 Deployed Oct 19, 2026 by github-actions[bot]
preview/apollo-docs — 94e1be87 Deployed Oct 19, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:apollo-vertex size:L 100-499 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants