memos/server/router/api/v1
Steven 81da20c905 refactor: simplify theme/locale to user preferences and improve initialization
Remove theme and locale from instance settings to eliminate duplication and
simplify the codebase. These are user-specific preferences and should only
exist in user settings, not instance-wide settings.

Backend changes:
- Remove theme from InstanceGeneralSetting proto
- Remove locale from InstanceCustomProfile proto
- Update instance service converters to remove theme/locale handling
- Simplify RSS feed to use static locale

Frontend changes:
- Remove theme/locale from instanceStore state
- Create unified initialization flow with clear fallback priority:
  * Theme: user setting → localStorage → system preference
  * Locale: user setting → browser language
- Add applyUserPreferences() to centralize theme/locale application
- Simplify App.tsx by removing redundant state synchronization
- Update all components to use new helper functions:
  * getThemeWithFallback() for theme resolution
  * getLocaleWithFallback() for locale resolution
- Remove theme/locale selectors from instance profile dialog

Theme utilities refactor:
- Organize code into clear sections with JSDoc comments
- Extract localStorage operations into getStoredTheme/setStoredTheme helpers
- Split DOM manipulation into focused functions
- Improve type safety with Theme and ResolvedTheme types
- Reduce code duplication and improve maintainability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 09:08:46 +08:00
..
test refactor(api): remove test_auth.go and inline test helpers (#5235) 2025-11-08 09:53:29 +08:00
acl.go fix: update user session retrieval to use user.ID instead of userID (#5294) 2025-11-30 11:45:16 +08:00
acl_config.go chore: fix linter 2025-11-05 23:59:24 +08:00
activity_service.go chore: fix linter 2025-10-31 08:36:12 +08:00
attachment_service.go fix(server): prevent memory exhaustion in thumbnail generation 2025-11-07 09:04:21 +08:00
auth.go chore: fix reactions seed data 2025-10-27 20:27:27 +08:00
auth_service.go feat(auth): add PKCE support and enhance OAuth security 2025-12-01 00:04:26 +08:00
auth_service_client_info_test.go chore: fix linter 2025-08-31 20:22:32 +08:00
common.go refactor: remove unused constants 2025-10-16 20:40:46 +08:00
health_service.go refactor(store): remove deprecated migration_history table and backward compatibility code 2025-12-01 22:54:30 +08:00
idp_service.go fix(security): add missing authorization checks to various services (#5217) 2025-11-06 19:42:44 +08:00
instance_service.go refactor: simplify theme/locale to user preferences and improve initialization 2025-12-02 09:08:46 +08:00
logger_interceptor.go chore: add a new LOG_STACKTRACES option (#4973) 2025-08-07 23:56:21 +08:00
memo_attachment_service.go fix(security): implement security review recommendations (#5228) 2025-11-06 23:32:27 +08:00
memo_relation_service.go fix(security): implement security review recommendations (#5228) 2025-11-06 23:32:27 +08:00
memo_service.go fix(api): implement custom memo ID support in CreateMemo (#5234) 2025-11-08 09:43:10 +08:00
memo_service_converter.go refactor: rename workspace to instance throughout codebase 2025-11-05 23:35:35 +08:00
memo_service_filter.go refactor: deprecate old filter 2025-07-22 21:25:57 +08:00
reaction_service.go fix(security): implement security review recommendations (#5228) 2025-11-06 23:32:27 +08:00
resource_name.go refactor: rename workspace to instance throughout codebase 2025-11-05 23:35:35 +08:00
shortcut_service.go refactor: remove unused constants 2025-10-16 20:40:46 +08:00
user_service.go fix(store): filter inbox notifications by message type at database level 2025-12-01 08:43:05 +08:00
user_service_stats.go fix: implement tag suggestions functionality 2025-11-08 09:15:38 +08:00
v1.go fix(server): prevent memory exhaustion in thumbnail generation 2025-11-07 09:04:21 +08:00