Repository navigation
fix(theme): keep people who already use Ansvisor on light - #2457
Merged
Merged
Conversation
Follow-up to ansvisor#2453, the owner's option B. Since ansvisor#2280 and ansvisor#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
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
cihan-gyk
pushed a commit
to cihan-gyk/ansvisor
that referenced
this pull request
Nov 16, 2026
Brings in ansvisor#2449, ansvisor#2450, ansvisor#2457, ansvisor#2460 and ansvisor#2461 (Chat and MCP lookups by code, id, words, domain or address; never give up on data it could read). Conflicts, resolved as the union of both sides: - agent-eval.ts: the scenario keeps askedSignals/askedDomains and checks; QUESTION_SCENARIOS holds action-by-code, signal-by-code, citation-by-domain and the three ai-revenue questions; every run gets "never gives up on data it could read" and then its scenario's checks. - agent-eval-data.ts: EvalWorkspace is default, action_backlog, long_lists and conversions_off; both sides' imports. - agent-eval.test.ts: both sides' imports. - brand-scope.test.ts: the AI-revenue reads and the lookups. 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
Follow-up to #2453. This is 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. Most people who already use Ansvisor never pressed the sun/moon button, so they have no saved theme either. They would switch to dark the next time they saw sign-in signed out.
With this change, a signed-in person who opens any dashboard page in a browser with no saved theme gets light saved. Light is what they already see, so nothing changes on screen. New people are not affected: dark was saved on sign-up, sign-in or onboarding before they reach the dashboard. Self-hosted is unchanged.
Changes
web/src/components/theme/keep-current-theme.tsx(new): a small client component. On Cloud, in an effect, it saves light when nothing is saved. It never changes a saved theme. It does nothing if localStorage throws. It draws nothing.web/src/app/[locale]/(dashboard)/layout.tsx: renders it once, next toBrandLoader.web/src/config/theme.ts: newEXISTING_USER_THEME = 'light', with the owner's choice and how to remove it. Set it tonullto stop, or remove the component and the constant. TheNEW_USER_THEMEcomment now says who starts dark.web/src/components/theme/new-user-theme.tsx: comment updated.light-and-dark-modeanddocs/faq.mdx: people who already use Ansvisor keep their mode, new people start on dark, a new browser or device starts on dark at sign-in.approved-articles.jsonregenerated.keep-current-theme.test.tsx(new) and 5 new cases in the dashboard layout tests.Who sees what
How to test
NEXT_PUBLIC_IS_CLOUD=true), sign in, then in DevTools remove thethemekey from localStorage.themeis nowlight.themetodarkand open a dashboard page. It stays dark.themeand open a dashboard page. Nothing is saved.Checks
npx tsc --noEmit -p .: clean.src/components/theme, the dashboard layout, the(marketing)auth pages,src/lib/help,src/i18n,use-server-exports). The(onboarding)tests pass too (3 files, 37 tests).--max-warnings=0) and Prettier clean on the changed code files.git merge-treewithmainat299a19e95: clean.'use server'file touched.Generated by Claude Code