Feat: Settings & Preferences Module - #41
Open
uadamu00005-netizen wants to merge 13 commits into
Open
Conversation
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.
Closes #24
Summary
Adds a full Settings & Preferences page with four sections (Account, Privacy, Notifications, Display), app-wide dark mode support, and complete account management functionality.
What's new
Settings page (
/settings)Account management (new
authServicemethods)updateAccount(AccountUpdate)— update name and email, syncs localStorage user registrychangePassword(PasswordChange)— validates current password, enforces 8-char minimumdeleteAccount()— removes user, clears session and profile data (with typed "DELETE" confirmation)Privacy settings
showProfile) and listing visibility (showListings)profileServiceand stored across sessionsDisplay settings
Dark mode infrastructure
darkMode: "class"in Tailwind config--brand-accent/--brand-mutedwith.darkoverridesusePreferenceshook resolves effective theme and appliesdarkclass to<html>ThemeProviderwired intoProvidersfor app-wide theme applicationdark:variant classes on all new settings componentsFiles changed
src/types/auth.tsAccountUpdate,PasswordChangeinterfacessrc/types/profile.tscompactLayout,showProfile,showListingstoUserPreferencessrc/services/authService.tsupdateAccount(),changePassword(),deleteAccount()src/services/profileService.tsupdateProfile()handles new preference fieldssrc/hooks/usePreferences.tssrc/components/ThemeProvider.tsxsrc/components/settings/AccountSettings.tsxsrc/components/settings/PrivacySettings.tsxsrc/components/settings/DisplaySettings.tsxsrc/app/settings/SettingsClient.tsxsrc/app/settings/page.tsxsrc/components/Providers.tsxThemeProviderwrappersrc/app/globals.csstailwind.config.tsdarkMode: "class"+brandcolor namespacesrc/components/__tests__/ProfileEdit.test.tsxsrc/components/__tests__/ProfileView.test.tsxType-check
✅ Zero new errors — all 7 remaining errors are pre-existing (
lucide-react,mock-socketmissing type declarations)Tests
✅ 140/140 tests pass (6 pre-existing component test suite failures from missing
@testing-library/domtransitive dependency)