Merge branch 'worktree-agent-ad6a558d2f19492ab' into claude/practical-noether-1hb2s1

This commit is contained in:
Claude committed 2026-11-14 10:35:43 +00:00
commit 0cfabdc552
16 files changed
+450 -71

No files matched your search

+81 -7
View File
@@ -4194,6 +4194,79 @@ export const de = {
"anonymity.kind.file": "Dateiname",
"anonymity.kind.email": "E-Mail",
"anonymity.kind.phone": "Telefon",
"anonymity.area.materials": "Materialien",
"anonymity.item.rooms": "Raum",
"anonymity.item.drawingLevels": "Geschoss",
"anonymity.item.layers": "Ebene / Klasse",
"anonymity.item.groups": "Gruppe",
"anonymity.item.blockDefs": "Block",
"anonymity.item.layouts": "Blatt",
"anonymity.item.masterLayouts": "Masterlayout",
"anonymity.item.drawings2d": "Zeichnung",
"anonymity.item.walls": "Wand",
"anonymity.item.openings": "Öffnung",
"anonymity.item.stairs": "Treppe",
"anonymity.item.columns": "Stütze",
"anonymity.item.context": "Kontext",
"anonymity.item.extrudedSolids": "Körper",
"anonymity.item.viewSnapshots": "Ausschnitt",
"anonymity.item.viewSnapshotFolders": "Ausschnitt-Ordner",
"anonymity.item.viewTemplates": "Ansichtsvorlage",
"anonymity.item.layoutFolders": "Layout-Ordner",
"anonymity.item.publishSets": "Publikationssatz",
"anonymity.item.roomProgram": "Raumprogramm",
"anonymity.item.export": "Ausgabe",
"anonymity.item.cameras": "Kamera",
"anonymity.item.components": "Bauteil",
"anonymity.item.wallTypes": "Wandtyp",
"anonymity.item.textStyles": "Textstil",
"anonymity.item.ceilings": "Decke",
"anonymity.item.roofs": "Dach",
"anonymity.item.trees": "Baum",
"anonymity.item.hatches": "Schraffur",
"anonymity.item.lineStyles": "Linienstil",
"anonymity.item.materials": "Material",
"anonymity.field.name": "Name",
"anonymity.field.text": "Text",
"anonymity.field.note": "Notiz",
"anonymity.field.notes": "Notizen",
"anonymity.field.label": "Beschriftung",
"anonymity.field.title": "Titel",
"anonymity.field.description": "Beschreibung",
"anonymity.field.comment": "Kommentar",
"anonymity.field.sheetName": "Blattname",
"anonymity.field.projectName": "Projektname",
"anonymity.field.projectNumber": "Projektnummer",
"anonymity.field.author": "Bearbeiter:in",
"anonymity.field.number": "Nummer",
"anonymity.field.planNumber": "Plannummer",
"anonymity.field.revision": "Revision",
"anonymity.field.date": "Datum",
"anonymity.field.mark": "Kennzeichen",
"anonymity.field.abbrev": "Kürzel",
"anonymity.field.family": "Familie",
"anonymity.field.code": "Code",
"anonymity.field.group": "Gruppe",
"anonymity.field.layer": "Ebene",
"anonymity.field.value": "Wert",
"anonymity.field.setName": "Satzname",
"anonymity.field.namePattern": "Namensmuster",
"anonymity.field.identifiers": "Angaben",
"anonymity.field.keyword": "Kennwort",
"anonymity.field.source": "Quelle",
"anonymity.field.template": "Vorlage",
"anonymity.field.folder": "Ordner",
"anonymity.field.floorFinish": "Bodenbelag",
"anonymity.field.ceilingFinish": "Deckenbelag",
"anonymity.field.wallFinish": "Wandbelag",
"anonymity.field.floorBuildUp": "Bodenaufbau",
"anonymity.field.species": "Art",
"anonymity.field.format": "Format",
"anonymity.field.fileName": "Dateiname",
"anonymity.field.scale": "Massstab",
"anonymity.part.titleBlock": "Titelblock",
"anonymity.part.images": "Bild",
"anonymity.part.index": "Eintrag",
"publish.competition.identifiers": "Weitere Angaben, die nicht vorkommen dürfen",
"publish.competition.identifiersHint": "Büro, Namen, E-Mail, Telefon, getrennt durch Komma. Vor dem Export der anonymen Abgabe im Freitext gesucht.",
"publish.competition.keyword": "Kennwort",
@@ -4213,6 +4286,7 @@ export const de = {
"siteProof.col.allowed": "Zulässig",
"siteProof.col.actual": "Projekt",
"siteProof.col.reserve": "Reserve (+) / Überschr. (−)",
"siteProof.col.reserveShort": "Reserve",
"siteProof.col.ok": "Erfüllt",
"siteProof.col.basis": "Grundlage",
"siteProof.col.value": "Wert",
@@ -4357,18 +4431,18 @@ export const de = {
"lib.o.wc-wand": "WC wandhängend",
"lib.o.wc-kasten": "WC mit Spülkasten",
"lib.o.lavabo": "Lavabo",
"lib.o.handwaschbecken": "Handwaschbecken",
"lib.o.handwaschbecken": "Handwasch\u00ADbecken",
"lib.o.doppellavabo": "Doppellavabo",
"lib.o.dusche-90": "Dusche 90×90",
"lib.o.dusche-80x120": "Dusche 80×120",
"lib.o.wanne-170": "Badewanne 170×75",
"lib.o.wanne-180": "Badewanne 180×80",
"lib.o.urinal": "Urinal",
"lib.o.waschmaschine": "Waschmaschine / Tumbler",
"lib.o.waschmaschine": "Wasch\u00ADmaschine / Tumbler",
"lib.o.kueche-unterbau": "Unterbau 55",
"lib.o.kueche-spuele": "Spüle 55",
"lib.o.kueche-kochfeld": "Kochfeld 55",
"lib.o.kueche-geschirrspueler": "Geschirrspüler 55",
"lib.o.kueche-geschirrspueler": "Geschirr\u00ADspüler 55",
"lib.o.kueche-kuehlschrank": "Kühlschrank 55",
"lib.o.kueche-hochschrank": "Hochschrank 55",
"lib.o.kueche-zeile": "Küchenzeile (55er-Module)",
@@ -4393,9 +4467,9 @@ export const de = {
"lib.o.bett-180": "Bett 180×200",
"lib.o.kinderbett": "Kinderbett 70×140",
"lib.o.nachttisch": "Nachttisch",
"lib.o.schrank-50": "Einbauschrank 50",
"lib.o.schrank-60": "Einbauschrank 60",
"lib.o.schrank-100": "Einbauschrank 100",
"lib.o.schrank-50": "Einbau\u00ADschrank 50",
"lib.o.schrank-60": "Einbau\u00ADschrank 60",
"lib.o.schrank-100": "Einbau\u00ADschrank 100",
"lib.o.garderobe": "Garderobe T 35",
"lib.o.regal": "Regal T 35",
"lib.o.auto": "Auto mit Parkfeld",
@@ -4420,7 +4494,7 @@ export const de = {
"lib.empty": "Keine Objekte verfügbar.",
"lib.params": "Vorgaben",
"lib.reroll": "Neu würfeln",
"lib.section": "Objekt aus Bibliothek",
"lib.section": "Objekt",
"lib.unknown": "Unbekanntes Objekt",
"cmd.libobj.label": "Objekt setzen",
"cmd.libobj.point": "Einfügepunkt:",
+103 -29
View File
@@ -4144,34 +4144,34 @@ export const en: Record<TranslationKey, string> = {
"anonymity.proceed": "Export anyway",
"anonymity.area.hatches": "Hatches",
"anonymity.area.lineStyles": "Line styles",
"anonymity.area.rooms": "rooms",
"anonymity.area.drawingLevels": "floors",
"anonymity.area.layers": "layers / classes",
"anonymity.area.groups": "groups",
"anonymity.area.blockDefs": "blocks",
"anonymity.area.layouts": "layouts / sheets",
"anonymity.area.masterLayouts": "master layouts",
"anonymity.area.drawings2d": "2D drawing / text",
"anonymity.area.walls": "walls",
"anonymity.area.openings": "openings",
"anonymity.area.stairs": "stairs",
"anonymity.area.columns": "columns",
"anonymity.area.context": "context",
"anonymity.area.extrudedSolids": "solids",
"anonymity.area.viewSnapshots": "view snapshots",
"anonymity.area.viewSnapshotFolders": "snapshot folders",
"anonymity.area.viewTemplates": "view templates",
"anonymity.area.layoutFolders": "layout folders",
"anonymity.area.publishSets": "publish sets",
"anonymity.area.roomProgram": "room program",
"anonymity.area.export": "output",
"anonymity.area.cameras": "cameras",
"anonymity.area.components": "components",
"anonymity.area.wallTypes": "wall types",
"anonymity.area.textStyles": "text styles",
"anonymity.area.ceilings": "ceilings",
"anonymity.area.roofs": "roofs",
"anonymity.area.trees": "trees",
"anonymity.area.rooms": "Rooms",
"anonymity.area.drawingLevels": "Floors",
"anonymity.area.layers": "Layers / classes",
"anonymity.area.groups": "Groups",
"anonymity.area.blockDefs": "Blocks",
"anonymity.area.layouts": "Layouts / sheets",
"anonymity.area.masterLayouts": "Master layouts",
"anonymity.area.drawings2d": "2D drawings / text",
"anonymity.area.walls": "Walls",
"anonymity.area.openings": "Openings",
"anonymity.area.stairs": "Stairs",
"anonymity.area.columns": "Columns",
"anonymity.area.context": "Context",
"anonymity.area.extrudedSolids": "Solids",
"anonymity.area.viewSnapshots": "View snapshots",
"anonymity.area.viewSnapshotFolders": "Snapshot folders",
"anonymity.area.viewTemplates": "View templates",
"anonymity.area.layoutFolders": "Layout folders",
"anonymity.area.publishSets": "Publish sets",
"anonymity.area.roomProgram": "Room programme",
"anonymity.area.export": "Output",
"anonymity.area.cameras": "Cameras",
"anonymity.area.components": "Components",
"anonymity.area.wallTypes": "Wall types",
"anonymity.area.textStyles": "Text styles",
"anonymity.area.ceilings": "Ceilings",
"anonymity.area.roofs": "Roofs",
"anonymity.area.trees": "Trees",
"anonymity.kind.name": "project name",
"anonymity.kind.number": "project number",
"anonymity.kind.titleBlock": "office / author",
@@ -4180,6 +4180,79 @@ export const en: Record<TranslationKey, string> = {
"anonymity.kind.file": "file name",
"anonymity.kind.email": "e-mail",
"anonymity.kind.phone": "phone",
"anonymity.area.materials": "Materials",
"anonymity.item.rooms": "Room",
"anonymity.item.drawingLevels": "Level",
"anonymity.item.layers": "Layer / class",
"anonymity.item.groups": "Group",
"anonymity.item.blockDefs": "Block",
"anonymity.item.layouts": "Sheet",
"anonymity.item.masterLayouts": "Master layout",
"anonymity.item.drawings2d": "Drawing",
"anonymity.item.walls": "Wall",
"anonymity.item.openings": "Opening",
"anonymity.item.stairs": "Stair",
"anonymity.item.columns": "Column",
"anonymity.item.context": "Context",
"anonymity.item.extrudedSolids": "Solid",
"anonymity.item.viewSnapshots": "View snapshot",
"anonymity.item.viewSnapshotFolders": "Snapshot folder",
"anonymity.item.viewTemplates": "View template",
"anonymity.item.layoutFolders": "Layout folder",
"anonymity.item.publishSets": "Publish set",
"anonymity.item.roomProgram": "Room program",
"anonymity.item.export": "Output",
"anonymity.item.cameras": "Camera",
"anonymity.item.components": "Component",
"anonymity.item.wallTypes": "Wall type",
"anonymity.item.textStyles": "Text style",
"anonymity.item.ceilings": "Ceiling",
"anonymity.item.roofs": "Roof",
"anonymity.item.trees": "Tree",
"anonymity.item.hatches": "Hatch",
"anonymity.item.lineStyles": "Line style",
"anonymity.item.materials": "Material",
"anonymity.field.name": "Name",
"anonymity.field.text": "Text",
"anonymity.field.note": "Note",
"anonymity.field.notes": "Notes",
"anonymity.field.label": "Label",
"anonymity.field.title": "Title",
"anonymity.field.description": "Description",
"anonymity.field.comment": "Comment",
"anonymity.field.sheetName": "Sheet name",
"anonymity.field.projectName": "Project name",
"anonymity.field.projectNumber": "Project number",
"anonymity.field.author": "Author",
"anonymity.field.number": "Number",
"anonymity.field.planNumber": "Plan number",
"anonymity.field.revision": "Revision",
"anonymity.field.date": "Date",
"anonymity.field.mark": "Mark",
"anonymity.field.abbrev": "Abbreviation",
"anonymity.field.family": "Family",
"anonymity.field.code": "Code",
"anonymity.field.group": "Group",
"anonymity.field.layer": "Layer",
"anonymity.field.value": "Value",
"anonymity.field.setName": "Set name",
"anonymity.field.namePattern": "Name pattern",
"anonymity.field.identifiers": "Identifiers",
"anonymity.field.keyword": "Keyword",
"anonymity.field.source": "Source",
"anonymity.field.template": "Template",
"anonymity.field.folder": "Folder",
"anonymity.field.floorFinish": "Floor finish",
"anonymity.field.ceilingFinish": "Ceiling finish",
"anonymity.field.wallFinish": "Wall finish",
"anonymity.field.floorBuildUp": "Floor build-up",
"anonymity.field.species": "Species",
"anonymity.field.format": "Format",
"anonymity.field.fileName": "File name",
"anonymity.field.scale": "Scale",
"anonymity.part.titleBlock": "Title block",
"anonymity.part.images": "Image",
"anonymity.part.index": "Entry",
"publish.competition.identifiers": "Further details that must not appear",
"publish.competition.identifiersHint": "Office, names, e-mail, phone, separated by commas. Searched in free text before an anonymous submission is exported.",
"publish.competition.keyword": "Keyword",
@@ -4199,6 +4272,7 @@ export const en: Record<TranslationKey, string> = {
"siteProof.col.allowed": "Allowed",
"siteProof.col.actual": "Project",
"siteProof.col.reserve": "Reserve (+) / excess (−)",
"siteProof.col.reserveShort": "Reserve",
"siteProof.col.ok": "Met",
"siteProof.col.basis": "Basis",
"siteProof.col.value": "Value",
@@ -4406,7 +4480,7 @@ export const en: Record<TranslationKey, string> = {
"lib.empty": "No objects available.",
"lib.params": "Defaults",
"lib.reroll": "Re-roll",
"lib.section": "Library object",
"lib.section": "Object",
"lib.unknown": "Unknown object",
"cmd.libobj.label": "Place object",
"cmd.libobj.point": "Insertion point:",
+6
View File
@@ -38,6 +38,12 @@ declare global {
}
}
window.__i18n = { getLanguage, setLanguage };
// Nur mit `?dossierTest&lang=en`: Sprache VOR dem ersten Render setzen (UI-Review; gibt noch keinen Umschalter).
{
const q = new URLSearchParams(window.location.search);
const l = q.get("lang");
if (q.has("dossierTest") && (l === "de" || l === "en")) setLanguage(l);
}
// ── Native-App-Verhalten (kein Browser-Standard) ─────────────────────────────
// Die App soll sich wie ein natives Programm anfühlen. Diese globalen Hooks
+6 -3
View File
@@ -57,7 +57,7 @@ export function AreaTableSection() {
<div key={si} className="area-block">
<div className="area-heading">{s.heading}</div>
<div className="area-scroll">
<table className="area-table">
<table className={s.columns.length > 6 ? "area-table wide" : "area-table"}>
<thead>
<tr>
{s.columns.map((c, i) => (
@@ -72,9 +72,12 @@ export function AreaTableSection() {
<tr key={ri} className={r.total ? "total" : ""}>
{r.cells.map((c, ci) =>
typeof c === "string" ? (
<td key={ci}>{c}</td>
// Kurze Textzellen in Zahlenspalten (Strich, ja/nein) stehen wie die Zahlen rechts.
<td key={ci} data-label={ci > 0 ? s.columns[ci] : undefined} className={ci > 0 && c.length <= 4 ? "num" : undefined}>
{c}
</td>
) : (
<td key={ci} className="num">
<td key={ci} data-label={ci > 0 ? s.columns[ci] : undefined} className="num">
{c.n === null ? "–" : c.n.toFixed(c.d)}
</td>
),
+29 -5
View File
@@ -2,7 +2,7 @@
// mit Vorschau-Symbol je Objekt. Klick wählt das Objekt und startet den Befehl `libobj` (Einfügepunkt klicken,
// R = drehen, M = spiegeln). Der Katalog kommt aus dem Rust-Kern; die Vorschau zeichnet der Kern (grob).
import { useMemo } from "react";
import { useMemo, useState } from "react";
import { t } from "../i18n";
import type { TranslationKey } from "../i18n";
import { usePanelHostAction } from "./host";
@@ -43,7 +43,31 @@ function Preview({ def }: { def: LibObjectDef }) {
);
}
const OPEN_KEY = "cad.objlib.open";
/** Gemerkter Zustand der Gruppen (offen/zu) je Gruppen-Schlüssel; leer, wenn nichts gespeichert ist. */
function loadOpen(): Record<string, boolean> {
try {
const raw = localStorage.getItem(OPEN_KEY);
const v: unknown = raw ? JSON.parse(raw) : null;
return v && typeof v === "object" ? (v as Record<string, boolean>) : {};
} catch {
return {};
}
}
export function ObjectLibraryPanel() {
const [open, setOpen] = useState<Record<string, boolean>>(loadOpen);
const setGroupOpen = (g: string, v: boolean) =>
setOpen((o) => {
const next = { ...o, [g]: v };
try {
localStorage.setItem(OPEN_KEY, JSON.stringify(next));
} catch {
/* Speicher gesperrt: der Zustand gilt nur für diese Sitzung */
}
return next;
});
const onRunCommand = usePanelHostAction("onRunCommand");
const catalog = useMemo(() => libCatalog(), []);
const groups = useMemo(() => libGroups(), []);
@@ -60,7 +84,7 @@ export function ObjectLibraryPanel() {
<div className="objlib-panel" style={{ overflowY: "auto", padding: "6px 8px" }}>
<div style={{ fontSize: 11, color: "var(--muted)", marginBottom: 6 }}>{t("lib.hint")}</div>
{groups.map((g) => (
<details key={g} open={g === groups[0]} style={{ marginBottom: 4 }}>
<details key={g} open={open[g] ?? g === groups[0]} onToggle={(e) => { const v = e.currentTarget.open; if (v !== (open[g] ?? g === groups[0])) setGroupOpen(g, v); }} style={{ marginBottom: 4 }}>
<summary style={{ cursor: "pointer", fontSize: 12, fontWeight: 600, padding: "3px 0" }}>{t(`lib.g.${g}` as TranslationKey)}</summary>
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(72px, 1fr))", gap: 4, padding: "4px 0" }}>
{catalog.objects
@@ -71,8 +95,8 @@ export function ObjectLibraryPanel() {
<button
key={o.id}
type="button"
title={name}
aria-label={name}
title={name.replace(/\u00AD/g, "")}
aria-label={name.replace(/\u00AD/g, "")}
onClick={() => place(o)}
style={{
display: "flex",
@@ -89,7 +113,7 @@ export function ObjectLibraryPanel() {
}}
>
<Preview def={o} />
<span style={{ fontSize: 10, lineHeight: 1.15, textAlign: "center", overflowWrap: "anywhere" }}>{name}</span>
<span style={{ fontSize: 10, lineHeight: 1.15, textAlign: "center", overflowWrap: "break-word", hyphens: "manual" }}>{name}</span>
</button>
);
})}
+3 -2
View File
@@ -46,7 +46,8 @@ import type {
// v13 ([238]): rechts oben (Objekt-Info/Flächenbilanz) bekommt mehr Höhe: Gewichte 1,6 : 1 statt 1 : 1,5 (die
// Flächenbilanz mit Raumprogramm war nur ~300 px hoch). Die Höhe merkt sich der Gruppen-Splitter (`resizeGroups`).
// v14 ([253]): Objekt-Bibliothek ("object-library") als Tab neben den Werkzeugen links oben.
export const LAYOUT_VERSION = 14;
// v15 ([253]): links oben (Werkzeuge/Objekte) bekommt mehr Höhe: Gewichte 1,6 : 1 (die Objekt-Palette war im 900-px-Fenster nur ~270 px hoch).
export const LAYOUT_VERSION = 15;
/** localStorage-Schlüssel des zuletzt benutzten Layouts. */
const CURRENT_KEY = "cad.layout";
@@ -74,7 +75,7 @@ const NAMED_PREFIX = "cad.layouts.";
// der Attribute-Palette darunter (Vectorworks-Bild). Das Ribbon-Band bleibt als
// Reiter erreichbar, ist aber nicht mehr der primäre Weg zu den Werkzeugen.
const DEFAULT_LEFT_GROUPS: DockGroup[] = [
{ tabs: ["tools", "object-library"], activeTab: "tools", weight: 1 },
{ tabs: ["tools", "object-library"], activeTab: "tools", weight: 1.6 },
{ tabs: ["attributes"], activeTab: "attributes", weight: 1 },
];
const DEFAULT_RIGHT_GROUPS: DockGroup[] = [
+12
View File
@@ -1,4 +1,5 @@
import { describe, expect, it } from "vitest";
import { setLanguage } from "../i18n";
import {
comboFromEvent,
comboMatches,
@@ -158,6 +159,17 @@ describe("formatCombo", () => {
expect(formatCombo("mod+shift+z", false)).toBe("Strg+Umschalt+Z");
});
it("Englisch: Ctrl/Shift/Del statt Strg/Umschalt/Entf", () => {
setLanguage("en");
try {
expect(formatCombo("mod+shift+Tab", false)).toBe("Ctrl+Shift+Tab");
expect(formatCombo("Delete", false)).toBe("Del");
expect(formatCombo("mod+shift+z", true)).toBe("⌘⇧Z");
} finally {
setLanguage("de");
}
});
it("Sondertasten bekommen ein lesbares Label", () => {
expect(formatCombo("Delete", false)).toBe("Entf");
});
+9 -3
View File
@@ -21,6 +21,8 @@
// Sync) bleibt in App.tsx — exaktes Muster wie `commandAliasOverrides.ts`.
// Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import { getLanguage } from "../i18n/translate";
export type ShortcutId =
| "undo"
| "redo"
@@ -384,16 +386,20 @@ const KEY_DISPLAY_LABELS: Record<string, string> = {
ArrowRight: "→",
};
/** Englische Tastennamen, wo sie vom Deutschen abweichen (Rest wie `KEY_DISPLAY_LABELS`). */
const KEY_DISPLAY_LABELS_EN: Record<string, string> = { Delete: "Del", Backspace: "Backspace", " ": "Space" };
/** Menschenlesbare Darstellung einer Kombination, plattformabhängig (⌘⇧Z auf macOS, Strg+Umschalt+Z sonst). */
export function formatCombo(combo: string, mac: boolean = isMacPlatform()): string {
const parts = combo.split("+");
const key = parts[parts.length - 1];
const mods = parts.slice(0, -1);
const segs: string[] = [];
if (mods.includes("mod")) segs.push(mac ? "⌘" : "Strg");
if (mods.includes("shift")) segs.push(mac ? "⇧" : "Umschalt");
const en = getLanguage() === "en";
if (mods.includes("mod")) segs.push(mac ? "⌘" : en ? "Ctrl" : "Strg");
if (mods.includes("shift")) segs.push(mac ? "⇧" : en ? "Shift" : "Umschalt");
if (mods.includes("alt")) segs.push(mac ? "⌥" : "Alt");
const keyLabel = KEY_DISPLAY_LABELS[key] ?? (key.length === 1 ? key.toUpperCase() : key);
const keyLabel = (en ? KEY_DISPLAY_LABELS_EN[key] : undefined) ?? KEY_DISPLAY_LABELS[key] ?? (key.length === 1 ? key.toUpperCase() : key);
segs.push(keyLabel);
return segs.join(mac ? "" : "+");
}
+70 -1
View File
@@ -4678,6 +4678,8 @@ body {
position: fixed;
z-index: 301;
min-width: 240px;
max-height: calc(100vh - 8px);
overflow-y: auto;
max-width: 320px;
background: var(--ctx-surface);
border: 1px solid var(--ctx-border);
@@ -8875,7 +8877,7 @@ body {
}
.area-table th,
.area-table td {
padding: 2px 5px;
padding: 2px 3px;
white-space: nowrap;
text-align: left;
border-bottom: 1px solid var(--line);
@@ -8883,6 +8885,23 @@ body {
.area-table th {
color: var(--ink-2);
font-weight: 600;
/* Köpfe und Textzellen dürfen umbrechen: die 340-px-Dock-Spalte zeigt so auch die Baurecht-Nachweis-Tabelle (5 Spalten) ganz. */
white-space: normal;
vertical-align: bottom;
line-height: 1.2;
}
.area-table td:not(.num) {
white-space: normal;
hyphens: auto;
overflow-wrap: anywhere; /* lange Wörter („Geschossflächenziffer“) brechen, statt die Tabelle über die Dock-Breite zu schieben */
}
.area-table td:first-child {
min-width: 5em;
}
.area-table.wide td:first-child {
min-width: 6.2em;
overflow-wrap: normal;
hyphens: manual;
}
.area-table .num {
text-align: right;
@@ -8891,6 +8910,56 @@ body {
font-weight: 700;
border-top: 1px solid var(--ink-2);
}
/* Breite Tabelle (> 6 Spalten) in schmaler Dock-Spalte: jede Zeile als Karte — Name oben, darunter die Kennwerte
als Raster (5 Spalten) „Kopf über Zahl“ (data-label der Zelle). Kein waagrechtes Scrollen, nichts abgeschnitten. */
.area-block {
container-type: inline-size;
}
@container (max-width: 460px) {
.area-table.wide,
.area-table.wide tbody {
display: block;
}
.area-table.wide thead {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
}
.area-table.wide tr {
display: grid;
grid-template-columns: repeat(5, minmax(0, 1fr));
column-gap: 4px;
padding: 3px 0;
border-bottom: 1px solid var(--line);
}
.area-table.wide td {
border-bottom: 0;
padding: 1px 3px;
min-width: 0;
}
.area-table.wide tr.total td {
border-top: 0;
}
.area-table.wide tr.total {
border-top: 1px solid var(--ink-2);
}
.area-table.wide td:first-child {
grid-column: 1 / -1;
font-weight: 600;
min-width: 0;
}
.area-table.wide td[data-label]::before {
content: attr(data-label);
display: block;
font-size: 9px;
line-height: 1.2;
font-weight: 600;
color: var(--ink-2);
text-align: right;
}
}
.area-inputs {
display: flex;
flex-direction: column;
+18 -5
View File
@@ -3,21 +3,35 @@
// `LockConflictDialog` (kein window.confirm: im Tauri-WKWebView stumm). Zustand und Prüfung: `state/anonymityGate.ts`.
import { memo, useEffect, useSyncExternalStore } from "react";
import { t } from "../i18n";
import { getLanguage, t } from "../i18n";
import { getAnonymityRequest, subscribeAnonymityRequest } from "../state/anonymityGate";
import { useModalFocus } from "./modalFocus";
import { anonymityPlaceParts } from "./anonymityPlace";
const AREA_KEYS = new Set([
"rooms", "drawingLevels", "layers", "groups", "blockDefs", "layouts", "masterLayouts", "drawings2d", "walls", "openings",
"stairs", "columns", "context", "extrudedSolids", "viewSnapshots", "viewSnapshotFolders", "viewTemplates", "layoutFolders",
"publishSets", "roomProgram", "export", "cameras", "components", "wallTypes", "textStyles", "ceilings", "roofs", "trees",
"hatches", "lineStyles",
"hatches", "lineStyles", "materials",
]);
function areaLabel(area: string): string {
return AREA_KEYS.has(area) ? t(`anonymity.area.${area}`) : area;
}
/** Fundstelle lesbar: Elementart „Name“ · Feld (z. B. Material „Wärmedämmung“ · Name). */
function FindingPlace({ area, place }: { area: string; place: string }) {
const p = anonymityPlaceParts(area, place);
const q = (s: string) => (getLanguage() === "en" ? `\u201C${s}\u201D` : `\u201E${s}\u201C`);
return (
<>
<b>{p.kind || areaLabel(area)}</b>
{p.item ? <b> {q(p.item)}</b> : null}
{p.field ? <span style={{ color: "var(--muted)" }}> · {p.field}</span> : null}
</>
);
}
const DialogBody = memo(function DialogBody() {
const request = useSyncExternalStore(subscribeAnonymityRequest, getAnonymityRequest);
const dialogRef = useModalFocus({});
@@ -46,10 +60,9 @@ const DialogBody = memo(function DialogBody() {
<ul data-testid="anonymity-findings" style={{ margin: "6px 0 0", paddingLeft: 18, maxHeight: 280, overflow: "auto", fontSize: 12 }}>
{findings.map((f, i) => (
<li key={i} data-kind={f.kind} style={{ marginBottom: 4 }}>
<b>{areaLabel(f.area)}</b>
{f.place ? <span style={{ color: "var(--muted)" }}> · {f.place}</span> : null}
<FindingPlace area={f.area} place={f.place} />
<div>
„{f.text}" — {t(`anonymity.kind.${f.kind}`)}: <span className="mono">{f.term}</span>
{getLanguage() === "en" ? `\u201C${f.text}\u201D` : `\u201E${f.text}\u201C`} — {t(`anonymity.kind.${f.kind}`)}: <span className="mono">{f.term}</span>
</div>
</li>
))}
+25
View File
@@ -0,0 +1,25 @@
// Fundstellen-Zerlegung des Anonymitäts-Dialogs: Pfade des Kerns -> Elementart, Name, Feld (de/en).
import { afterEach, describe, expect, it } from "vitest";
import { setLanguage } from "../i18n";
import { anonymityPlaceParts } from "./anonymityPlace";
afterEach(() => setLanguage("de"));
describe("anonymityPlaceParts", () => {
it("typische Pfade auf Deutsch", () => {
setLanguage("de");
expect(anonymityPlaceParts("materials", "Wärmedämmung.name")).toEqual({ kind: "Material", item: "Wärmedämmung", field: "Name" });
expect(anonymityPlaceParts("rooms", "Küche.note")).toEqual({ kind: "Raum", item: "Küche", field: "Notiz" });
expect(anonymityPlaceParts("drawingLevels", "EG.name")).toEqual({ kind: "Geschoss", item: "EG", field: "Name" });
expect(anonymityPlaceParts("layers", "Wände.layers.Anna.name")).toEqual({ kind: "Ebene / Klasse", item: "Wände › Anna", field: "Name" });
expect(anonymityPlaceParts("drawings2d", "0.text")).toEqual({ kind: "Zeichnung", item: "0", field: "Text" });
expect(anonymityPlaceParts("layouts", "Plan.titleBlock.sheetName")).toEqual({ kind: "Blatt", item: "Plan", field: "Titelblock · Blattname" });
expect(anonymityPlaceParts("layouts", "Plan.images.logo.png.name")).toEqual({ kind: "Blatt", item: "Plan › logo.png", field: "Name" });
});
it("Englisch, unbekanntes Feld und Zusatztext", () => {
setLanguage("en");
expect(anonymityPlaceParts("materials", "Insulation.name")).toEqual({ kind: "Material", item: "Insulation", field: "Name" });
expect(anonymityPlaceParts("rooms", "Kitchen.weird")).toEqual({ kind: "Room", item: "Kitchen", field: "weird" });
expect(anonymityPlaceParts("export", "Dateiname")).toEqual({ kind: "Output", item: "", field: "Dateiname" });
});
});
+40
View File
@@ -0,0 +1,40 @@
// Lesbare Fundstelle für den Anonymitäts-Dialog ([208]): der Kern liefert Bereich und Pfad
// (`Wärmedämmung.name`, `Plan.titleBlock.sheetName`); hier werden Elementart, Name und Feld daraus.
//
// Bezeichner englisch, Kommentare deutsch.
import { t } from "../i18n";
export interface PlaceParts {
/** Elementart im Singular („Material“), leer wenn unbekannt. */
kind: string;
/** Name des Elements (ggf. mit Unterelement: „Plan › logo.png“). */
item: string;
/** Feld („Name“, „Blattname“); bei Orten ohne Pfad (Zusatztexte wie „Dateiname“) der Ort selbst. */
field: string;
}
/** Zwischenschlüssel im Pfad, die ein Unterelement einleiten (Liste in einem Element). */
const NESTED = ["images", "layers", "children", "items", "rows"];
/** Übersetzung, oder der Fallback, wenn es den Schlüssel nicht gibt (`t` gibt dann den Schlüssel zurück). */
function tr(key: string, fallback: string): string {
const s = t(key);
return s === key ? fallback : s;
}
/** Zerlegt Bereich und Pfad in Elementart, Elementname und Feld. */
export function anonymityPlaceParts(area: string, place: string): PlaceParts {
const kind = tr(`anonymity.item.${area}`, "");
const cut = place.lastIndexOf(".");
if (cut < 0) return { kind, item: "", field: place };
const key = place.slice(cut + 1);
let item = place.slice(0, cut);
let field = /^\d+$/.test(key) ? `${tr("anonymity.part.index", "")} ${key}`.trim() : tr(`anonymity.field.${key}`, key);
if (item.endsWith(".titleBlock")) {
item = item.slice(0, -".titleBlock".length);
field = `${tr("anonymity.part.titleBlock", "titleBlock")} · ${field}`;
}
for (const n of NESTED) item = item.split(`.${n}.`).join(" › ");
return { kind, item, field };
}
+20 -9
View File
@@ -4,7 +4,7 @@
//
// Extrahiert aus App.tsx. Bezeichner englisch, Kommentare deutsch (CONVENTIONS.md).
import React, { useEffect, useRef, useState } from "react";
import React, { useEffect, useLayoutEffect, useRef, useState } from "react";
import { t } from "../i18n";
export function InlineEditor({
@@ -23,16 +23,27 @@ export function InlineEditor({
const ref = useRef<HTMLDivElement>(null);
// An die Viewport-Ränder klemmen (wie das Kontextmenü).
const [pos, setPos] = useState({ x, y });
useEffect(() => {
// Auch nach dem Aufbau neu klemmen: Felder (z. B. Füllung) wachsen den Editor erst nach der ersten Messung.
useLayoutEffect(() => {
const el = ref.current;
if (!el) return;
const r = el.getBoundingClientRect();
let nx = x;
let ny = y;
if (nx + r.width > window.innerWidth - 4) nx = window.innerWidth - r.width - 4;
if (ny + r.height > window.innerHeight - 4)
ny = window.innerHeight - r.height - 4;
setPos({ x: Math.max(4, nx), y: Math.max(4, ny) });
const clamp = () => {
// Layout-Mass (offsetWidth), nicht getBoundingClientRect: die Einblend-Animation skaliert und verfälscht die Messung.
const nx = Math.min(x, window.innerWidth - el.offsetWidth - 4);
const ny = Math.min(y, window.innerHeight - el.offsetHeight - 4);
setPos((p) => {
const q = { x: Math.max(4, nx), y: Math.max(4, ny) };
return p.x === q.x && p.y === q.y ? p : q;
});
};
clamp();
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(clamp);
ro?.observe(el);
window.addEventListener("resize", clamp);
return () => {
ro?.disconnect();
window.removeEventListener("resize", clamp);
};
}, [x, y]);
// Schließen bei Außenklick / Esc.
useEffect(() => {