Skip to content

Add dark mode to the web client#108

Open
jschoedl wants to merge 4 commits into
mainfrom
dark-mode
Open

Add dark mode to the web client#108
jschoedl wants to merge 4 commits into
mainfrom
dark-mode

Conversation

@jschoedl

@jschoedl jschoedl commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Class-based dark theme (Light / Auto / Dark) for the web client, stored in the profile. AUTO follows the OS preference (falling back to light). Toggle via a Light/Auto/Dark slider at the bottom of the desktop sidebar, or a cycling icon in the mobile header.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Infrastructure / CI
  • Documentation

API changes

  • This PR does not affect the API
  • This PR changes the API → api/openapi.yaml updated and api/scripts/gen-all.sh re-run

Definition of Done

  • CI passes
  • Pre-commit hooks pass locally
  • Relevant tests added or updated

🤖 Generated with Claude Code

Class-based dark theme (Light / Auto / Dark) stored in localStorage,
with AUTO following the OS preference. Toggle via a sidebar slider on
desktop and a cycling icon in the mobile header.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

🚀 Frontend preview ↗  ·  commit caaf8ddd5cf20b4e39a681074bd5c28d63ac01d4

Cover the theme.ts store (mode resolution, persistence, dark-class
application, OS-preference following, useThemeMode) and the ThemeSlider /
ThemeIconToggle components.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jschoedl jschoedl linked an issue Jun 18, 2026 that may be closed by this pull request
@jschoedl jschoedl requested review from imol-ai and paulwiese June 18, 2026 15:30

@paulwiese paulwiese left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Also checked it looks good in Safari on iOS.

jschoedl and others added 2 commits June 20, 2026 14:18
# Conflicts:
#	web-client/src/pages/ProfilePage.tsx
Theme preference (LIGHT/DARK/AUTO) is now persisted server-side in UserPreferences
and synced across devices. Toggling theme on any device saves to the profile;
loading the app applies the saved theme from the last device that changed it.

Backend: Profile PUT merges incoming preferences so a theme-only update (or
language/diet/allergy edits that omit theme) preserves other fields.

Frontend: theme.ts inlines persist logic; applyTheme applies a loaded mode
without echoing to server; setThemeMode calls applyTheme then persistTheme.
useUserPreferences replaces useUserLanguage and loads both language and theme.

Tests: 3 backend merge tests, 6 frontend persist/apply/load tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jschoedl

Copy link
Copy Markdown
Collaborator Author

As discussed, I now stored the theme selection on the server instead of localStorage only.

@jschoedl jschoedl requested a review from paulwiese June 20, 2026 13:05
@jschoedl jschoedl deployed to kubernetes June 20, 2026 13:07 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client: add dark mode

2 participants