feat(privacy): add personalized ads toggle in settings

- Add PrivacySettings schema with can_sell field (default: false)
- Move privacy toggle to GeneralSettingsScreen with clear labeling
- Update l10n for zh/en/zh_hant with user-friendly copy
- Clean up redundant PrivacyNotificationSettingsScreen
- Update profile-protocol.md to reflect new privacy schema
- Fix basedpyright warnings in user.py
This commit is contained in:
qzl
2026-04-17 13:11:09 +08:00
parent be30eb6eab
commit 913ed26f8d
17 changed files with 417 additions and 163 deletions
@@ -0,0 +1,7 @@
{"order": 1, "step": "Backend: Add PrivacySettings class", "file": "backend/src/schemas/shared/user.py", "action": "Create PrivacySettings class with do_not_sell (default=True) + future extension fields", "status": "completed"}
{"order": 2, "step": "Backend: Update ProfileSettingsV1.privacy type", "file": "backend/src/schemas/shared/user.py", "action": "Change privacy from dict[str, object] to PrivacySettings, add backward compatibility logic", "status": "completed"}
{"order": 3, "step": "Frontend: Add PrivacySettings class", "file": "apps/lib/features/settings/data/models/profile_settings.dart", "action": "Create PrivacySettings class with doNotSell + future fields, add copyWith", "status": "completed"}
{"order": 4, "step": "Frontend: Update ProfileSettingsV1.privacy type", "file": "apps/lib/features/settings/data/models/profile_settings.dart", "action": "Change privacy from Map to PrivacySettings type", "status": "completed"}
{"order": 5, "step": "Frontend: Add DoNotSell switch to PrivacyNotificationSettingsScreen", "file": "apps/lib/features/settings/presentation/screens/privacy_notification_settings_screen.dart", "action": "Add SettingsSwitchTile for Do Not Sell before Profile Visibility placeholder", "status": "completed"}
{"order": 6, "step": "Frontend: Add DoNotSell shortcut to LegalCenterScreen", "file": "apps/lib/features/settings/presentation/screens/legal_center_screen.dart", "action": "Add SettingsMenuTile showing current status, navigate to PrivacyNotificationSettingsScreen", "status": "completed"}
{"order": 7, "step": "Frontend: Add l10n keys", "file": "apps/lib/l10n/", "action": "Add Do Not Sell related translations (zh/en/zh_Hant): title, description, enabled, disabled", "status": "completed"}