Honor the initial dark theme in tutorial guides
This commit is contained in:
parent
42f0fbf822
commit
c80f1248dc
4 changed files with 9 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Acquire private beta — 22 October 2026
|
||||
|
||||
Private BGS registration: `acquire`, version `1`. Engine `0.0.1`, viewer `0.0.2`.
|
||||
Private BGS registration: `acquire`, version `1`. Engine `0.0.1`, viewer `0.0.3`.
|
||||
Source: <https://github.com/boardgamers/mergers-game>. Keep `public: false`.
|
||||
|
||||
## Validation
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "acquire-viewer",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.3",
|
||||
"private": true,
|
||||
"description": "Browser viewer for Acquire on boardgamers.space",
|
||||
"license": "AGPL-3.0-only",
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export const mountTutorial: TutorialMount = async (target, options) => {
|
|||
store.player = 0;
|
||||
store.locale = locale;
|
||||
store.analysis = true;
|
||||
store.theme = initialTheme();
|
||||
store.theme = initialTheme() ?? (matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
||||
wrapper.dataset.theme = store.theme;
|
||||
store.setState(stripSecret(controller.snapshot.state, 0));
|
||||
let snapshot = $state(controller.snapshot);
|
||||
|
|
|
|||
|
|
@ -244,6 +244,12 @@ try {
|
|||
"three tutorials completed through real controls on desktop and phone; reload, retry, rejected move, French/Persian resume and final scoring"
|
||||
);
|
||||
|
||||
await page.emulateMedia({ colorScheme: "dark" });
|
||||
await page.reload();
|
||||
await page.waitForSelector('.acquire-tutorial[data-theme="dark"]');
|
||||
await page.emulateMedia({ colorScheme: "light" });
|
||||
await page.waitForSelector('.acquire-tutorial[data-theme="light"]');
|
||||
|
||||
await page.evaluate(() => window.acquire.destroy());
|
||||
await settle();
|
||||
assert.equal(await page.locator("main").count(), 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue