Skip to content

[Bug]: Theme wallpaper disappears from the live preview when connectivity returns #38131

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Select a published theme with a wallpaper and custom CSS that displays it.
  2. Open Settings, then Appearance.
  3. Click Duplicate on that theme to open its live preview.
  4. Disconnect and reconnect the browser while leaving the theme editor open.

Expected behavior

The wallpaper remains visible while previewing the theme after connectivity returns.

Actual behavior

The wallpaper disappears from the preview. Closing the theme editor restores it.

wallpaper preview before online

wallpaper preview after online

failure

Impact

Major degradation or frequent failure. People previewing a published wallpaper theme lose its background whenever the browser comes back online while the editor is open.

Version or commit

main at 25fada9351. The cause is at apps/web/src/themeBackground.ts:113.

Environment

Linux x64 boat.dev default machine, a fresh checkout.

Logs or stack traces

blob:
Automated repro

Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.

diff --git a/scripts/scenarios/wallpaper-preview-online.e2e.ts b/scripts/scenarios/wallpaper-preview-online.e2e.ts
new file mode 100644
--- /dev/null
+++ b/scripts/scenarios/wallpaper-preview-online.e2e.ts
@@ -0,0 +1,64 @@
+// @effect-diagnostics nodeBuiltinImport:off - the scenario seeds a published wallpaper in its isolated home.
+import * as NodeFSP from "node:fs/promises";
+import * as NodePath from "node:path";
+
+import { expect } from "e2e";
+
+import { T3_HOME } from "../e2e.config.ts";
+import { makeState, runPromise, test, WEB } from "./t3.ts";
+
+const WALLPAPER = Buffer.from(
+  "iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAFElEQVR4nGNgWLCFwTuPAYQXbAEAGoAEG4ysH8kAAAAASUVORK5CYII=",
+  "base64",
+);
+
+const THEME = JSON.stringify({
+  version: 1,
+  name: "Wallpaper Preview",
+  appearance: "light",
+  canvas: "#f4f1ff",
+  accent: "#6d5ae6",
+  css: "[data-settings-page-scroll] { background-image: var(--theme-background-image); background-size: cover; }",
+});
+
+test(
+  "A wallpaper stays visible in the theme preview when the browser comes back online",
+  WEB,
+  async ({ t3, app, screen, browser }) => {
+    const project = await t3.project("demo", {
+      "wallpaper-preview.json": THEME,
+      "wallpaper-preview.png": WALLPAPER,
+    });
+    const themesDir = NodePath.join(T3_HOME, "userdata", "themes");
+    const imagePath = NodePath.join(themesDir, "wallpaper-preview.png");
+    const themePath = NodePath.join(themesDir, "wallpaper-preview.json");
+    const { cli } = makeState(T3_HOME);
+    await NodeFSP.mkdir(themesDir, { recursive: true });
+    await NodeFSP.copyFile(NodePath.join(project, "wallpaper-preview.png"), imagePath);
+    try {
+      await runPromise(cli(["theme", "set", NodePath.join(project, "wallpaper-preview.json")]));
+      await t3.open("/settings/appearance");
+      await screen.getByRole("button", "Use light mode", { exact: true }).tap();
+      await screen.getByRole("button", "Use Wallpaper Preview theme", { exact: true }).tap();
+
+      const background = () =>
+        browser.evaluate(() => {
+          const surface = document.querySelector("[data-settings-page-scroll]");
+          return surface ? getComputedStyle(surface).backgroundImage : "missing settings surface";
+        });
+      await expect.poll(background).toContain("blob:");
+      await screen.getByRole("button", "Duplicate Wallpaper Preview", { exact: true }).tap();
+      await expect(screen.getByRole("dialog", "Create theme")).toBeVisible();
+      await expect.poll(background).toContain("blob:");
+      await app.screenshot("wallpaper-preview-before-online");
+
+      // Reproduce the browser event delivered when connectivity returns, without navigating away.
+      await browser.evaluate(() => window.dispatchEvent(new Event("online")));
+      await app.screenshot("wallpaper-preview-after-online");
+      await expect.poll(background).toContain("blob:");
+    } finally {
+      await NodeFSP.rm(themePath, { force: true });
+      await NodeFSP.rm(imagePath, { force: true });
+    }
+  },
+);
pnpm scenarios:prove scripts/scenarios/wallpaper-preview-online.e2e.ts --base main

Workaround

No response

Activity

  1. added
    vouch:trusted
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions