Skip to content

[Bug]: Importing same-named theme files together drops their custom CSS #38137

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. Prepare two T3 Code theme JSON files named nyx-one.json and nyx-two.json, both with the name Nyx, light appearance, a canvas color, and custom CSS that draws a pink outline around the settings page.
  2. Open Settings → Appearance.
  3. Choose Add theme.
  4. Drop both files together into the Theme file area.
  5. Select the imported Nyx One theme.

Expected behavior

The selected theme applies its custom CSS, including the pink outline.

Actual behavior

The renamed theme applies its palette but the pink outline and all other custom CSS are missing.

renamed batch theme selected

failure

Impact

Major degradation or frequent failure. People importing multiple same-named theme files lose their CSS whenever the importer renames the files to distinguish them.

Version or commit

main at 25fada9351. The cause is at apps/web/src/vscodeThemeImport.ts:444.

Environment

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

Logs or stack traces

8px
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/theme-batch-renamed-css.e2e.ts b/scripts/scenarios/theme-batch-renamed-css.e2e.ts
new file mode 100644
--- /dev/null
+++ b/scripts/scenarios/theme-batch-renamed-css.e2e.ts
@@ -0,0 +1,51 @@
+import { expect } from "e2e";
+
+import { test, WEB } from "./t3.ts";
+
+test(
+  "Renaming same-named themes during a batch import preserves their CSS",
+  WEB,
+  async ({ t3, app, screen, browser }) => {
+    await t3.project("demo");
+    await t3.open("/settings/appearance");
+    await screen.getByRole("button", "Add theme", { exact: true }).tap();
+
+    await browser.evaluate(() => {
+      const files = new DataTransfer();
+      for (const name of ["nyx-one.json", "nyx-two.json"]) {
+        files.items.add(
+          new File(
+            [
+              JSON.stringify({
+                version: 1,
+                name: "Nyx",
+                appearance: "light",
+                colors: { canvas: "#f4f1ff", accent: "#6d5ae6" },
+                css: "[data-settings-page-scroll] { outline: 8px solid #ff2d95; outline-offset: -8px; }",
+              }),
+            ],
+            name,
+            { type: "application/json" },
+          ),
+        );
+      }
+      const target = document.querySelector('input[type="file"]')?.parentElement;
+      if (!target) throw new Error("No theme file drop target");
+      target.dispatchEvent(
+        new DragEvent("drop", { dataTransfer: files, bubbles: true, cancelable: true }),
+      );
+    });
+
+    await screen.getByRole("button", "Use Nyx One theme").tap();
+    await app.screenshot("renamed-batch-theme-selected");
+    await expect
+      .poll(() =>
+        browser.evaluate(() => {
+          const page = document.querySelector("[data-settings-page-scroll]");
+          if (!page) throw new Error("No Appearance settings page");
+          return getComputedStyle(page).outlineWidth;
+        }),
+      )
+      .toBe("8px");
+  },
+);
pnpm scenarios:prove scripts/scenarios/theme-batch-renamed-css.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