feat: complete user config management

- Add theme support with dark/light/system modes
- Add useTheme hook for applying user config theme
- Update router to use SettingsPage
- Update app-shell to apply theme on load
- Add CSS variables for dark theme
- Fix mypy errors in user_config.py
- Quality gates pass: ruff, mypy, typecheck, lint, build
This commit is contained in:
Fusion
2026-05-18 15:58:01 +02:00
parent 9f7a750898
commit 94254ee3fd
18 changed files with 463 additions and 171 deletions
@@ -0,0 +1,42 @@
## ADDED Requirements
### Requirement: User Config Storage
The system SHALL store user configuration as JSONB key-value pairs linked to the user.
#### Scenario: Create config on first write
- GIVEN an authenticated user with no config
- WHEN they update settings
- THEN a UserConfig row is created with their user_id
### Requirement: Config Keys
The system SHALL support these configuration keys:
- `default_editor`: string
- `theme`: "light" | "dark" | "system"
- `git_user_name`: string
- `git_user_email`: string
#### Scenario: Update theme
- GIVEN an authenticated user
- WHEN they PATCH /users/me/config with {"theme": "dark"}
- THEN only the theme key is updated
- AND other keys remain unchanged
### Requirement: Config Retrieval
The system SHALL return user configuration on request.
#### Scenario: Get config
- GIVEN an authenticated user with config
- WHEN they GET /users/me/config
- THEN their full configuration is returned
### Requirement: Frontend Theme Application
The system SHALL apply the user's theme preference on application load.
#### Scenario: Load with dark theme
- GIVEN a user with theme="dark"
- WHEN the app loads
- THEN the dark CSS class is applied to the document