Repository navigation
feat(ui): start new people on the dark theme, for a while - #2280
Merged
Merged
Conversation
Owner decision 2026-11-10: every new person is greeted in dark mode for a
while. On Ansvisor Cloud, the sign-up page and onboarding (the welcome
page included) store the dark theme in a browser that has none yet, so
the rest of the app opens dark too and the sun/moon button switches it
back. A browser that already has a theme keeps it, so no one who uses
Ansvisor today changes. Self-hosted is unchanged.
- config/theme.ts: NEW_USER_THEME ('dark'; null stops it) and the
next-themes storage key.
- components/theme/new-user-theme.tsx: an inline script that sets it
before the page paints, and an effect for pages reached in the app.
- Help: getting-started/light-and-dark-mode (unapproved), from a new FAQ
entry.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
The sun/moon button is hidden while the menu is folded to icons (sidebar.tsx), so the article and the FAQ now say where to find it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
9 of 13 tasks
8 of 13 tasks
cihan-gyk
pushed a commit
to cihan-gyk/ansvisor
that referenced
this pull request
Nov 10, 2026
Brings in ansvisor#2280 (new people start on the dark theme). sign-up/page.tsx keeps both: <NewUserTheme /> before the shell, and the shell's headline and footnote with the untitled card. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
gkhngyk
pushed a commit
that referenced
this pull request
Nov 16, 2026
Follow-up to #2453, the owner's option B. Since #2280 and #2453, on Ansvisor Cloud the sign-up, sign-in, password and onboarding pages save dark in a browser with no saved theme. Someone who already used Ansvisor and never pressed the sun/moon button has no saved theme either, so they would switch to dark the next time they saw sign-in signed out. KeepCurrentTheme, rendered once in the dashboard layout, saves light in a browser with no saved theme when a signed-in person opens a dashboard page, on Cloud only. Light is the ThemeProvider's default, so nothing changes on screen. A saved theme is never changed, and a new person already has dark saved before they reach the dashboard. Self-hosted is unchanged. - config/theme.ts: EXISTING_USER_THEME ('light'), with the owner's choice and how to remove it; the comments on who starts dark updated, in new-user-theme.tsx too. - keep-current-theme.test.tsx: saves light only when nothing is saved, never overrides dark or light, nothing self-hosted, survives a throwing localStorage, draws nothing. - Dashboard layout tests: light saved on Cloud with nothing saved; a saved theme kept; nothing saved on the way to onboarding or self-hosted. - Help light-and-dark-mode and its FAQ source: people who already use Ansvisor keep their mode, new people start on dark; approved-articles regenerated. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The owner's decision of 2026-11-10: greet every new person in dark mode, for a while.
What a person sees (Ansvisor Cloud)
How it works
web/src/config/theme.ts:NEW_USER_THEME('dark') is the switch. Set it tonullto stop: people who already started dark keep it until they switch.THEME_STORAGE_KEYis next-themes' own key (theme).web/src/components/theme/new-user-theme.tsx(<NewUserTheme />), on Cloud only:darkclass before the page paints, in a browser that has no theme yet. So there is no flash of the light theme first. next-themes then reads the stored theme when the page hydrates.setThemefor a page reached inside the app (sign-in to sign-up), where React doesn't run an inline script.ThemeProviderdefault stayslight, so people with no stored theme who sign in are not switched.Help and docs
getting-started/light-and-dark-mode("Switch between light and dark mode"),approved: false, for the owner to approve.docs/faq.mdx, "Is there a dark mode?", the article's source.No migration, no new dependency, no lockfile change, no new UI string.
Related issue
Owner decision 2026-11-10.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd web && yarn vitest run src/components/theme src/lib/help.new-user-theme.test.tsxcovers:light;/sign-up. The page is dark from the first paint, and the app after sign-up opens dark./sign-up. It stays light.NEW_USER_THEMEtonull. A fresh window's/sign-upopens light.Not checked by eye: the built app redirects to itself on
localhostin the session that built this (the locale middleware), so the dark pages weren't screenshotted. The sign-up shell and onboarding already have dark styles (dark:classes, no fixed light colors).Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/) — 0 errors; the warnings are all in files this PR doesn't touchyarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)help/(or no user-visible change) — see help/README.mdChecks run:
yarn format:check,yarn lint(0 errors) andyarn typecheckpass.yarn test: 1,078 files, 11,823 passed, 1 skipped.yarn build(withNEXT_PUBLIC_IS_CLOUD=trueand CI's placeholder env) passes.Generated by Claude Code