From f989f1385523c73c9893ddb3b347f85dedbe0428 Mon Sep 17 00:00:00 2001 From: Willie Date: Sat, 14 Nov 2026 23:54:42 +0800 Subject: [PATCH] fix(ui): let an embedding app start the dashboard with both theme axes (#910) The desktop app shows the dashboard in an iframe and passes its theme as ?theme=, which holds one value: it cannot ask for Dark + Clean or Playful dark. Where the iframe's localStorage is not kept (WebKitGTK on Linux), the dashboard then started with another theme, flashed it, and reported it to the app as if the user had picked it (runkids/skillshare-app#128). ?mode= and ?style= now name one axis each and win over ?theme=, in both the pre-paint script and ThemeContext, through one parser. The dashboard also posts theme-init to its parent when a page starts, before the first theme-change reports, so the app can tell a starting theme from a user's choice even when the dashboard reloads itself. --- ui/index.html | 13 ++++++++----- ui/src/context/ThemeContext.test.ts | 11 +++++++++++ ui/src/context/ThemeContext.tsx | 27 +++++++++++---------------- ui/src/lib/themeParams.test.ts | 25 +++++++++++++++++++++++++ ui/src/lib/themeParams.ts | 24 ++++++++++++++++++++++++ 5 files changed, 79 insertions(+), 21 deletions(-) create mode 100644 ui/src/context/ThemeContext.test.ts create mode 100644 ui/src/lib/themeParams.test.ts create mode 100644 ui/src/lib/themeParams.ts diff --git a/ui/index.html b/ui/index.html index e3b98d2e3..54cb28666 100644 --- a/ui/index.html +++ b/ui/index.html @@ -18,14 +18,17 @@