mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-04 05:41:34 +00:00
refactor(iso): remove the empty overlay renderers and dead fixture fields (#732)
After #714 and #724 the 2.5D overlays still carried stubs: - renderIsoOverlayGrounds and renderIsoRaisedOverlays returned an empty SVG on every frame. They go with IsoFramePresentation.grounds/raised and the two bindings in the card. The iso-overlays-svg element itself stays, now empty: it is the inert camera-viewBox layer the contract and live-touch smokes measure screen-facing HTML against, so the 2.5D DOM keeps its elements. - IsoOverlayRenderEntry.groundRadius was computed for every device, room label and lock and read only by the snapshot comparison that compared it. The overlay test fixtures passed view, referenceView, stageSize and layers (and one test selectedDeviceId), which IsoOverlaySceneInput does not have, and asserted that changing them keeps the placement - a claim the signature makes by itself. Those fields are gone from every fixture. The zoom/resize asserts of "Stage 4 reuses pure overlay placements" and "#713 AC3" (renamed to what it still checks) and the "#570 supersedes #473 W1" selection test go; the #724 AC2 test now zooms the way production does, through the live frame of resolveIsoScene, and checks that the structural geometry and so the overlay scene are reused. The #713 K8 fixture no longer passes stageSize, which resolveIsoOverlayFitEnvelope does not read. test/iso-overlay-fixture-types.test.mjs typechecks the overlay test files with the TypeScript compiler: their fixture types (OverlaySceneFixture, OverlayEntryFixture) are the keys of the production types with deliberately loose values, so a partial fixture is fine and a field the type lacks is an excess-property error. Three checks: no excess property in the fixture files; a probe shows the fixture types resolve to the real inputs and reject view, referenceView, stageSize, layers, selectedDeviceId and groundRadius; every call of the scene builder gets its argument through a checked type (a literal in overlayScene or a declaration of the fixture type). Each check is red when a dead field is put back into a declared fixture, an override literal or an entry, when a literal goes straight into the builder, when a fixture loses its annotation, and when groundRadius returns to the entry type. isometric-contract now asserts that nothing renders into the overlay surface and that the removed renderers and groundRadius stay gone. No mutant is anchored on the removed code; mutation-gate --check is unchanged (3 warnings). The 19 2.5D golden scenes pass in capture on the accepted baselines. Issue: #732 User-Visible: no Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018qZfe7YS4rqEMKoVeS3GKd
This commit is contained in:
@@ -11136,10 +11136,7 @@ export class HouseplanCard extends LitElement {
|
||||
${isoFrame?.walls ?? nothing}
|
||||
</svg>
|
||||
<svg class="iso-overlays-svg" data-hp-live-viewbox="camera" viewBox="${view.x} ${view.y} ${view.w} ${view.h}"
|
||||
preserveAspectRatio="xMidYMid meet" aria-hidden="true" pointer-events="none">
|
||||
${isoFrame?.grounds ?? nothing}
|
||||
${isoFrame?.raised ?? nothing}
|
||||
</svg>` : nothing)}
|
||||
preserveAspectRatio="xMidYMid meet" aria-hidden="true" pointer-events="none"></svg>` : nothing)}
|
||||
${''/* docs/CANVAS.md §6: an icon is a percentage of the PLAN and
|
||||
scales with it when you zoom — the behaviour the card always
|
||||
had, restored by the owner. `iconCqw` is `iconPct * iconUnit
|
||||
|
||||
+1
-23
@@ -131,7 +131,6 @@ export type IsoOverlayRenderEntry = {
|
||||
id: string;
|
||||
kind: IsoRaisedOverlayKind;
|
||||
placement: IsoOverlayPlacement;
|
||||
groundRadius: number;
|
||||
/** Screen-facing HTML footprint around visualScene, in scene units. */
|
||||
screenHalfSize: PlanPoint;
|
||||
/**
|
||||
@@ -727,7 +726,7 @@ function sameOverlayEntries(
|
||||
return previous.length === next.length && next.every((entry, index) => {
|
||||
const before = previous[index];
|
||||
return before.id === entry.id && before.kind === entry.kind
|
||||
&& before.placement === entry.placement && before.groundRadius === entry.groundRadius
|
||||
&& before.placement === entry.placement
|
||||
&& before.screenHalfSize[0] === entry.screenHalfSize[0]
|
||||
&& before.screenHalfSize[1] === entry.screenHalfSize[1];
|
||||
});
|
||||
@@ -843,7 +842,6 @@ export function buildIsoOverlayRenderScene(input: IsoOverlaySceneInput): IsoOver
|
||||
id: device.id,
|
||||
kind: 'device',
|
||||
placement,
|
||||
groundRadius: Math.max(core * 0.32, 2),
|
||||
screenHalfSize: halfSize,
|
||||
layoutHalfSize,
|
||||
});
|
||||
@@ -866,7 +864,6 @@ export function buildIsoOverlayRenderScene(input: IsoOverlaySceneInput): IsoOver
|
||||
id: overlayRoom.id,
|
||||
kind: 'room-label',
|
||||
placement,
|
||||
groundRadius: Math.max(font * 0.75, 2),
|
||||
screenHalfSize: halfSize,
|
||||
});
|
||||
}
|
||||
@@ -891,7 +888,6 @@ export function buildIsoOverlayRenderScene(input: IsoOverlaySceneInput): IsoOver
|
||||
id: String(opening.id),
|
||||
kind: 'opening-lock',
|
||||
placement,
|
||||
groundRadius: Math.max(size * 0.28, 2),
|
||||
screenHalfSize: halfSize,
|
||||
});
|
||||
}
|
||||
@@ -1038,8 +1034,6 @@ export interface IsoFramePresentation {
|
||||
underlay: TemplateResult;
|
||||
shadows: TemplateResult;
|
||||
walls: TemplateResult;
|
||||
grounds: TemplateResult;
|
||||
raised: TemplateResult;
|
||||
}
|
||||
|
||||
/** Resolve every lazy Stage 4 artifact inside the card's single failure boundary. */
|
||||
@@ -1062,8 +1056,6 @@ export function resolveIsoFramePresentation(input: {
|
||||
underlay: renderIsoUnderlay(renderLayers, input.scene?.floor, input.cellCm),
|
||||
shadows: renderIsoShadows(renderLayers, panels, input.scene?.geometry, input.cellCm),
|
||||
walls: renderIsoWalls(input.projection, renderLayers, input.scene, panels, input.cellCm),
|
||||
grounds: renderIsoOverlayGrounds(overlays, renderLayers, input.cellCm),
|
||||
raised: renderIsoRaisedOverlays(overlays),
|
||||
});
|
||||
try { return render(layers); } catch (error) {
|
||||
// A material/shadow presentation failure loses only decorative nuance.
|
||||
@@ -1115,20 +1107,6 @@ function renderIsoDefs(
|
||||
</defs>` as unknown as TemplateResult;
|
||||
}
|
||||
|
||||
export function renderIsoOverlayGrounds(
|
||||
_overlays: IsoOverlayRenderScene | null,
|
||||
_layers: IsoDecorationLayers,
|
||||
_cellCm: number,
|
||||
): TemplateResult {
|
||||
return emptySvg();
|
||||
}
|
||||
|
||||
export function renderIsoRaisedOverlays(
|
||||
_overlays: IsoOverlayRenderScene | null,
|
||||
): TemplateResult {
|
||||
return emptySvg();
|
||||
}
|
||||
|
||||
export function renderIsoUnderlay(
|
||||
layers: IsoDecorationLayers,
|
||||
floor: IsoFloorGeometry | undefined,
|
||||
|
||||
Reference in New Issue
Block a user