signature: add systems map, command palette and motion primitives

Ship the Signature UX as standalone, SSR-safe pieces: bilingual copy, a dual SVG/list systems map, a Map-backed command palette in the shell, opt-in reveal and metric primitives, and a leak-free decorative canvas.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-25 17:37:25 +02:00
parent 9ea2885c7b
commit 7813499ee3
25 changed files with 2902 additions and 73 deletions

View File

@@ -0,0 +1,60 @@
import { APP_LOCALES } from '../i18n/locale';
import { COMMAND_IDS } from '../../shared/command-palette/commands';
import { SIGNATURE_COPY } from './signature-copy';
function leafPaths(value: unknown, prefix = ''): string[] {
if (typeof value === 'string') {
return [prefix];
}
if (value !== null && typeof value === 'object') {
return Object.keys(value).flatMap((key) => {
const next = prefix.length > 0 ? `${prefix}.${key}` : key;
return leafPaths((value as Record<string, unknown>)[key], next);
});
}
return [prefix];
}
function collectStrings(value: unknown): string[] {
if (typeof value === 'string') {
return [value];
}
if (value !== null && typeof value === 'object') {
return Object.values(value).flatMap((entry) => collectStrings(entry));
}
return [];
}
describe('SIGNATURE_COPY', () => {
it('exposes the same key structure in both locales', () => {
const [first, ...rest] = APP_LOCALES.map((locale) => leafPaths(SIGNATURE_COPY[locale]));
for (const keys of rest) {
expect(keys).toEqual(first);
}
});
it('keeps every string non-empty', () => {
for (const locale of APP_LOCALES) {
for (const value of collectStrings(SIGNATURE_COPY[locale])) {
expect(value.trim().length).toBeGreaterThan(0);
}
}
});
it('describes every CommandId in both locales', () => {
for (const locale of APP_LOCALES) {
const descriptions = SIGNATURE_COPY[locale].palette.commandDescriptions;
expect(Object.keys(descriptions).sort()).toEqual([...COMMAND_IDS].sort());
for (const id of COMMAND_IDS) {
expect(descriptions[id].trim().length).toBeGreaterThan(0);
}
}
});
});