Light/dark selection in user profile, if set this is preferred on the whole system, together with app overrides (the first one on the URL wins).

This commit is contained in:
Leo Vasanko
2026-01-30 23:31:06 +00:00
parent 0096727b41
commit cc439aaf12
12 changed files with 111 additions and 76 deletions
+3 -2
View File
@@ -147,10 +147,10 @@ class Role(msgspec.Struct, dict=True, omit_defaults=True):
return role
class User(msgspec.Struct, dict=True):
class User(msgspec.Struct, dict=True, omit_defaults=True):
"""User data structure.
Mutable fields: display_name, role_uuid, last_seen, visits
Mutable fields: display_name, role_uuid, last_seen, visits, theme
Immutable fields: created_at (set at creation, never modified)
uuid is derived from created_at using uuid7.
"""
@@ -160,6 +160,7 @@ class User(msgspec.Struct, dict=True):
created_at: datetime
last_seen: datetime | None = None
visits: int = 0
theme: str = "" # "" or "auto" = OS default, "light", "dark"
def __post_init__(self):
if not hasattr(self, "uuid"):