Status: Draft
Author: nguyenhuuca
Date: 2026-06-20
Beads Issue: N/A — Beads (bd) is not installed in this repo (no .beads/). Task tracking is the work-breakdown table below; convert to issues if Beads is later adopted.
Related PRD:PRD-user-settingsRelated ADR:ADR-0016: User Settings DesignRelated Spec:spec-user-settings
Implement the self-service Settings feature: a backend user_settings store with GET/PATCH preference endpoints and a soft-delete account endpoint, plus a frontend Settings view wired into the existing nav. Behavior is fully defined by the spec; this plan sequences the work and pins it to verified codebase patterns.
Frontend wiring via AppShellactiveNav === 'settings', NOT a react-router /settings route
Verified: app has no route-based views; a "Settings" nav button already exists rendering <ComingSoon>. Spec correction: "route /settings" → state-nav settings.
Error responses are { status: "FAILED", error: {...} } via RestExceptionHandler
Verified envelope differs from the spec's bare ResultErrorInfo. Spec correction: error body is wrapped under error. Frontend client.js already normalizes to { message, status }.
Service uses @RequiredArgsConstructor (comment-style) or setter @Autowired (share-style)
Both are accepted in the codebase; use @RequiredArgsConstructor for the new impl (simpler).
Reuse Totp.verify(otp, user.getMfaSecret()) for delete step-up
No new MFA code; mirrors UserServiceImpl.verifyMfa.
Add confirmation to logging.masking.fields; otp already masked
Details: Lombok POJOs with @Builder (codebase uses classes, not records, for DTOs). Use @Sensitive on otp/confirmation (belt-and-suspenders with masking config).
getSettings() — resolve user via AppUtils.getCurrentUser(); lazy-create defaults row if absent (@Transactional).
updateSettings(UpdateUserSettingsRequest) — validate ALL provided fields first (atomic); reject whole request on any invalid field (CustomException 400, message Invalid value for field '<field>'); empty body → 400 Empty update; persist partial; return full DTO.
Design source (do NOT re-fetch — already downloaded):
artifacts/stitch_settings_web.png — mockup; use for layout/spacing/visual reference.
artifacts/stitch_settings_web.html — reference markup; use for structure (bento grid, section order, toggle/quality-selector anatomy) and the source color palette. From Stitch project 11227470478146862224, screen d4111b49ad524dee8e0b6096b0f3e75c.
CSS source & rule: The app does not use Tailwind. All styling lives in webapp/src/styles/index.css as CSS custom properties + .app-* classes. Translate the Stitch design into those tokens — never import Tailwind or copy tailwind.config/utility classes from the Stitch HTML.
Color mapping (Stitch → app token in index.css):
Stitch (Tailwind var)
Hex
App token
Status
background / surface
#0e0e0e
--bg
✅ identical
surface-container-low
#131313
--bg-surface
✅ identical
surface-container
#1a1919
--bg-elevated
✅ identical
secondary (accent)
#00eefc
--accent-cyan
✅ identical
primary (active/like)
#ff8d89
--primary
✅ identical
on-surface
#ffffff
--text
✅ identical
on-surface-variant
#adaaaa
--text-muted
✅ identical
error (Danger Zone)
#ff7351
add--danger
⚠️ verify/add
tertiary (purple, Playback icon)
#cb9cff
—
optional accent; reuse --accent-cyan if absent
Palette is ~90% already in the design system — mostly token reuse, only the danger color needs verifying.
Class reuse vs new (Step 4.0 builds the new ones):
Details: Ensure api.patch exists and api.delete can send a JSON body (delete-account needs otp/confirmation).
[ ] Step 4.2: React Query hooks
Files: webapp/src/hooks/useSettings.js
Details: useSettings() → ['settings']; useUpdateSettings() mutation, onSuccess writes returned full object into ['settings']; useDeleteAccount() mutation.
Details: Five sections following artifacts/stitch_settings_web.{png,html}, using the .app-* + .settings-* classes from Step 4.0 (no Tailwind). Each toggle autosaves via PATCH of its single field; revert + .app-alert.error on failure. "Change Password" rendered only when passwordEnabled. accountStatus panel only when present.
Spec corrections to fold back (optional): (a) frontend is activeNav-based, not a /settings route; (b) error envelope is { status:"FAILED", error:{...} }. Consider a spec v1.1 noting both.
incognitoEnabled is persisted but inert until Watch History (ADR-0013) ships — keep the field, no recording hook yet.
Beads not installed: if adopted later, convert the Work Breakdown table to bd issues with the same dependency edges.