chore(lint): consolidate /settings localStorage reads (21 → 19 errors)#186
Merged
operatoruplift merged 1 commit intomasterfrom Apr 28, 2026
Merged
chore(lint): consolidate /settings localStorage reads (21 → 19 errors)#186operatoruplift merged 1 commit intomasterfrom
operatoruplift merged 1 commit intomasterfrom
Conversation
The /settings page had a 17-line useEffect that read localStorage at mount and called 7 separate setStates. Replaced with a single useMemo lazy load + lazy-initializer useStates that pull from it. The theme effect stays as a real DOM side effect (sets data-theme on <html>), but it now only reacts to `theme` state changes - no synchronous setState in the effect body. The 'Commander' default display name (last sci-fi cosplay residual, post-#163/#168) became 'Friend'. AdvancedSettings inner panel had its own setState-in-effect that read advanced_mode from localStorage. Hoisted to a lazy initializer the same way. | Change | File:line | |---|---| | 7-setState mount effect → useMemo + lazy initializers | settings/page.tsx:38-56 | | 'Commander' default → 'Friend' | settings/page.tsx:23 | | AdvancedSettings setAdvancedMode in effect → lazy initializer | settings/page.tsx:412-417 | ## Verified - pnpm exec tsc --noEmit: clean - pnpm check: 3 passed, 0 failed - pnpm lint: 85 problems / 19 errors (was 87 / 21) ## Rollback Single git revert.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
operatoruplift
added a commit
that referenced
this pull request
Apr 28, 2026
PR #168 retired the "Commander" default in /api/auth/signup. PR #186 retired it in /settings page. But four more places still stamped "Commander" on a fresh user's account: | File | Surface | |---|---| | app/(auth)/signup/page.tsx:35 | localStorage 'user' write after Supabase signup | | app/(auth)/login/page.tsx:60 | userName fallback after Privy login | | app/(auth)/login/page.tsx:165 | localStorage 'user' write after wallet payment | | app/(dashboard)/profile/page.tsx:11 | initial useState for the profile page | | app/(dashboard)/onboarding/page.tsx:43 | onboarding's saved user.name | Each now derives a default from the email's local part (jane@x.com -> "jane") or falls back to "Friend" -- matching the pattern set in #168. The two comment hits left in the repo (chat/page.tsx + the auth/signup route) explicitly DOCUMENT what was retired and stay. After this merges: grep -rnE "'Commander'" app/ src/ returns zero non-comment hits. ## Verified - pnpm exec tsc --noEmit: clean - pnpm check: 3 passed, 0 failed - Banned-vocab grep: 0 user-facing hits ## Rollback Single git revert. 4 files.
operatoruplift
added a commit
that referenced
this pull request
Apr 28, 2026
… pages (#192) Two new specs added to consumer-copy.spec.ts so the post-#190/#191 state can't drift back. ## "JSON-LD structured data uses the consumer pitch" PR #190 rewrote the schema.org SoftwareApplication description blob that Google reads for rich-result snippets. The old text was: "Local-first AI agent platform with secure, private memory. Build, deploy, and monetize autonomous agents, no cloud required." Now the test: - Asserts the new "drafts your email" pitch IS in the JSON-LD - Asserts the old "Local-first AI agent platform" + "autonomous agents" strings are NOT ## "/login + /signup auth pages do not show 'Commander'" PRs #168, #186, and #191 retired "Commander" across the API + 5 client surfaces. The auth pages are the funnel where a fresh user landed - this spec verifies neither /login nor /signup ever shows the word, and also verifies "Local-first" stays out (the auth footer pill rows used to say it; #190 fixed that). ## Verified - pnpm exec tsc --noEmit: clean - pnpm exec playwright test consumer-copy.spec.ts: 8 passed (37.3s) ## Rollback Single git revert. One file.
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.
/settings page mount effect refactor
The /settings page had a 17-line useEffect that read localStorage at mount and called 7 separate setStates. Replaced with a single
useMemolazy-load + lazy-initializeruseStatesthat pull from it.useMemo+ lazy initializerssettings/page.tsx:38-56'Commander'default display name →'Friend'settings/page.tsx:23AdvancedSettingssetAdvancedMode in effect → lazy initializersettings/page.tsx:412-417Theme side effect
The theme application (
document.documentElement.setAttribute('data-theme', 'light')) stays inuseEffectbecause it's a real DOM side effect, but it now only reacts tothemestate changes — no synchronous setState in the effect body.Honesty bonus
The
'Commander'default display name (last sci-fi cosplay residual, after #163 retired it from the dashboard h1 and #168 retired it from/api/auth/signup) became'Friend'. This was the last hit anywhere in the codebase.Verified
Net diff
Rollback
Single
git revert.