Split randomizer views and align NDS toolbox vocabulary
All checks were successful
Deploy Sokko G / deploy (push) Successful in 17s

This commit is contained in:
Shinuwa 2026-09-01 19:47:22 +02:00
parent 6b85e58765
commit fef7735a1d
57 changed files with 4932 additions and 4815 deletions

View file

@ -19,6 +19,10 @@ test("site content json is complete", async () => {
test("library examples are available", async () => {
const library = JSON.parse(await readFile("website/public/data/library.json", "utf8"));
validateLibraryData(library);
const memosModule = library.toolbox.modules.find((module) => module.type === "memos");
const notepadModule = library.toolbox.modules.find((module) => module.type === "notepad");
assert.equal(memosModule?.title, "Mémos");
assert.equal(notepadModule?.title, "Bloc Note");
});
test("mhwilds data and assets are available", async () => {

View file

@ -19,6 +19,10 @@ test("style entrypoint and theme layers are wired", async () => {
const styleMixins = await readFile("website/src/styles/_mixins.scss", "utf8");
const styleShell = await readFile("website/src/styles/_shell.scss", "utf8");
const styleCards = await readFile("website/src/styles/_cards.scss", "utf8");
const styleSurfaces = await readFile("website/src/styles/design-system/_surfaces.scss", "utf8");
const styleControlsButtons = await readFile("website/src/styles/design-system/controls/_buttons.scss", "utf8");
const styleAttributesButtons = await readFile("website/src/styles/design-system/attributes/_buttons.scss", "utf8");
const goalTreeBranch = await readFile("website/src/features/toolboxes/modules/GoalTreeBranch.jsx", "utf8");
const styleHome = await readJoinedStyles([
"website/src/styles/_home.scss",
"website/src/styles/home/_shared.scss",
@ -216,10 +220,30 @@ test("style entrypoint and theme layers are wired", async () => {
assert.match(styleGames, /\.game-layout/);
assert.match(styleGames, /\.game-grid/);
assert.match(styleGames, /\.filter-panel/);
assert.match(styleSurfaces, /@mixin card-surface/);
assert.match(styleSurfaces, /@mixin card-surface-hover/);
assert.match(styleSurfaces, /@mixin card-cover-divider/);
assert.match(styleCards, /@use "design-system\/surfaces"/);
assert.match(styleCards, /surfaces\.card-surface/);
assert.match(styleGames, /@use "\.\.\/design-system\/surfaces"/);
assert.match(styleGames, /surfaces\.card-surface/);
assert.match(styleGames, /surfaces\.card-cover-divider/);
assert.match(styleMhwilds, /\.mhwilds-card/);
assert.match(styleMhwilds, /\.mhwilds-flip-indicator/);
assert.match(styleMhwilds, /@use "design-system\/surfaces"/);
assert.match(styleMhwilds, /surfaces\.card-surface/);
assert.match(styleMhwilds, /surfaces\.card-cover-divider/);
assert.doesNotMatch(styleMhwilds, /\.game-(home-card|layout|grid)/);
assert.match(styleCards, /compact-data-card/);
assert.doesNotMatch(
[
goalTreeBranch,
styleToolboxGoalTree,
styleControlsButtons,
styleAttributesButtons
].join("\n"),
/(?:data-size="tiny"|icon-button(?:-icon)?\(tiny\)|\$size == tiny)/
);
assert.match(styleOverlays, /overscroll-behavior: contain/);
assert.match(styleResponsive, /@media \(max-width: 760px\)/);
});

View file

@ -243,13 +243,21 @@ test("toolbox module registry and modules expose expected behavior", async () =>
const textImportPlanning = await readFile("website/src/features/toolboxes/modules/textImport/planning.js", "utf8");
const textImportTime = await readFile("website/src/features/toolboxes/modules/textImport/time.js", "utf8");
const imageViewer = await readFile("website/src/components/ImageViewer.jsx", "utf8");
const randomizerModule = await readFile("website/src/features/toolboxes/modules/RandomizerModule.jsx", "utf8");
const randomizerDice = await readFile("website/src/features/toolboxes/modules/randomizer/RandomizerDice.jsx", "utf8");
const randomizerWheel = await readFile("website/src/features/toolboxes/modules/randomizer/RandomizerWheel.jsx", "utf8");
const randomizerTeams = await readFile("website/src/features/toolboxes/modules/randomizer/RandomizerTeams.jsx", "utf8");
const randomizerShared = await readFile("website/src/features/toolboxes/modules/randomizer/RandomizerShared.jsx", "utf8");
const randomizerUiUtils = await readFile("website/src/features/toolboxes/modules/randomizer/randomizerUiUtils.js", "utf8");
const randomizerBundle = `${randomizerModule}\n${randomizerDice}\n${randomizerWheel}\n${randomizerTeams}\n${randomizerShared}\n${randomizerUiUtils}`;
[
["CalendarModule.jsx", calendarModule],
["modules/index.jsx", moduleRegistry],
["GoalTreeParts.jsx", goalTreeParts],
["TimerParts.jsx", timerParts],
["TaskPlannerItems.jsx", taskPlannerItems]
["TaskPlannerItems.jsx", taskPlannerItems],
["RandomizerModule.jsx", randomizerModule]
].forEach(([fileName, fileSource]) => {
assert.ok(countLines(fileSource) <= 220, `${fileName} must remain a short orchestrator/barrel`);
});
@ -358,6 +366,19 @@ test("toolbox module registry and modules expose expected behavior", async () =>
assert.match(calculatorModule, /parentId/);
assert.match(calculatorModule, /MixTagsInput/);
assert.match(calculatorModule, /useGroupedReorder/);
assert.match(moduleMetadataRegistry, /label: "Mémos"/);
assert.match(moduleMetadataRegistry, /defaultTitle: "Mémos"/);
assert.match(moduleMetadataRegistry, /label: "Bloc Note"/);
assert.match(moduleMetadataRegistry, /defaultTitle: "Bloc Note"/);
assert.match(randomizerModule, /RandomizerDice\.jsx/);
assert.match(randomizerModule, /RandomizerWheel\.jsx/);
assert.match(randomizerModule, /RandomizerTeams\.jsx/);
assert.match(randomizerDice, /export function DiceRandomizer/);
assert.match(randomizerWheel, /export function WheelRandomizer/);
assert.match(randomizerTeams, /export function TeamsRandomizer/);
assert.match(randomizerShared, /export function RandomizerHistory/);
assert.match(randomizerUiUtils, /export function hasReducedMotion/);
assert.match(randomizerBundle, /type="randomizer"/);
assert.match(calculatorEntries, /calculator-drag-handle/);
assert.match(calculatorModule, /scrollResults/);
assert.match(calculatorModule, /tool-split-scroll-toggle/);