feat(account): Account Settings page (/account/settings) — closes #74#81
Merged
Conversation
…ings
Build the sectioned account Settings page at /{locale}/account/settings under
the shared account shell, fixing the header dropdown "Ayarlar" 404.
- Profile / Security / Addresses / Preferences sections as reusable components;
profile, password and avatar logic moved out of the old ProfilePageClient
(removed) so there is no duplicated profile logic.
- Redirect /profile -> /account/settings.
- Embed AddressListClient via a new backward-compatible `embedded` prop (card +
h2 heading); the standalone /profile/addresses page is unchanged.
- Security hides the change-password form for Google-only accounts; expose a
computed `hasPassword` on GET /auth/me (never leaking the hash) to drive it.
- Preferences reuse LanguageSwitcher + ThemeToggle (client-only, no API).
- i18n keys added to az/en/ru; vitest coverage for every section + composition
and a backend regression test for hasPassword.
Danger zone / delete-account omitted (needs a new DELETE /users/me) — follow-up.
Closes #74
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The new settings sections left the change/cancel handlers and mutation onSuccess callbacks unexercised, dropping global function coverage to 79.94% (< 80% CI gate). Add tests for the password/profile success + cancel paths and avatar upload success. Global functions coverage now 81.8%. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Builds the customer Settings page at
/{locale}/account/settingsunder the sharedaccount/shell, fixing the header dropdown "Ayarlar / Settings" which previously 404'd. Consolidates the old/profileUI into a proper sectioned settings page and removes the duplicated profile logic.Closes #74.
What's included
Sectioned page (
AccountSettingsClient) with four cards, each extracted into a reusable component:ProfileSection) — avatar upload (useUpdateAvatar), name/email edit (useUpdateProfile), role + verified badges, member-since.SecuritySection) — change-password form (useUpdatePassword) with client-side match validation and "min 8 chars" hint. Google-only accounts see a clear notice instead of a form.AddressListClient(full CRUD) via a new backward-compatibleembeddedprop (renders as a card with anh2; standalone/profile/addressesis unchanged).PreferencesSection) — language (LanguageSwitcher) + theme (ThemeToggle), client-only.Consolidation
ProfilePageClient(deleted) into the section components — no duplicated logic./profilenow redirects to/account/settings.Backend (small addition)
GET /auth/menow returns a computedhasPasswordboolean (Google-only accounts have none) so the UI can hide the password form. The password hash is never exposed. Regression tests added toauth.test.ts.i18n — new keys added to all three
messages/{az,en,ru}.jsonunder theprofilenamespace.Acceptance criteria
/{locale}/account/settings./login(via the accountlayout.tsxProtectedRoute); page isnoindex.lint, clienttest, andnext buildpass with new tests.Out of scope (follow-up)
DELETE /users/meendpoint. Omitted per the issue's "optional/follow-up" note; recommend a separate backend task.Usermodel has nophonecolumn, so it's omitted (as the issue instructed).Testing
ProfileSection,SecuritySection,PreferencesSection, andAccountSettingsClient(loading / error / loaded / Google-only). Full suite green: 388 tests.next lintclean,next buildsucceeds.tsc --noEmit+eslintclean.hasPasswordverified live viacurlagainst a local server (returnstruefor a password account, hash not present). Jest regression tests added (run in CI's dedicated test DB — the local suite is intentionally not run since its global setup wipes whatever DB it connects to)./profileredirects to/account/settings.🤖 Generated with Claude Code