// @vitest-environment node import { describe, expect, it } from 'vitest'; import { buildSrcdoc } from '../../src/runtime/srcdoc'; // Regression coverage for the "deck-stage shows a sliver of content in the // top-left with the rest of the preview black" symptom. Root cause: the // srcdoc deck bridge injected `place-content: center !important` on // `.stage, .deck-stage, .deck-shell` for ALL deck-mode artifacts, even // framework decks (DECK_SKELETON_HTML in apps/daemon/src/prompts/ // deck-framework.ts) whose `fit()` already centers a `transform-origin: // top left` stage with an explicit `translate(tx, ty)` that assumes the // stage's natural layout position is (0, 0). Forcing place-content on // the shell re-centered the implicit grid track, doubled the offset, and // pushed the scaled stage off-screen. // // The fix: detect the framework deck via its `id="deck-stage"` marker and // skip the `data-od-deck-fix` styleFix for it. Legacy / non-framework // decks that authored their own `.stage` grid still get the override. function frameworkDeckHtml(): string { return [ '
', '