Skip to content

fix(web,admin,marketing): force dark statically instead of via next-themes - #6712

Open
Kitenite wants to merge 2 commits into
mainfrom
fix-forced-dark-without-next-themes
Open

Kitenite wants to merge 2 commits into
mainfrom
fix-forced-dark-without-next-themes

Conversation

@Kitenite

@Kitenite Kitenite commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Why

Next 16.2 / React 19.2 dev console error on every page of web/admin/marketing:
Encountered a script tag while rendering React component. Scripts inside React components are never executed when rendering on the client. — raised from Providers → ThemeProvider.

next-themes injects an inline <script> to apply the theme before paint; React 19.2 now flags that whenever the provider renders on the client. Upstream bugs pacocoursey/next-themes#385 #387 #397 are open with no release since 0.4.6, so there is nothing to bump to.

What

All three apps pin forcedTheme="dark" and nothing in them calls useTheme, so the provider was dead weight whose only output was the offending script.

  • <html className="dark" style={{ colorScheme: "dark" }}> in web + admin (marketing already had the class; gains color-scheme parity), suppressHydrationWarning dropped where it only existed for next-themes' client-side attribute mutation.
  • <Toaster theme="dark" /> in web + admin — the shared @superset/ui Toaster's useTheme() fallback is system, which would otherwise follow the OS on a forced-dark app.
  • next-themes removed from the three apps' package.json (@superset/ui keeps it for sonner).

Verified

  • tsc --noEmit clean in apps/web, apps/admin, apps/marketing; scripts/lint.sh clean.
  • Net −38 lines.

Summary by cubic

Forces dark mode statically across apps/web, apps/admin, and apps/marketing, removing next-themes to eliminate the React 19.2/Next 16.2 console error from the provider’s inline script. Old: ThemeProvider with forcedTheme="dark"; new: <html className="dark" style={{ colorScheme: 'dark' }}> and theme="dark" on the shared Toaster, with no UI changes besides consistent dark toasts and no hydration warnings.

  • Set <html className="dark" style={{ colorScheme: "dark" }}> in web/admin; marketing keeps dark and adds colorScheme: "dark". Removed suppressHydrationWarning where it only served next-themes.
  • Removed ThemeProvider and related THEME_STORAGE_KEY usage; passed theme="dark" to @superset/ui Toaster in web/admin.
  • Dropped next-themes from app package.json; @superset/ui retains it for sonner.
  • Review: confirm no useTheme usage in these apps and that only @superset/ui depends on next-themes. No migrations required.

Written for commit dadc6b0. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Style

    • Standardized the admin, marketing, and web experiences to consistently use dark mode.
    • Updated notifications and document color settings for a more consistent dark-theme appearance.
  • Refactor

    • Simplified theme handling across the applications.
    • Removed theme switching and related configuration no longer needed.

…hemes

All three apps pin forcedTheme="dark" and nothing in them calls
useTheme, so ThemeProvider's only output was the inline <script> it
injects to set the class before paint — which React 19.2 / Next 16 now
flags on every client render of Providers ("Encountered a script tag
while rendering React component"; next-themes #385/#387/#397, no
release since 0.4.6). Set the dark class and color-scheme on <html>
directly, pass theme="dark" to the shared Toaster (its useTheme
fallback would otherwise follow the OS), and drop the dependency from
the three apps. @superset/ui keeps next-themes for sonner.
@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f8bc60c8-9d8a-4de4-98b9-c11901435016

📥 Commits

Reviewing files that changed from the base of the PR and between da2d086 and dadc6b0.

📒 Files selected for processing (1)
  • apps/marketing/src/app/providers.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/marketing/src/app/providers.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The admin, marketing, and web apps remove next-themes and ThemeProvider. Their root layouts now set dark mode directly. Admin and web toasters explicitly use the dark theme.

Changes

Dark mode migration

Layer / File(s) Summary
Remove theme provider integration
apps/*/package.json, apps/*/src/app/providers.tsx
The applications remove next-themes, theme imports, and forced-dark ThemeProvider wrappers.
Configure explicit dark rendering
apps/*/src/app/layout.tsx
Root layouts set dark document styling. Admin and web toasters explicitly use the dark theme.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to dadc6

This change statically enforces dark mode and removes the affected theme-provider dependency across three apps; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change and follows the repository's conventional commit format.
Description check ✅ Passed The description explains the problem, implementation, testing, and scope, although it omits the template's checklist section.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-forced-dark-without-next-themes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) ✅ View Branch
Vercel API (Vercel) ✅ Open Preview
Vercel Web (Vercel) ✅ Open Preview
Vercel Marketing (Vercel) ✅ Open Preview
Vercel Admin (Vercel) ✅ Open Preview
Vercel Docs (Vercel) ✅ Open Preview

Preview updates automatically with new commits

@github-actions

Copy link
Copy Markdown
Contributor

This PR has had no activity for 53 days and will close in 7 days unless there is new activity. If this contribution is still important or relevant, please leave a comment to keep it open. If it closes, you are welcome to reopen it or ask a maintainer to reopen it. Thank you for contributing!

@github-actions github-actions Bot added the stale label Oct 14, 2026

This branch was previously deployed

1 inactive deployment
preview — dadc6b04 Deployed Aug 20, 2026 by Kitenite via Deploy API #8203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant