diff --git a/apps/web/src/components/DiagramEditorPane.test.mjs b/apps/web/src/components/DiagramEditorPane.test.mjs index b035c7cf..11451df3 100644 --- a/apps/web/src/components/DiagramEditorPane.test.mjs +++ b/apps/web/src/components/DiagramEditorPane.test.mjs @@ -166,7 +166,7 @@ describe("diagram editor canvas surface", () => { }); test("uses restrained rounded edges and fits the complete diagram without clipping", () => { - expect(toolbarSource).toContain("DIAGRAM_THEME_GROUPS"); + expect(toolbarSource).toContain("DIAGRAM_SELECTABLE_THEMES"); expect(toolbarSource).toContain("DIAGRAM_STRUCTURE_GROUPS"); expect(toolbarSource).toContain("diagramThemeSwatches"); expect(toolbarSource).toContain(" { expect(toolbarSource).toContain('structure === "org"'); expect(toolbarSource).toContain('structure === "timeline"'); expect(toolbarSource).toContain('structure === "fishbone"'); - expect(toolbarSource).toContain("diagram.themeGroupVivid"); + expect(toolbarSource).not.toContain("diagram.themeGroupVivid"); expect(toolbarSource).toContain('{t("diagram.theme")}'); expect(toolbarSource).not.toContain('value="ocean"'); expect(toolbarSource).not.toContain('value="ink"'); @@ -191,7 +191,7 @@ describe("diagram editor canvas surface", () => { expect(source).toContain('themeCatalog={document.kind === "flowchart" ? "flowchart" : "mind-map"}'); expect(toolbarSource).toContain("showTheme = true"); expect(toolbarSource).toContain("themeCatalog = \"mind-map\""); - expect(toolbarSource).toContain("FLOWCHART_THEME_GROUPS"); + expect(toolbarSource).toContain("FLOWCHART_SELECTABLE_THEMES"); expect(toolbarSource).toContain("flowchartThemeSwatches"); expect(source).toContain("maxScale: policy.maxScale"); expect(source).not.toContain("minScale: policy.minScale"); diff --git a/apps/web/src/components/DiagramToolbar.tsx b/apps/web/src/components/DiagramToolbar.tsx index 1aa58734..d6739309 100644 --- a/apps/web/src/components/DiagramToolbar.tsx +++ b/apps/web/src/components/DiagramToolbar.tsx @@ -17,8 +17,8 @@ import { useTranslation } from "react-i18next"; import { DIAGRAM_SELECTABLE_STRUCTURES, DIAGRAM_STRUCTURE_GROUPS, - DIAGRAM_THEME_GROUPS, - FLOWCHART_THEME_GROUPS, + DIAGRAM_SELECTABLE_THEMES, + FLOWCHART_SELECTABLE_THEMES, diagramThemeSwatches, flowchartThemeSwatches, resolveDiagramTheme, @@ -356,33 +356,28 @@ export const DiagramToolbar = ({ {t("diagram.theme")} - - {(["vivid", "classic"] as const).map((group) => ( -
-
{t(group === "vivid" ? "diagram.themeGroupVivid" : "diagram.themeGroupClassic")}
-
- {(themeCatalog === "flowchart" ? FLOWCHART_THEME_GROUPS[group] : DIAGRAM_THEME_GROUPS[group]).map((value) => ( - onThemeChange(value)} - > - - {(themeCatalog === "flowchart" ? flowchartThemeSwatches(value) : diagramThemeSwatches(value)).map((color) => ( - - ))} - - {t(`diagram.theme${value.charAt(0).toUpperCase()}${value.slice(1)}` as "diagram.themeBrand")} - - ))} -
-
- ))} + +
+ {(themeCatalog === "flowchart" ? FLOWCHART_SELECTABLE_THEMES : DIAGRAM_SELECTABLE_THEMES).map((value) => ( + onThemeChange(value)} + > + + {(themeCatalog === "flowchart" ? flowchartThemeSwatches(value) : diagramThemeSwatches(value)).map((color) => ( + + ))} + + {t(`diagram.theme${value.charAt(0).toUpperCase()}${value.slice(1)}` as "diagram.themeBrand")} + + ))} +
) : null}