fix(theme): persist switcher accent for SSR
Quality / quality (ubuntu-latest) (push) Failing after 9m48s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-12 21:17:20 +05:30
parent effed1c3cf
commit dd9b7a289a
8 changed files with 11 additions and 25 deletions
@@ -30,6 +30,8 @@ size: string = "default"
functions {
client function choose(type, value) {
if (type === "color") window.wrnAccent?.set(value)
if (type === "theme") window.wrnTheme?.set(value)
output[type]({ value: value })
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@wrnexus/ui",
"version": "0.8.14",
"version": "0.8.15",
"private": true,
"type": "module",
"main": "src/index.ts",
+4 -4
View File
@@ -374,10 +374,10 @@ test("navbar hover menu stays open while the pointer crosses into its panel", as
});
test("preference switcher keeps only one popover open and closes outside", async () => {
const html = await renderComponent(
readFileSync(uiComponentPath("PreferenceSwitcher"), "utf8"),
{},
);
const source = readFileSync(uiComponentPath("PreferenceSwitcher"), "utf8");
const html = await renderComponent(source, {});
expect(source).toContain("window.wrnAccent?.set(value)");
expect(source).toContain("window.wrnTheme?.set(value)");
const dom = mountHtml(html);
const menus = Array.from(dom.querySelectorAll(".wrn-preferences__menu")) as HTMLDetailsElement[];
const DomEvent = (dom.window as { Event: typeof Event }).Event;