Skip to content

feat: redesign Settings page with tabbed interface - #142

Merged
terranalon merged 6 commits into
mainfrom
feat/settings-page
May 23, 2026
Merged

terranalon merged 6 commits into
mainfrom
feat/settings-page

Conversation

@terranalon

Copy link
Copy Markdown
Owner

Summary

  • Redesign Settings page from vertical stacked sections to a 3-tab interface (Profile, Security, Notifications) matching the approved mock
  • Profile tab consolidates personal info, appearance (theme selector), and preferences (currency, combined-view toggle) into a single card with subsection dividers
  • Security tab preserves all existing MFA functionality (TOTP, Email OTP, recovery codes, password change)
  • Notifications tab displays toggle rows for each notification type
  • Uses app CSS tokens (--bg-secondary, --bg-tertiary, --border-primary, etc.) for full light/dark theme support

Closes #128

Test plan

  • Verify Settings page loads at /settings without console errors
  • Switch between Profile, Security, and Notifications tabs
  • Test theme selector (Light/Dark/System) applies correctly
  • Test currency dropdown persists selection
  • Test "All Portfolios" toggle calls updatePreferences
  • Test Change Password modal opens and functions
  • Test MFA toggles (TOTP enable/disable, Email OTP enable/disable)
  • Verify layout matches mock at various viewport widths
  • Test light mode and dark mode rendering

Generated with Claude Code

terranalon and others added 2 commits April 7, 2026 20:02
Replace vertical stacked sections layout with a 3-tab interface
(Profile, Security, Notifications) matching the approved mock.
Profile tab consolidates personal info, appearance, and preferences
into a single card with subsections.

Closes #128

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract INPUT_CLASS/SELECT_CLASS, MFA_METHODS data array, Divider,
and Modal components to reduce duplication and improve readability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@terranalon

Copy link
Copy Markdown
Owner Author

Code review

Found 2 issues:

  1. "Save Changes" button has no onClick handler — the username field is editable local state but clicking Save does nothing. The old code had handleSaveProfile = () => { // TODO: Implement API call } which at least documented the intent; this PR removes the handler entirely, leaving the button silently broken.

<div className="mt-5">
<button className="inline-flex items-center gap-1.5 px-[18px] py-[9px] rounded-lg text-[13px] font-semibold bg-accent text-white hover:bg-accent-hover transition-colors cursor-pointer">
Save Changes
</button>
</div>

  1. RegenerateRecoveryCodes uses onComplete={closeModal} instead of onComplete={handleMfaComplete} — every other MFA modal (TotpSetup, EmailOtpSetup, DisableMfaMethod) passes handleMfaComplete, which calls refreshMfaStatus() before closing. The regenerate modal only calls closeModal, so mfaStatus is not re-fetched after regeneration. While has_recovery_codes stays true either way, this breaks the consistent pattern and will silently skip any state refresh if the backend changes what it returns after code regeneration.

)}
{modal === 'regenerate' && (
<RegenerateRecoveryCodes onComplete={closeModal} onCancel={closeModal} />
)}
</Modal>

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

- Add handleSaveProfile that calls updatePreferences({ username }) on
  PUT /auth/me; show saving state and surface API errors inline
- Change RegenerateRecoveryCodes onComplete from closeModal to
  handleMfaComplete so MFA status is refreshed after code regeneration

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@terranalon

Copy link
Copy Markdown
Owner Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Previously flagged issues (Save Changes missing onClick, RegenerateRecoveryCodes wrong callback) are both resolved in the latest commit.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

terranalon and others added 3 commits May 23, 2026 12:01
…gation

- Add client-side username validation (3-30 chars, [A-Za-z0-9_]) in handleSaveProfile to mirror backend constraints and avoid unnecessary round-trips
- Sync username input to normalized (lowercased) value returned by server after a successful save
- Parse backend error response body in updatePreferences and throw with the actual detail/message instead of a generic hardcoded string

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace fixed max-w-[780px] with clamp(320px, 88%, 1400px) for smooth proportional scaling across all viewport sizes
- Fix select elements (currency, MFA method) showing white background by adding explicit inline style overrides to beat browser UA defaults
- Remove max-w-none PageContainer override in favor of standard width

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e-fetch on currency change

- Add 'system' as a first-class theme mode: derives effective dark/light from matchMedia,
  reacts to OS preference changes, persists 'system' to localStorage
- Update ThemeToggle to accept isDark bool instead of theme string so it renders
  the correct icon when theme is 'system'
- Update HeaderBar and Navbar to destructure isDark from useTheme()
- PortfolioContext now consumes useCurrency and passes display_currency to the
  portfolios API, re-fetching when the user changes their currency preference

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@terranalon
terranalon merged commit 86d2525 into main May 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Implement settings page

1 participant