Improve compact desktop usability and action guidance
All checks were successful
Deploy Sokko G / deploy (push) Successful in 19s

This commit is contained in:
Shinuwa 2026-10-05 21:47:16 +02:00
parent 0ac1a0974e
commit 0fc18cd8b9
24 changed files with 325 additions and 90 deletions

View file

@ -1,5 +1,6 @@
// Rôle : centralise les règles de validation des JSON éditables du projet.
import assert from "node:assert/strict";
import { TOOLBOX_MODULE_DEFINITIONS } from "../../website/src/features/toolboxes/toolboxModuleRegistry.js";
const SNAKE_CASE_RE = /^[a-z0-9]+(?:_[a-z0-9]+)*$/;
const PHYSICAL_HITZONE_KEYS = ["cut", "blunt", "ammo"];
@ -101,6 +102,7 @@ export function validateSiteContent(site) {
"guideChecklist.completed",
"guideChecklist.checkCard",
"guideChecklist.uncheckCard",
"guideChecklist.resultsActionLabel",
"guideChecklist.resultsModalTitle",
"guideChecklist.resultsModalDescription",
"guideChecklist.resultsChecklistLabel",
@ -184,6 +186,7 @@ export function validateSiteContent(site) {
"home.hero.title",
"home.hero.description",
"home.hero.primaryAction",
"home.hero.createAction",
"home.hero.secondaryAction",
"home.stats.toolboxSingular",
"home.stats.toolboxPlural",
@ -985,6 +988,12 @@ export function validateSiteContent(site) {
"toolboxes.emptyText"
].forEach((path) => assertNonEmptyString(site, path));
const descriptions = valueAt(site, "toolboxes.addToolDescriptions");
const moduleTypes = Object.keys(TOOLBOX_MODULE_DEFINITIONS).sort();
assert.ok(descriptions && typeof descriptions === "object" && !Array.isArray(descriptions), "toolboxes.addToolDescriptions must be an object");
assert.deepEqual(Object.keys(descriptions).sort(), moduleTypes, "toolboxes.addToolDescriptions keys must exactly match the toolbox module registry");
moduleTypes.forEach((type) => assertNonEmptyString(site, `toolboxes.addToolDescriptions.${type}`));
assertStringArray(site, "toolboxes.storageHelp.items", 3);
assertStringArray(site, "toolboxes.autoBackup.browsers", 2);
assertStringArray(site, "toolboxes.autoBackup.permissionSteps", 3);