diff --git a/e2e/USER_STORIES.md b/e2e/USER_STORIES.md index e2af3738..1075ec44 100644 --- a/e2e/USER_STORIES.md +++ b/e2e/USER_STORIES.md @@ -1410,8 +1410,8 @@ Acceptance: - Selecting "Dark" applies the dark theme to the document immediately, and "System" follows the OS color-scheme preference. - Choosing a different app theme applies it and persists after a reload. -- Dragging the font-size slider updates the displayed percentage and saves - without a separate save button. +- Dragging the font-size slider updates the displayed percentage, and saving the + page applies it and persists it across a reload. ### US-091 — Set up how people zap you diff --git a/e2e/specs/settings.spec.ts b/e2e/specs/settings.spec.ts index fe5f06db..c80a2418 100644 --- a/e2e/specs/settings.spec.ts +++ b/e2e/specs/settings.spec.ts @@ -155,8 +155,7 @@ test("US-088 adjust send delay and media servers", async ({seed, as}) => { const page = await as(users.alice, "/settings/content") - // The send delay is the only slider on this page. - await page.locator('input[type="range"]').fill("3000") + await page.getByLabel("Send delay").fill("3000") await page.getByRole("button", {name: "Add Server"}).click() await page.getByRole("listitem").first().locator("input").fill("https://media.test/") @@ -168,7 +167,7 @@ test("US-088 adjust send delay and media servers", async ({seed, as}) => { await waitForToastToClear(page) await page.reload() - await expect(page.locator('input[type="range"]')).toHaveValue("3000") + await expect(page.getByLabel("Send delay")).toHaveValue("3000") }) test("US-089 configure privacy preferences", async ({seed, as}) => { @@ -235,7 +234,7 @@ test("US-090 change the app's appearance", async ({seed, as}) => { space.relayList(user.alice) }) - const page = await as(users.alice, "/settings/theme", {context: {colorScheme: "light"}}) + const page = await as(users.alice, "/settings/content", {context: {colorScheme: "light"}}) const body = page.locator("body") await page.getByRole("button", {name: "Dark", exact: true}).click() @@ -259,11 +258,14 @@ test("US-090 change the app's appearance", async ({seed, as}) => { await expect(body).toHaveAttribute("data-fl-theme", "navy") - // Font size is the only slider on this page, and moving it is the save. - await page.locator('input[type="range"]').fill("1.25") + // Font size is a setting, so it goes out with the rest of the page. + await page.getByLabel("Font size").fill("1.25") + await page.getByRole("button", {name: "Save Changes"}).click() + await expect(page.getByRole("alert")).toContainText("Your settings have been saved!") await expect(page.locator("html")).toHaveAttribute("style", /font-size:\s*1\.25rem/) + await waitForToastToClear(page) await page.reload() await expect(page.locator("html")).toHaveAttribute("style", /font-size:\s*1\.25rem/) diff --git a/src/app/components/MenuSettings.svelte b/src/app/components/MenuSettings.svelte index 36e75e35..bc8a60ba 100644 --- a/src/app/components/MenuSettings.svelte +++ b/src/app/components/MenuSettings.svelte @@ -67,8 +67,6 @@
- Theme - / About / diff --git a/src/routes/settings/+layout.svelte b/src/routes/settings/+layout.svelte index 0b1a38e6..9811ab5d 100644 --- a/src/routes/settings/+layout.svelte +++ b/src/routes/settings/+layout.svelte @@ -4,7 +4,6 @@ import UserCircle from "@assets/icons/user-circle.svg?dataurl" import Wallet from "@assets/icons/wallet.svg?dataurl" import ServerPath from "@assets/icons/server-path.svg?dataurl" - import Moon from "@assets/icons/moon.svg?dataurl" import Code2 from "@assets/icons/code-2.svg?dataurl" import Exit from "@assets/icons/logout-3.svg?dataurl" import GalleryMinimalistic from "@assets/icons/gallery-minimalistic.svg?dataurl" @@ -55,9 +54,6 @@ Privacy - - Theme - About diff --git a/src/routes/settings/content/+page.svelte b/src/routes/settings/content/+page.svelte index 063a2f6f..c095239f 100644 --- a/src/routes/settings/content/+page.svelte +++ b/src/routes/settings/content/+page.svelte @@ -1,8 +1,14 @@ +{#snippet colorScheme(value: string, label: string, icon: string)} + +{/snippet} +
@@ -116,6 +133,66 @@ {/snippet} + + + + Theme Settings + + + {#snippet label()} +

Color scheme

+ {/snippet} + {#snippet input()} +
+ {@render colorScheme("system", "System", Monitor)} + {@render colorScheme("light", "Light", Sun)} + {@render colorScheme("dark", "Dark", Moon)} +
+ {/snippet} + {#snippet info()} +

System follows whatever your device is set to.

+ {/snippet} +
+ + {#snippet label()} +

App theme

+ {/snippet} + {#snippet input()} + + {/snippet} + {#snippet info()} +

Changes the shape and texture of everything, not just its colors.

+ {/snippet} +
+
+ + + + Accessibility + + + {#snippet label()} +

Font size

+ {/snippet} + {#snippet secondary()} +

{Math.round($settings.font_size * 100)}%

+ {/snippet} + {#snippet input()} + + {/snippet} +
+
Editor Settings @@ -129,6 +206,7 @@ min="0" max="10000" step="1000" + aria-label="Send delay" bind:value={$settings.send_delay} /> {/snippet} {#snippet info()} diff --git a/src/routes/settings/theme/+page.svelte b/src/routes/settings/theme/+page.svelte deleted file mode 100644 index 85e889af..00000000 --- a/src/routes/settings/theme/+page.svelte +++ /dev/null @@ -1,93 +0,0 @@ - - -{#snippet colorScheme(value: string, label: string, icon: string)} - -{/snippet} - - - - - - Theme Settings - - - {#snippet label()} -

Color scheme

- {/snippet} - {#snippet input()} -
- {@render colorScheme("system", "System", Monitor)} - {@render colorScheme("light", "Light", Sun)} - {@render colorScheme("dark", "Dark", Moon)} -
- {/snippet} - {#snippet info()} -

System follows whatever your device is set to.

- {/snippet} -
- - {#snippet label()} -

App theme

- {/snippet} - {#snippet input()} - - {/snippet} - {#snippet info()} -

Changes the shape and texture of everything, not just its colors.

- {/snippet} -
-
- - - - Accessibility - - - {#snippet label()} -

Font size

- {/snippet} - {#snippet secondary()} -

{Math.round(fontSize * 100)}%

- {/snippet} - {#snippet input()} - - {/snippet} -
-
-