From dca510bf14697b0a1df5c7228cc7c6463566d869 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 28 Oct 2026 22:14:31 +0000 Subject: [PATCH] [61] Raumprogramm: Schnitt-/Ansichtsmarker nicht auf freien Zeichnungsebenen Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67 --- src-tauri/core/src/plan/context.rs | 5 +++++ src/plan/generatePlan.sectionLine.test.ts | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src-tauri/core/src/plan/context.rs b/src-tauri/core/src/plan/context.rs index a8b22d9e..4c36dd09 100644 --- a/src-tauri/core/src/plan/context.rs +++ b/src-tauri/core/src/plan/context.rs @@ -121,6 +121,11 @@ pub fn plan_section_lines(c: &Ctx, out: &mut Vec) { if !c.shown(SECTION_LINE_CATEGORY) { return; } + // Auf freien Zeichnungsebenen (Blätter wie „Raumprogramm", Detail) gehören die Symbole nicht hin: + // sie beziehen sich auf die Geschoss-Grundrisse. + if c.p.drawing_levels.iter().any(|l| l.id == c.a.floor && matches!(l.kind, DrawingLevelKind::Drawing)) { + return; + } let greyed = Some(c.greyed(SECTION_LINE_CATEGORY)); for level in &c.p.drawing_levels { if !matches!(level.kind, DrawingLevelKind::Section | DrawingLevelKind::Elevation) { diff --git a/src/plan/generatePlan.sectionLine.test.ts b/src/plan/generatePlan.sectionLine.test.ts index dd467e75..eeb47f1c 100644 --- a/src/plan/generatePlan.sectionLine.test.ts +++ b/src/plan/generatePlan.sectionLine.test.ts @@ -74,6 +74,28 @@ describe("generatePlan — Schnittführungs-Symbol", () => { expect(labels.length).toBe(2); }); + it("zeichnet NICHTS auf einer freien Zeichnungsebene (kind drawing), aber weiter auf Geschossen", () => { + const p = baseProject([ + floor, + { id: "blatt", name: "Raumprogramm", kind: "drawing", visible: true, locked: false }, + { + id: "s-a", + name: "Schnitt A", + kind: "section", + visible: true, + locked: false, + linePoints: [{ x: 0, y: 2 }, { x: 6, y: 2 }], + directionSign: 1, + }, + ]); + const onSheet = generatePlan(p, "blatt", visible).primitives; + expect(onSheet.some((pr) => pr.kind === "polygon" && pr.sectionLineId != null)).toBe(false); + expect(onSheet.some((pr) => pr.kind === "line" && pr.cls === "section-line")).toBe(false); + expect(onSheet.some((pr) => pr.kind === "drawingText" && pr.text === "A")).toBe(false); + const onFloor = generatePlan(p, "eg", visible).primitives; + expect(onFloor.some((pr) => pr.kind === "polygon" && pr.sectionLineId === "s-a")).toBe(true); + }); + it("zeichnet NICHTS für eine Schnittebene ohne linePoints", () => { const p = baseProject([ floor,