Repository navigation
fix(apollo-vertex): follow the shell theme in Toaster - #1382
Conversation
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.
|
Apollo Coded App preview deployments are ready.
|
Dependency License Review
License distribution
Excluded packages
|
There was a problem hiding this comment.
🟡 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.
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.
📊 Coverage + size by packagePer-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.
"Coverage" is each package's own |
There was a problem hiding this comment.
🟢 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
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 |
The missing-provider check belongs on useTheme. Toaster calls it directly and still uses system when nothing is mounted.
A null resolvedTheme widened the public hook result. With no provider, useTheme still returns ThemeProviderState and resolves system the same way the provider does.
There was a problem hiding this comment.
🟢 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
useTheme throws again outside ThemeProvider. Toaster always passes resolvedTheme and drops a theme prop so it cannot override the provider.


Summary
ToasterreadsresolvedThemefrom the shell theme hook instead ofnext-themes. An app that only mounts the shell theme provider stayed onsystemand ignored the shell toggle.useThemestill throws when noThemeProvideris mounted.ToastercallsuseTheme()directly and always passesresolvedTheme. Athemeprop is discarded so it cannot override the provider.registry/sonner/sonner.tsximportsuseThemefromregistry/shell/shell-theme-providerand passesresolvedTheme(lightordark) to Sonner.next-themes. It depends on@uipath/shellso a registry install includes the theme hook.next-themesis removed from the package dependencies.ShellThemeProvider. The setup snippet wrapsThemeProvider.Invoice app
vertical-solution-invoice-processingpins@uipath/apollo-vertex@0.4.0. Switching the root route to the packageToasterand deleting the local wrapper typechecks against that pin (tsc --noEmitinsolution/client). That switch is https://github.com/UiPath/vertical-solution-invoice-processing/pull/2409.Published
0.4.0still callsnext-themesinsideToaster. Toast theme follows the shell toggle after a release that contains this change and the app moves off0.4.0.The package toaster call site is
solution/client/src/index.tsx(<Toaster />insideThemeProvider). Deletedsolution/client/src/components/ui/sonner.tsxandsolution/client/src/components/ui/sonner.spec.tsx.toast()call sites still importtoastfrom thesonnerpackage.