The B2 rollout is complete, so the ARCHETYPE_COHERENCE_AUDIT §13 "Superficie / elevación" axis flips A1 → LIVE. Per the audit's update rule (row → LIVE + guard), add `elevation-plane.test.ts`: every floating overlay's eidos Content wrapper must stamp `data-depth` so the plane paints its elevation. 13 wrappers pass (dropdown/context-menu + their sub-contents, menubar, navigation-menu, popover, link-preview, command, select, combobox, dialog, drawer). tooltip + listbox are excluded by design (variant-as-material / inline list). Catches the menubar-class regression — a panel that reuses a shared content selector but forgets data-depth silently loses its elevation when the donor recipe is pruned. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>active-uix
parent
d578f83281
commit
5f14793b62
@ -0,0 +1,57 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname, join } from 'node:path';
|
||||
|
||||
const COMPONENTS = join(dirname(fileURLToPath(import.meta.url)), 'components');
|
||||
|
||||
/**
|
||||
* Anti-drift guard for the elevation plane.
|
||||
*
|
||||
* ARCHETYPE_COHERENCE_AUDIT §13, axis "Superficie / elevación" → LIVE (B2 rollout,
|
||||
* 2026-06-22). Every FLOATING OVERLAY takes its elevation (surface · border ·
|
||||
* shadow · halo) from the `data-depth` plane — it does NOT paint its own
|
||||
* surface/shadow. So each overlay's eidos `Content` wrapper MUST stamp
|
||||
* `data-depth` for the plane to apply.
|
||||
*
|
||||
* This catches the menubar-class regression: a panel that reuses another part's
|
||||
* content selector (`[data-dropdown-menu-content]`) but forgets `data-depth`
|
||||
* silently loses its elevation the moment the donor recipe is pruned.
|
||||
*
|
||||
* EXCLUDED by design (NOT plane targets — see §13 / the 2026-06-22 hand-off):
|
||||
* tooltip — the variant IS the material (solid / outline / ghost), not emphasis;
|
||||
* the plane would flatten it.
|
||||
* listbox — an inline list (`surface-default`, no shadow), not a floating overlay.
|
||||
*/
|
||||
const OVERLAY_CONTENT_WRAPPERS: Record<string, readonly string[]> = {
|
||||
'dropdown-menu': ['dropdown-menu-content.svelte', 'dropdown-menu-sub-content.svelte'],
|
||||
'context-menu': ['context-menu-content.svelte', 'context-menu-sub-content.svelte'],
|
||||
menubar: ['menubar-content.svelte'],
|
||||
'navigation-menu': ['navigation-menu-content.svelte'],
|
||||
popover: ['popover-content.svelte'],
|
||||
'link-preview': ['link-preview-content.svelte'],
|
||||
command: ['command.svelte'],
|
||||
select: ['select-content.svelte'],
|
||||
combobox: ['combobox-content.svelte'],
|
||||
dialog: ['dialog-content.svelte'],
|
||||
drawer: ['drawer-content.svelte']
|
||||
};
|
||||
|
||||
describe('elevation plane adoption (B2 anti-drift guard)', () => {
|
||||
for (const [component, files] of Object.entries(OVERLAY_CONTENT_WRAPPERS)) {
|
||||
for (const file of files) {
|
||||
it(`${component} · ${file} stamps data-depth (consumes the elevation plane)`, () => {
|
||||
const path = join(COMPONENTS, component, file);
|
||||
expect(
|
||||
existsSync(path),
|
||||
`${file} not found — wrapper renamed? Update OVERLAY_CONTENT_WRAPPERS.`
|
||||
).toBe(true);
|
||||
const src = readFileSync(path, 'utf8');
|
||||
expect(
|
||||
/data-depth=/.test(src),
|
||||
`${file} must stamp data-depth="overlay|modal" so the elevation plane paints the panel.`
|
||||
).toBe(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Reference in new issue