Skip to content

fix(apollo-vertex): follow the shell theme in Toaster - #1382

Merged
ruudandriessen merged 5 commits into
mainfrom
cursor/toaster-shell-theme-9d18
Oct 16, 2026
Merged

ruudandriessen merged 5 commits into
mainfrom
cursor/toaster-shell-theme-9d18

Conversation

@ruudandriessen

@ruudandriessen ruudandriessen commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Toaster reads resolvedTheme from the shell theme hook instead of next-themes. An app that only mounts the shell theme provider stayed on system and ignored the shell toggle.

useTheme still throws when no ThemeProvider is mounted. Toaster calls useTheme() directly and always passes resolvedTheme. A theme prop is discarded so it cannot override the provider.

  • registry/sonner/sonner.tsx imports useTheme from registry/shell/shell-theme-provider and passes resolvedTheme (light or dark) to Sonner.
  • The sonner registry item no longer depends on next-themes. It depends on @uipath/shell so a registry install includes the theme hook. next-themes is removed from the package dependencies.
  • The docs toast example renders inside ShellThemeProvider. The setup snippet wraps ThemeProvider.

Invoice app

vertical-solution-invoice-processing pins @uipath/apollo-vertex@0.4.0. Switching the root route to the package Toaster and deleting the local wrapper typechecks against that pin (tsc --noEmit in solution/client). That switch is https://github.com/UiPath/vertical-solution-invoice-processing/pull/2409.

Published 0.4.0 still calls next-themes inside Toaster. Toast theme follows the shell toggle after a release that contains this change and the app moves off 0.4.0.

The package toaster call site is solution/client/src/index.tsx (<Toaster /> inside ThemeProvider). Deleted solution/client/src/components/ui/sonner.tsx and solution/client/src/components/ui/sonner.spec.tsx. toast() call sites still import toast from the sonner package.

Open in Web Open in Cursor 

Toaster asked next-themes for the theme, so an app that only mounts the
shell theme provider stayed on system. Read resolvedTheme from the shell
hook and drop the next-themes dependency.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 08:43
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Apollo Coded App preview deployments are ready.

Project Status Preview Updated (PT)
apollo-design Ready Preview · Logs Oct 16, 2026, 02:32:38 AM
apollo-docs Ready Preview · Logs Oct 16, 2026, 02:32:38 AM
apollo-landing Ready Preview · Logs Oct 16, 2026, 02:32:38 AM
apollo-vertex Ready Preview · Logs Oct 16, 2026, 02:32:38 AM

@github-actions github-actions Bot added the size:L 100-499 changed lines. label Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • ✅ 1942 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1708
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

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.

🟡 Changes recommended

Existing provider-free Toaster usages now throw during rendering, including those with an explicit theme.

1 open finding
What changed in this PR

Updates Apollo Vertex’s Toaster to follow the shell theme instead of next-themes.

Changes:

  • Uses the shell’s resolved theme and updates registry dependencies.
  • Adds theme-toggle and system-theme tests.
  • Updates documentation and examples to include a theme provider.
File Description
pnpm-lock.yaml Removes Vertex’s next-themes dependency entry.
packages/​apollo-vertex/​registry/​sonner/​sonner.tsx Passes the shell theme to Sonner.
packages/​apollo-vertex/​registry/​sonner/​sonner.test.tsx Tests shell theme propagation.
packages/​apollo-vertex/​registry.json Adds the shell registry dependency.
packages/​apollo-vertex/​package.json Removes next-themes.
apps/​apollo-vertex/​content/​docs/​guidelines/​notifications/​notification-examples.tsx Wraps toast examples in the shell provider.
apps/​apollo-vertex/​content/​docs/​components/​sonner.mdx Updates setup and theme documentation.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

🧠 Review effort: Balanced


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

Comment thread packages/apollo-vertex/registry/sonner/sonner.tsx
useTheme throws outside ThemeProvider, so a standalone Toaster crashed
before an explicit theme reached Sonner. Keep the shell resolved theme
when a provider is mounted, and honor a theme prop either way.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 08:50
@github-actions

github-actions Bot commented Oct 16, 2026 •

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 — — 42.02 MB 50.17 MB ±0
@uipath/apollo-react — — 7.99 MB 31.45 MB ±0
@uipath/apollo-ui-icons — — 2.86 MB 6.97 MB ±0
@uipath/apollo-vertex 68.8% 90.9% (10/11) 325.6 KB 1.84 MB +103 B
@uipath/apollo-wind — — 785.2 KB 4.55 MB −3 B
@uipath/ap-chat — — 40.37 MB 45.58 MB ±0

"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.

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

No blocking issues remain, and regression tests cover the changed behavior, though tests were not executed during review.

0 open findings

1 resolved since last review
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

🧠 Review effort: Balanced

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Storybook visual diff

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

Updated (PT): Oct 16, 2026, 03:14:53 AM

@ruudandriessen
ruudandriessen marked this pull request as ready for review October 16, 2026 09:14
@ruudandriessen
ruudandriessen requested a review from a team as a code owner October 16, 2026 09:14
Comment thread packages/apollo-vertex/registry/sonner/sonner.tsx Outdated
The missing-provider check belongs on useTheme. Toaster calls it
directly and still uses system when nothing is mounted.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 09:19

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.

🟡 Changes recommended

The public theme hook’s newly nullable return type breaks existing strict-TypeScript consumers.

1 open finding
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

🧠 Review effort: Balanced

Comment thread packages/apollo-vertex/registry/shell/shell-theme-provider.tsx Outdated
A null resolvedTheme widened the public hook result. With no provider,
useTheme still returns ThemeProviderState and resolves system the same
way the provider does.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 09:26

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

Static review found no blocking issues in the focused theme integration; tests were inspected but not executed.

0 open findings

1 resolved since last review
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

🧠 Review effort: Balanced

Comment thread packages/apollo-vertex/registry/sonner/sonner.tsx Outdated
Comment thread packages/apollo-vertex/registry/shell/shell-theme-provider.tsx
useTheme throws again outside ThemeProvider. Toaster always passes
resolvedTheme and drops a theme prop so it cannot override the provider.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 10:09
@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing October 16, 2026 10:09 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design October 16, 2026 10:09 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-vertex October 16, 2026 10:09 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs October 16, 2026 10:09 Destroyed

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.

🔵 Needs a closer look

The new provider requirement needs a compatibility decision for existing standalone Toaster consumers.

0 open findings

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

🧠 Review effort: Balanced

@ruudandriessen
ruudandriessen merged commit 67ed3b7 into main Oct 16, 2026
55 of 56 checks passed
@ruudandriessen
ruudandriessen deleted the cursor/toaster-shell-theme-9d18 branch October 16, 2026 11:04

This branch was successfully deployed

No deployments
preview/apollo-docs — 09a2cfe3 Deployed Oct 16, 2026 by github-actions[bot]
preview/apollo-vertex — 09a2cfe3 Deployed Oct 16, 2026 by github-actions[bot]
preview/apollo-design — 09a2cfe3 Deployed Oct 16, 2026 by github-actions[bot]
preview/apollo-landing — 09a2cfe3 Deployed Oct 16, 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.

4 participants