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

# Conflicts:
#	TODO.md
This commit is contained in:
Claude committed 2026-11-11 21:04:00 +00:00
commit 71d3f0ee83
22 files changed
+791 -201

No files matched your search

+1 -1
View File
@@ -88,7 +88,6 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `*
- ○ **[193]** Anwählen/Bearbeiten von Gelände & Co. (12.11., Maintainer, PRIO): Cmd+A lässt Kontext-Elemente (Gelände, Höhenlinien, Baugrube, Kontext) bewusst aus (`useKeyboardShortcuts.ts`) — seit [181] normale Elemente → mit auswählen (gesperrte nicht). Nach Löschen bleibt eine Belag-Schraffur, die weder anwählbar noch löschbar ist (vermutlich Decke/Raum anderes Geschoss) → klären: sichtbar ⇒ anwählbar. Baugrube im Grundriss nicht anwähl-/verschiebbar → Pick, Verschieben, Eckgriffe. Gelände nicht anpassbar → Anwählen, Verschieben, Höhe versetzen; Höhenlinien: Höhe je Linie, Punkte ziehen; Netz: verschieben/versetzen/zuschneiden. e2e für alles. · M
- ○ **[192]** Ebenen/Klassen schnell schalten (12.11., Maintainer): Rechtsklick im Ebenen-Panel „Nur diese Ebene anzeigen“, „Diese ausblenden“, „Alle einblenden“; Rechtsklick auf Objekt (Plan/Schnitt/3D) „Ebene des Objekts isolieren/ausblenden“, „Alle Ebenen einblenden“ (stellt Zustand vor dem Isolieren wieder her); optional Kürzel. Sonnet. · S
- ○ **[191]** Runde Decken/Dächer (12.11., Maintainer-Screenshot Erker 3D): Decken-/Dachumrisse sind Polygone (Beispiel: `arcPts(…, 14)`) → facettierte Kanten; Bogenwände ohne Deckenauflager [178] → Decke ragt durch die runde Wand (Flackern/Linien). Umsetzen: Bögen im Umriss (Bulge je Kante wie Wände) für Decken/Dächer/Räume oder Ableitung aus angrenzenden Bogenwänden, feine Tessellierung + weiche Normalen im 3D, echte Bögen in Plan/Schnitt/Export; [178] auch an Bogenwänden; Beispielprojekt auf echte Bögen umstellen. Opus. · L
- ○ **[189]** Panels neu ordnen + Einstellungsdialog (12.11., Maintainer): Attribute-Panel unten links nur Gestaltung (Stift, Füllung, Linienstil, Schraffur); BIM-/Bauteil-Infos (Typ, Schichten, Masse, Kennwerte, IFC/Psets, Material …) in die Objekt-Info. Taste T bei Auswahl öffnet direkt den Einstellungsdialog des Objekts (wie Archicad Cmd+T), v. a. für Fenster/Türen, deren Einstellungen heute nur über das Attribute-Panel erreichbar sind. · M
- ○ **[187]** Griffe im Schnitt/in der Ansicht (12.11., Maintainer): angewählte Elemente haben dort kaum Fasspunkte (Decken, Gelände, Dächer …). Wie Archicad: Decke OK/UK (Höhe/Dicke), Wand OK (Höhe), Öffnung Brüstung/Sturz, Dach Traufe/First bzw. Neigung, Treppe An-/Austritt, Gelände-Profilpunkte (falls Modell es erlaubt); ein Undo-Schritt je Zug, Fang + Tab-Eingabe wie im Grundriss. · L
- ○ **[186]** Schatten (12.11., Maintainer): (1) 3D-Schatten stellenweise unscharf (Shadow-Map-Auflösung/Frustum zu gross, Filter) → Frustum auf Gebäude fitten bzw. Kaskaden, schärferer PCF; (2) Grundriss-Schatten fehlt unmittelbar am Haus (Lücke zwischen Fassade und Schatten; vermutlich Werfer ab ±0.00 statt ab Wandfuss/Gelände) → Schatten beginnt an der Fassade. Opus. · M
- ◐ **[185]** Navigation wie Archicad (12.11., Wunsch Maintainer). Umgesetzt (12.11.): Geschosswechsel im Grundriss
@@ -751,3 +750,4 @@ exakte Durchdringung, [61] Zuordnung per Hand, [63] Profil je Kante, [70] Fläch
halbe Handlaufbreite, IFC-Basismenge `CrossSectionArea`, Objekt-Info (Profil + Masse). Ohne Angabe Rundrohr wie bisher
(Netze bit-gleich). Offen: Profil am Treppentyp (nur am Element), Profil nur für Handlauf/Pfosten, Stäbe der
Absturzsicherung bleiben rund; in der App nicht geklickt
- **[189]** Panels neu ordnen + Einstellungsdialog (12.11.): Attribute-Panel nur noch Gestaltung (Stift, Linienenden, Bemassungs-Darstellung, Füllung); Typ/Aufbau/Masse/Raum/Dach/Treppe/Verweise, Achsraster, Schnittlinie und „Neues Bauteil" (Wandtyp des Werkzeugs) in der Objekt-Info als einklappbare Gruppen (`panels/objectInfo/groups.ts`, `InfoGroup.tsx`; Zustand in localStorage); die doppelte Maß-Anzeige (Ausdehnung X/Y) im Attribute-Panel entfällt. Taste T (rebindbar, `objectSettings`): Fenster/Tür → Öffnungs-Dialog, sonst Abschnitt der Objekt-Info aufgeklappt und fokussiert, ohne Auswahl bei Wand-/Decken-Werkzeug „Neues Bauteil"; macOS-Menü „Bearbeiten > Objekteinstellungen…" ohne Kürzel (ein nacktes T würde das Tippen abfangen). Wand/Decke/Dach/Treppe haben keinen eigenen Typ-Dialog (nur Objekt-Info). Offen: Menüpunkt in der Browser-Menüleiste; nicht in der Tauri-App geprüft. 12.11.
+104
View File
@@ -0,0 +1,104 @@
// [189] Attribute-Panel = nur Gestaltung, Bauteil-/BIM-Felder in der Objekt-Info; Taste T öffnet die
// Einstellungen des gewählten Objekts (Fenster/Tür: Dialog, sonst Abschnitt der Objekt-Info).
// Mit DOSSIER_SHOTS=<ordner> entstehen Screenshots für die Abnahme.
import { blurFocus, elementRows, expect, openSample, openTab, startNewProject, test } from "./app";
import type { Page } from "@playwright/test";
test.use({ deviceScaleFactor: 2 });
async function selectW1(page: Page): Promise<void> {
await openTab(page, "Elemente");
await elementRows(page).filter({ hasText: "W1" }).click();
await expect(page.getByText("Auswahl: 1 Wand")).toBeVisible();
await openTab(page, "Objekt-Info");
}
test("Wand gewählt: Attribute ohne Aufbau/Typ-Felder, Objekt-Info mit Wand-Abschnitt ([189])", async ({ page }) => {
await startNewProject(page);
await openSample(page);
await selectW1(page);
const attr = page.locator(".attr-panel");
const info = page.locator(".objinfo-panel");
// Gestaltung bleibt im Attribute-Panel.
await expect(attr.getByText("Strichstärke (mm)", { exact: true })).toBeVisible();
await expect(attr.getByText("Hintergrund", { exact: true })).toBeVisible();
// Bauteil-Felder sind dort weg …
await expect(attr.locator(".objinfo-wall-anchor")).toHaveCount(0);
await expect(attr.getByText("Volumen")).toHaveCount(0);
await expect(attr.getByText("Aufbau", { exact: false })).toHaveCount(0);
await expect(attr.getByText("Maße", { exact: true })).toHaveCount(0);
// … und in der Objekt-Info als einklappbarer Abschnitt.
const group = info.locator('[data-group="wall"]');
await expect(group.locator(".objinfo-wall-anchor").first()).toBeVisible();
await expect(group.getByText("Volumen")).toBeVisible();
// Einklappen blendet den Inhalt aus, Aufklappen holt ihn zurück.
const head = group.locator(".objinfo-group-head");
await head.click();
await expect(head).toHaveAttribute("aria-expanded", "false");
await expect(group.getByText("Volumen")).toHaveCount(0);
await head.click();
await expect(group.getByText("Volumen")).toBeVisible();
const shots = process.env.DOSSIER_SHOTS;
if (shots) {
await head.evaluate((el) => el.scrollIntoView({ block: "start" }));
await info.screenshot({ path: `${shots}/objekt-info-wand.png` });
await attr.screenshot({ path: `${shots}/attribute-wand.png` });
}
});
test("Taste T: Fenster gewählt → Einstellungsdialog ([189])", async ({ page }) => {
await startNewProject(page);
await openSample(page);
await openTab(page, "Elemente");
await elementRows(page).filter({ hasText: /Fenster/ }).first().click();
await blurFocus(page);
await expect(page.locator(".oed-dialog")).toHaveCount(0);
await page.keyboard.press("t");
await expect(page.locator(".oed-dialog")).toBeVisible();
});
test("Taste T: Wand gewählt → Wand-Abschnitt der Objekt-Info fokussiert und aufgeklappt ([189])", async ({ page }) => {
await startNewProject(page);
await openSample(page);
await selectW1(page);
const head = page.locator('[data-group="wall"] .objinfo-group-head');
await head.click(); // zuklappen
await expect(head).toHaveAttribute("aria-expanded", "false");
await blurFocus(page);
await page.keyboard.press("t");
await expect(head).toHaveAttribute("aria-expanded", "true");
await expect(head).toBeFocused();
await expect(page.locator(".oed-dialog")).toHaveCount(0);
});
test("Taste T ohne Auswahl bei Wand-Werkzeug: Typ des neuen Bauteils in der Objekt-Info ([189])", async ({ page }) => {
await startNewProject(page);
await openSample(page);
await openTab(page, "Objekt-Info");
await blurFocus(page);
await page.keyboard.press("6");
await blurFocus(page); // der Befehl holt den Fokus in die Befehlszeile
await page.keyboard.press("t");
await expect(page.locator('[data-group="newComponent"] .objinfo-group-head')).toBeFocused();
await expect(page.locator(".attr-panel").getByText("Neues Bauteil")).toHaveCount(0);
});
test("Taste T: in Textfeldern wirkungslos, ohne Auswahl und Werkzeug nichts ([189])", async ({ page }) => {
await startNewProject(page);
await openSample(page);
await openTab(page, "Elemente");
await elementRows(page).filter({ hasText: /Fenster/ }).first().click();
// Tippen im Befehlsfeld darf den Dialog nicht öffnen.
await page.locator(".cmdline-input").fill("t");
await page.locator(".cmdline-input").press("t");
await expect(page.locator(".oed-dialog")).toHaveCount(0);
// Auswahl leeren: T tut nichts.
await page.locator(".cmdline-input").fill("");
await blurFocus(page);
await page.keyboard.press("Escape");
await page.keyboard.press("t");
await expect(page.locator(".oed-dialog")).toHaveCount(0);
});
+12
View File
@@ -59,9 +59,11 @@ import { useProjectActions } from "./state/useProjectActions";
import { useCommandEngineHost } from "./state/useCommandEngineHost";
import { TRANSFORM_COMMANDS, useToolInput } from "./state/useToolInput";
import { useSelectionCommands } from "./state/useSelectionCommands";
import { openObjectSettings } from "./state/objectSettings";
import {
useActiveToolKeys,
useElementClipboardShortcut,
useObjectSettingsShortcut,
useUndoRedoShortcut,
} from "./state/useKeyboardShortcuts";
import { useProjectFileActions } from "./state/useProjectFileActions";
@@ -494,8 +496,18 @@ export default function App() {
pa,
});
// [189] Taste T / Menü „Objekteinstellungen…": Öffnungs-Dialog bzw. Objekt-Info (state/objectSettings.ts).
const openSettingsOfObject = () =>
openObjectSettings({
activeTool,
openOpeningEditor: setOpeningEditorId,
revealObjectInfo: () => setLayout((l) => revealPanel(l, "object-info")),
});
useObjectSettingsShortcut(shortcutOverrides, engineRef, openSettingsOfObject);
// Native macOS-Menüleiste → state/useNativeMenu.ts.
useNativeMenu({
onObjectSettings: openSettingsOfObject,
files,
notify,
undo,
+4 -5
View File
@@ -147,6 +147,7 @@ export const de = {
"menu.native.move": "Bewegen",
"menu.native.mirror": "Spiegeln",
"menu.native.rotate": "Drehen",
"menu.native.objectSettings": "Objekteinstellungen…",
"menu.native.view": "Ansicht",
"menu.native.window": "Fenster",
"menu.native.panels": "Panels",
@@ -432,11 +433,6 @@ export const de = {
"attr.source.layer": "Nach Ebene",
"attr.source.object": "Nach Bauteil",
"attr.source.custom": "eigener Wert",
"attr.size": "Maße",
"attr.width": "Breite",
"attr.height": "Höhe",
"attr.extentX": "Ausdehnung X",
"attr.extentY": "Ausdehnung Y",
// Objekt-Info-Palette (ObjectInfoPanel)
"objinfo.title": "Objekt-Info",
@@ -931,6 +927,8 @@ export const de = {
"objinfo.room.editStamp": "Stempel bearbeiten …",
// ── Extrusions-Attribute (truck-Integration, Object-Info-Panel) ─────────
"objinfo.sectionLine.section": "Schnittlinie",
"objinfo.dimText.section": "Masszahl",
"objinfo.group.toggle": "Abschnitt ein-/ausklappen",
"objinfo.detailRef.section": "Detail-/Schnitt-Verweis",
"objinfo.dimRefs.section": "Assoziative Bemassung",
"objinfo.dimRefs.point": "Punkt {n}",
@@ -3073,6 +3071,7 @@ export const de = {
"shortcut.floorDown": "Geschoss tiefer",
"shortcut.floorUp": "Geschoss höher",
"shortcut.showSelection3d": "Auswahl in 3D zeigen (ohne Auswahl: alles)",
"shortcut.objectSettings": "Einstellungen des gewählten Objekts öffnen (ohne Auswahl: Werkzeug-Voreinstellung)",
"shortcut.hideSelection3d": "Auswahl im 3D ausblenden",
"settings.section.update": "Update",
+4 -5
View File
@@ -145,6 +145,7 @@ export const en: Record<TranslationKey, string> = {
"menu.native.move": "Move",
"menu.native.mirror": "Mirror",
"menu.native.rotate": "Rotate",
"menu.native.objectSettings": "Object Settings…",
"menu.native.view": "View",
"menu.native.window": "Window",
"menu.native.panels": "Panels",
@@ -430,11 +431,6 @@ export const en: Record<TranslationKey, string> = {
"attr.source.layer": "By layer",
"attr.source.object": "By component",
"attr.source.custom": "Custom",
"attr.size": "Size",
"attr.width": "Width",
"attr.height": "Height",
"attr.extentX": "Extent X",
"attr.extentY": "Extent Y",
// Objekt-Info-Palette (ObjectInfoPanel)
"objinfo.title": "Object Info",
@@ -927,6 +923,8 @@ export const en: Record<TranslationKey, string> = {
"objinfo.room.editStamp": "Edit stamp …",
// ── Extruded solid attributes (truck integration, object info panel) ────
"objinfo.sectionLine.section": "Section line",
"objinfo.dimText.section": "Dimension text",
"objinfo.group.toggle": "Expand/collapse section",
"objinfo.detailRef.section": "Detail/section reference",
"objinfo.dimRefs.section": "Associative dimension",
"objinfo.dimRefs.point": "Point {n}",
@@ -3060,6 +3058,7 @@ export const en: Record<TranslationKey, string> = {
"shortcut.floorDown": "Story down",
"shortcut.floorUp": "Story up",
"shortcut.showSelection3d": "Show selection in 3D (no selection: everything)",
"shortcut.objectSettings": "Open settings of the selected object (no selection: tool defaults)",
"shortcut.hideSelection3d": "Hide selection in 3D",
"settings.section.update": "Update",
+6
View File
@@ -51,6 +51,8 @@ export interface NativeAppMenuHandlers {
onMove: () => void;
onMirror: () => void;
onRotate: () => void;
/** [189] Einstellungen des gewählten Objekts (Taste T; als Menüpunkt ohne Kürzel, ein nacktes „T" würde das Tippen in Textfeldern abfangen). */
onObjectSettings?: () => void;
onViewType: (v: ViewType) => void;
onView3d: (v: View3d) => void;
@@ -287,6 +289,10 @@ export function useNativeAppMenu(
text: t("menu.native.rotate"),
action: () => handlersRef.current.onRotate(),
}),
await MenuItem.new({
text: t("menu.native.objectSettings"),
action: () => handlersRef.current.onObjectSettings?.(),
}),
await PredefinedMenuItem.new({ item: "Separator" }),
await MenuItem.new({
text: t("menu.native.clashCheck"),
+12 -172
View File
@@ -3,6 +3,10 @@
// ersten selektierten Elements und erlaubt das direkte Bearbeiten (Farbe,
// Strichstärke, Füllschraffur).
//
// [189] NUR Gestaltung: Stift, Linienenden, Bemassungs-Darstellung, Füllung. Alles Bauteil-/BIM-Bezogene (Typ,
// Aufbau, Masse, Raumdaten, Dach-/Treppen-Parameter, Achsraster, Schnittlinie …) liegt in der Objekt-Info
// (`ObjectInfoPanel`, Abschnitte in `objectInfo/`); welcher Abschnitt wohin gehört, hält `objectInfo/groups.ts`.
//
// Vordergrund/Hintergrund/Strichstärke/Schraffur tragen je einen 3-Optionen-
// Quellen-Dropdown: „Nach Ebene" (die LayerCategory erzwingt den Wert), „Nach
// Bauteil" (erbt vom Component-Manager, heutiges Default-Verhalten) oder
@@ -25,10 +29,9 @@
import { Fragment } from "react";
import { useSelectionInfo } from "../state/useSelectionInfo";
import { useStore } from "../state/appStore";
import { attrGroups } from "./objectInfo/groups";
import type { ReactNode } from "react";
import { t } from "../i18n";
import { formatM, wallTypeLabel } from "../model/types";
import { fmtLength, unitsForLevel } from "../tools/displayUnits";
import { PEN_WEIGHTS } from "../model/types";
import type { AttributeSource } from "../model/types";
import { usePanelHost } from "./host";
@@ -40,20 +43,6 @@ import type { EndMark } from "../model/types";
/** Auswahl der Linienenden (Reihenfolge = Anzeige im Dropdown). */
const END_MARK_OPTIONS: EndMark[] = ["none", "arrow", "arrowOpen", "dot", "tick", "square"];
// Element-spezifische Attribut-Abschnitte (Wand/Decke/Öffnung/Treppe/Raum) —
// aus ObjectInfoPanel hierher verschoben (Ribbon Phase 3: ObjectInfo trägt nur
// noch Bezugspunkt + Masse).
import { WallSection } from "./objectInfo/WallSection";
import { CeilingSection } from "./objectInfo/CeilingSection";
import { RoofSection } from "./objectInfo/RoofSections";
import { OpeningSection } from "./objectInfo/OpeningSections";
import { StairSection } from "./objectInfo/StairSection";
import { RoomSection } from "./objectInfo/RoomSection";
import { ExtrudedSolidSection, ColumnSection } from "./objectInfo/SolidSections";
import { SectionLineSection } from "./objectInfo/SectionLineSection";
import { DetailRefSection, DimRefsSection, DimTextSection } from "./objectInfo/RefSections";
import { SurfacePatternPlacement } from "./SurfacePatternPlacement";
/** UI-Zustand des 3-Optionen-Quellen-Dropdowns (nicht 1:1 das Modell-Feld:
* „custom" ist abgeleitet aus „ist ein expliziter Wert gesetzt?", nicht
* selbst gespeichert). */
@@ -79,54 +68,16 @@ export function AttributesPanel() {
const project = useStore((s) => s.project);
const sel = useSelectionInfo();
// Wandtyp-/Deckentyp-Wahl für das NEUE Bauteil (was gezeichnet wird) — früher
// in der Werkzeug-Sidebar (ToolsPanel), seit deren Entfernung hier. Erscheint
// nur bei aktivem Wand-/Decken-Werkzeug (unabhängig von einer Auswahl); Wand und
// Decke teilen sich denselben Aufbau-Typ (WallType) + Host-State.
const drawingComponent =
host.activeTool === "wall" || host.activeTool === "ceiling";
const typeSection = drawingComponent ? (
<>
<div className="attr-section-label">{t("attr.newComponent")}</div>
<div className="attr-grid">
<span className="attr-key">
{t(host.activeTool === "wall" ? "tool.wallType" : "tool.ceilingType")}
</span>
<span className="attr-val">
<Dropdown
value={host.activeWallTypeId}
disabled={!host.toolsEnabled}
onChange={(v) => host.onActiveWallTypeId(v)}
options={project.wallTypes.map((wt) => ({
value: wt.id,
label: wallTypeLabel(wt, project.components),
title: wt.name,
}))}
/>
</span>
</div>
</>
) : null;
// Leerzustand: der Typ-Picker (falls ein Bauteil-Werkzeug aktiv ist), sonst ein
// kompakter Hinweis.
// Leerzustand: Hinweis. (Typ des neuen Bauteils und Schnittlinie liegen seit [189] in der Objekt-Info.)
if (sel === null) {
// Schnitt-/Ansichtslinie ist kein Projekt-Bauteil (kein `selection`) — sie
// kommt über host.sectionLine und wird hier im „Leerzustand" bearbeitet.
return (
<div className="attr-panel">
{typeSection}
{host.sectionLine && <SectionLineSection level={host.sectionLine} host={host} />}
{!typeSection && !host.sectionLine && (
<div className="attr-empty">{t("attr.empty")}</div>
)}
<div className="attr-empty">{t("attr.empty")}</div>
</div>
);
}
const isDrawing = sel.kind === "drawing2d";
const sheetUnits = unitsForLevel(project.drawingLevels.find((z) => z.id === sel.floorId));
const sizeText = (m: number): string => (sheetUnits.perMeter === 1 ? formatM(m) : `${fmtLength(sheetUnits, m).replace(/mm$/, "")} mm`);
// Strichstärke: Wand/Decke/Stütze/Drawing2D tragen einen eigenen Override
// (`strokeWeight`/`weightMm`) + Quellen-Dropdown; andere Elementarten erben
// stets aus der Kategorie (kein Setter im Kontrakt → nicht editierbar).
@@ -262,14 +213,10 @@ export function AttributesPanel() {
? project.lineStyles.find((l) => l.id === drawing.lineStyleId)
: undefined;
const bboxW = sel.bbox.maxX - sel.bbox.minX;
const bboxH = sel.bbox.maxY - sel.bbox.minY;
const isModelElement = !!(sel.wall || sel.ceiling || sel.roof || sel.stair || sel.room);
const groups = attrGroups({ sel, openEnds: openEndsShape, isDimension: drawing?.geom.shape === "dimension" });
return (
<div className="attr-panel">
{/* Typ-Picker für das neue Bauteil (nur bei aktivem Wand-/Decken-Werkzeug). */}
{typeSection}
{/* EIN durchgehendes Grid über alle Sektionen — dieselben zwei Spalten
(Label | Wert) für Stift/Füllung/Maße, damit die Wertfelder überall
bündig in EINER Spalte stehen. Sektion-Balken spannen beide Spalten. */}
@@ -451,7 +398,7 @@ export function AttributesPanel() {
Nur bei OFFENEN 2D-Formen und beim Text mit Hinweislinie —
geschlossene Formen haben keine Enden. Grösse in Papier-mm
(massstabsunabhängig, wie die Bemassungswerte). */}
{openEndsShape && (
{groups.includes("ends") && (
<>
<div className="attr-section-label">{t("attr.ends.section")}</div>
{(
@@ -499,83 +446,7 @@ export function AttributesPanel() {
(Modellmass, s. `model/dimension.ts`); leer/0 fällt auf den
Standard zurück. Die Masszahl selbst wird direkt im Plan am
eigenen Griff verschoben (rastet nahe der Standardlage ein). */}
{drawing?.geom.shape === "grid" && (() => {
const fmtAxis = (v: number) => (Math.round(v * 100) / 100).toString();
const geom = drawing.geom as Extract<typeof drawing.geom, { shape: "grid" }>;
const here = geom.levels?.includes(drawing.levelId) && geom.levels.length === 1;
return (
<>
<div className="attr-section-label">{t("attr.grid.section")}</div>
<span className="attr-key">{t("attr.grid.bubbles")}</span>
<span className="attr-val">
<select value={geom.bubbles ?? "both"} onChange={(e) => host.onSetGridProps(drawing.id, { bubbles: e.target.value as "start" | "end" | "both" })}>
<option value="both">{t("attr.grid.bubbles.both")}</option>
<option value="start">{t("attr.grid.bubbles.start")}</option>
<option value="end">{t("attr.grid.bubbles.end")}</option>
</select>
</span>
<span className="attr-key">{t("attr.grid.extend")}</span>
<span className="attr-val">
<input className="attr-num" style={{ width: 72 }} type="number" step={0.1} min={0} value={geom.extend ?? 1.5}
onChange={(e) => { const v = Number(e.target.value); if (Number.isFinite(v) && v >= 0) host.onSetGridProps(drawing.id, { extend: v }); }} />
</span>
<span className="attr-key">{t("attr.grid.bubbleMm")}</span>
<span className="attr-val">
<input className="attr-num" style={{ width: 72 }} type="number" step={0.5} min={2} value={geom.bubbleMm ?? 5}
onChange={(e) => { const v = Number(e.target.value); if (Number.isFinite(v) && v >= 2) host.onSetGridProps(drawing.id, { bubbleMm: v }); }} />
</span>
<span className="attr-key">{t("attr.grid.show3d")}</span>
<span className="attr-val">
<input type="checkbox" checked={geom.show3d === true} onChange={(e) => host.onSetGridProps(drawing.id, { show3d: e.target.checked })} />
</span>
{(["a", "b"] as const).map((list) =>
geom[list].map((ax, i) => (
<Fragment key={`${list}${i}`}>
<span className="attr-key">{t(geom.radial ? (list === "a" ? "attr.grid.ray" : "attr.grid.ring") : "attr.grid.axis", { pos: fmtAxis(ax.pos) })}</span>
<span className="attr-val" data-testid="grid-axis-row">
<input
className="attr-num"
style={{ width: 56 }}
type="text"
aria-label={t("attr.grid.axisLabel")}
value={ax.label}
onChange={(e) => host.onSetGridProps(drawing.id, { [list]: geom[list].map((x, k) => (k === i ? { ...x, label: e.target.value } : x)) })}
/>
<select
aria-label={t("attr.grid.axisBubble")}
value={ax.bubble ?? ""}
onChange={(e) => {
const v = e.target.value as "" | "start" | "end" | "both";
host.onSetGridProps(drawing.id, {
[list]: geom[list].map((x, k) => {
if (k !== i) return x;
const { bubble: _old, ...rest } = x;
return v ? { ...rest, bubble: v } : rest;
}),
});
}}
>
<option value="">{t("attr.grid.axisBubble.grid")}</option>
<option value="both">{t("attr.grid.bubbles.both")}</option>
<option value="start">{t("attr.grid.bubbles.start")}</option>
<option value="end">{t("attr.grid.bubbles.end")}</option>
</select>
</span>
</Fragment>
)),
)}
<span className="attr-key">{t("attr.grid.levels")}</span>
<span className="attr-val">
<select value={here ? "here" : "all"} onChange={(e) => host.onSetGridProps(drawing.id, { levels: e.target.value === "here" ? [drawing.levelId] : undefined })}>
<option value="all">{t("attr.grid.levels.all")}</option>
<option value="here">{t("attr.grid.levels.here")}</option>
</select>
</span>
</>
);
})()}
{drawing?.geom.shape === "dimension" && (
{groups.includes("dimension") && drawing?.geom.shape === "dimension" && (
<>
<div className="attr-section-label">{t("attr.dim.section")}</div>
{/* Abstände/Grössen in PAPIER-mm (massstabsunabhängig, wie die
@@ -618,7 +489,7 @@ export function AttributesPanel() {
also massstabsunabhängig. Leer gelassen (0) = Standard: Mass-
und Hilfslinie erben die Elementstärke, der Massstrich wird
doppelt so dick gezeichnet. */}
{drawing?.geom.shape === "dimension" &&
{groups.includes("dimension") && drawing?.geom.shape === "dimension" &&
(
[
["lineWeightMm", "attr.dim.lineWeight"],
@@ -657,7 +528,7 @@ export function AttributesPanel() {
Nach Bauteil (erbt vom Component-Manager, Default) / eigener Wert.
Eine Layout-Annotation kennt keine Füllung (nur Umriss) — Sektion
entfällt komplett statt drei bedeutungslose Dropdowns zu zeigen. */}
{(
{groups.includes("fill") && (
<>
<div className="attr-section-label">{t("attr.fill")}</div>
@@ -838,38 +709,7 @@ export function AttributesPanel() {
)}
</>
)}
{/* ── Masse (informativ, aus der bbox) — auf einem Layout-Blatt in Papier-mm ([93]). */}
{/* Bauteile: die bbox ist der GRUNDRISS-Umriss (X/Y), keine Höhe — als
„Ausdehnung X/Y" beschriften (Nutzer-Report: Fenster zeigte „Höhe
0.34 m" = Wanddicke). Öffnungen tragen Breite/Höhe im eigenen
Abschnitt, dort entfällt die bbox ganz. */}
{!sel.opening && (
<>
<div className="attr-section-label">{t("attr.size")}</div>
<span className="attr-key">{t(isModelElement ? "attr.extentX" : "attr.width")}</span>
<span className="attr-val attr-readonly">{sizeText(bboxW)}</span>
<span className="attr-key">{t(isModelElement ? "attr.extentY" : "attr.height")}</span>
<span className="attr-val attr-readonly">{sizeText(bboxH)}</span>
</>
)}
</div>
{/* Element-spezifische Abschnitte (aus ObjectInfo hierher verschoben) —
nur der jeweils passende erscheint. Nutzen weiter die `objinfo-*`-
Darstellung + die Host-Handler. */}
{sel.wall && <WallSection wall={sel.wall} host={host} />}
{sel.ceiling && <CeilingSection ceiling={sel.ceiling} host={host} />}
{sel.roof && <RoofSection roof={sel.roof} host={host} />}
{(sel.wall || sel.roof) && <SurfacePatternPlacement kind={sel.wall ? "wall" : "roof"} id={sel.id} host={host} />}
{sel.opening && <OpeningSection opening={sel.opening} host={host} />}
{sel.stair && <StairSection stair={sel.stair} host={host} />}
{sel.room && <RoomSection room={sel.room} roomId={sel.id} host={host} />}
{sel.extrudedSolid && <ExtrudedSolidSection solid={sel.extrudedSolid} host={host} />}
{sel.column && <ColumnSection column={sel.column} host={host} />}
{sel.detailRef && <DetailRefSection detailRef={sel.detailRef} drawingId={sel.id} host={host} />}
{sel.dimRefs && <DimRefsSection refs={sel.dimRefs} drawingId={sel.id} host={host} />}
{sel.dimTextMoved && <DimTextSection drawingId={sel.id} host={host} />}
</div>
);
}
+10 -8
View File
@@ -14,8 +14,9 @@
// Bezeichner englisch, UI-Text/Kommentare deutsch (CONVENTIONS.md). Alle sichtbaren
// Texte über t(...).
//
// [165] Die Abschnitte (Wand, Decke, Dach, Treppe …) liegen in `objectInfo/`; `AttributesPanel` ruft sie
// von dort, das Panel selbst nur Baum, Messwerte und die gemeinsamen Felder.
// [165] Die Abschnitte (Wand, Decke, Dach, Treppe …) liegen in `objectInfo/`. [189] Sie erscheinen hier als
// einklappbare Gruppen (`objectInfo/InfoGroups.tsx`; Zuordnung in `objectInfo/groups.ts`) — das Attribute-Panel
// zeigt nur noch Gestaltung. Das Panel selbst hält Baum, Messwerte und die gemeinsamen Felder.
import { useSelectionInfo } from "../state/useSelectionInfo";
import { lengthFromDisplay, lengthToDisplay, unitsForLevel, xToDisplay, yFromDisplay, yToDisplay } from "../tools/displayUnits";
@@ -32,6 +33,7 @@ import { SiteRulesSection } from "./SiteRulesSection";
import { TreeSection } from "./objectInfo/TreeSection";
import { ViewShadowsInfo, MeasurementSection } from "./objectInfo/InfoBlocks";
import { DimensionField, RotateField } from "./objectInfo/fields";
import { InfoGroups, hasInfoGroups } from "./objectInfo/InfoGroups";
// ── Bezugspunkt-Raster ───────────────────────────────────────────────────────
// Neun Anker als 3×3-Raster. Zeile 0 = oben (fy=0), Spalte 0 = links (fx=0).
@@ -94,9 +96,11 @@ export function ObjectInfoPanel() {
);
}
if (sel === null) {
const groups = hasInfoGroups(null, undefined, host);
return (
<div className="objinfo-panel">
{m ? <MeasurementSection m={m} /> : <div className="objinfo-empty">{t("objinfo.empty")}</div>}
{m ? <MeasurementSection m={m} /> : !groups && <div className="objinfo-empty">{t("objinfo.empty")}</div>}
<InfoGroups sel={null} drawing={undefined} host={host} />
</div>
);
}
@@ -141,8 +145,7 @@ export function ObjectInfoPanel() {
<div className="objinfo-panel">
{m && <MeasurementSection m={m} />}
{/* Kopfzeile: Typ + editierbare Klasse (Grafik-Kategorie) + Zeichnungsebene
(VW-Muster „Klasse"/„Ebene"). Die element-spezifischen Attribut-
Abschnitte (Wand/Decke/Öffnung/Treppe/Raum) liegen im Attribute-Panel. */}
(VW-Muster „Klasse"/„Ebene"). */}
<div className="objinfo-head">
<span className="objinfo-kind">{t(`objinfo.kind.${sel.kind}`)}</span>
</div>
@@ -370,9 +373,8 @@ export function ObjectInfoPanel() {
)}
</>
)}
{/* Die element-spezifischen Abschnitte (Wand/Decke/Öffnung/Treppe/Raum)
werden jetzt im Attribute-Panel gerendert (AttributesPanel importiert
die exportierten *Section-Komponenten). */}
{/* [189] Bauteil-/BIM-Abschnitte (Wand, Decke, Öffnung, Treppe, Raum …) als einklappbare Gruppen. */}
<InfoGroups sel={sel} drawing={rawDrawing} host={host} />
</div>
);
}
+1 -1
View File
@@ -20,7 +20,7 @@ Kern; hier stehen Eingabe und Darstellung. Zustand über den Store (`src/state`)
| Datei | Inhalt |
|---|---|
| `ToolsPanel.tsx`, `AttributesPanel.tsx`, `ObjectInfoPanel.tsx` | Werkzeug-Palette, Attribute, Objekt-Info der Auswahl (`ContextObjectProps.tsx`, `UValueRow.tsx`, `SurfacePatternPlacement.tsx` sind Teile davon) |
| `objectInfo/*.tsx` | Abschnitte je Element-Art (`WallSection`, `CeilingSection`, `RoofSections`, `OpeningSections`, `StairSection`, `RoomSection`, `SolidSections`, `SectionLineSection`, `RefSections`, `TreeSection`), gemeinsame Felder (`fields.tsx`) und Info-Blöcke (`InfoBlocks.tsx`); `AttributesPanel` und `ObjectInfoPanel` rufen sie (`[165]`) |
| `objectInfo/*.tsx` | Abschnitte je Element-Art (`WallSection`, `CeilingSection`, `RoofSections`, `OpeningSections`, `StairSection`, `RoomSection`, `SolidSections`, `SectionLineSection`, `RefSections`, `TreeSection`), gemeinsame Felder (`fields.tsx`) und Info-Blöcke (`InfoBlocks.tsx`); `ObjectInfoPanel` zeigt sie als einklappbare Gruppen (`InfoGroups.tsx`, `InfoGroup.tsx`, Zustand `infoGroupState.ts`); `groups.ts` hält die Zuordnung (Attribute = nur Gestaltung, Objekt-Info = Bauteil/BIM) und das Ziel der Taste T (`[189]`) |
| `DrawingLevelsPanel.tsx`, `LayersPanel.tsx`, `ElementTreePanel.tsx` | Zeichnungsebenen, Ebenen, Baum Geschoss → Bauteilklasse → Element |
| `LayoutsPanel.tsx`, `PublishSection.tsx`, `ViewSnapshotsPanel.tsx` | Layouts als Baum, Publikationssätze (`[79]`), gespeicherte Ansichten |
| `RoomBalancePanel.tsx` | Flächenbilanz mit den Abschnitten `AreaTableSection.tsx`, `KennzahlenSection.tsx`, `ProgramCompareSection.tsx`, `ElementScheduleSection.tsx`, `OpeningScheduleSection.tsx`, `RoomBookSection.tsx`; Stempel-Editor `RoomStampEditor.tsx` |
+119
View File
@@ -0,0 +1,119 @@
// Abschnitt „Achsraster" der Objekt-Info ([189], früher im Attribute-Panel): Blasen, Verlängerung, Achsnamen,
// 3D-Anzeige und Geschoss-Gültigkeit eines gewählten Rasters.
import { Fragment, type ReactNode } from "react";
import { t } from "../../i18n";
import type { Drawing2D } from "../../model/types";
import type { usePanelHost } from "../host";
type GridGeom = Extract<Drawing2D["geom"], { shape: "grid" }>;
type Bubble = "start" | "end" | "both";
const numProps = { className: "objinfo-text", style: { width: 72 }, type: "number" } as const;
export function GridSection({ drawing, host }: { drawing: Drawing2D; host: ReturnType<typeof usePanelHost> }) {
if (drawing.geom.shape !== "grid") return null;
const geom: GridGeom = drawing.geom;
const fmtAxis = (v: number) => (Math.round(v * 100) / 100).toString();
const here = geom.levels?.includes(drawing.levelId) && geom.levels.length === 1;
const set = (patch: Parameters<typeof host.onSetGridProps>[1]) => host.onSetGridProps(drawing.id, patch);
const row = (label: string, control: ReactNode, testId?: string) => (
<div className="objinfo-field" data-testid={testId}>
<span className="objinfo-flabel">{label}</span>
{control}
</div>
);
return (
<>
<div className="objinfo-sep" />
<div className="objinfo-section-label">{t("attr.grid.section")}</div>
{row(
t("attr.grid.bubbles"),
<select value={geom.bubbles ?? "both"} onChange={(e) => set({ bubbles: e.target.value as Bubble })}>
<option value="both">{t("attr.grid.bubbles.both")}</option>
<option value="start">{t("attr.grid.bubbles.start")}</option>
<option value="end">{t("attr.grid.bubbles.end")}</option>
</select>,
)}
{row(
t("attr.grid.extend"),
<input
{...numProps}
step={0.1}
min={0}
value={geom.extend ?? 1.5}
onChange={(e) => {
const v = Number(e.target.value);
if (Number.isFinite(v) && v >= 0) set({ extend: v });
}}
/>,
)}
{row(
t("attr.grid.bubbleMm"),
<input
{...numProps}
step={0.5}
min={2}
value={geom.bubbleMm ?? 5}
onChange={(e) => {
const v = Number(e.target.value);
if (Number.isFinite(v) && v >= 2) set({ bubbleMm: v });
}}
/>,
)}
{row(
t("attr.grid.show3d"),
<input type="checkbox" checked={geom.show3d === true} onChange={(e) => set({ show3d: e.target.checked })} />,
)}
{(["a", "b"] as const).map((list) =>
geom[list].map((ax, i) => (
<Fragment key={`${list}${i}`}>
{row(
t(geom.radial ? (list === "a" ? "attr.grid.ray" : "attr.grid.ring") : "attr.grid.axis", { pos: fmtAxis(ax.pos) }),
<span style={{ display: "flex", gap: 4 }}>
<input
className="objinfo-text"
style={{ width: 56 }}
type="text"
aria-label={t("attr.grid.axisLabel")}
value={ax.label}
onChange={(e) => set({ [list]: geom[list].map((x, k) => (k === i ? { ...x, label: e.target.value } : x)) })}
/>
<select
aria-label={t("attr.grid.axisBubble")}
value={ax.bubble ?? ""}
onChange={(e) => {
const v = e.target.value as "" | Bubble;
set({
[list]: geom[list].map((x, k) => {
if (k !== i) return x;
const { bubble: _old, ...rest } = x;
return v ? { ...rest, bubble: v } : rest;
}),
});
}}
>
<option value="">{t("attr.grid.axisBubble.grid")}</option>
<option value="both">{t("attr.grid.bubbles.both")}</option>
<option value="start">{t("attr.grid.bubbles.start")}</option>
<option value="end">{t("attr.grid.bubbles.end")}</option>
</select>
</span>,
"grid-axis-row",
)}
</Fragment>
)),
)}
{row(
t("attr.grid.levels"),
<select
value={here ? "here" : "all"}
onChange={(e) => set({ levels: e.target.value === "here" ? [drawing.levelId] : undefined })}
>
<option value="all">{t("attr.grid.levels.all")}</option>
<option value="here">{t("attr.grid.levels.here")}</option>
</select>,
)}
</>
);
}
+35
View File
@@ -0,0 +1,35 @@
// [189] Einklappbarer Abschnitt der Objekt-Info: Kopfzeile (Knopf mit Pfeil) und Inhalt. Die Abschnitts-
// Komponenten (`WallSection` …) bringen ihre eigene Kopf-Trennlinie mit; die erste blendet das CSS im Rumpf aus.
import { useEffect, useRef, useSyncExternalStore, type ReactNode } from "react";
import { t } from "../../i18n";
import { INFO_GROUP_TITLE, type InfoGroupId } from "./groups";
import { clearInfoGroupFocus, getInfoGroupState, subscribeInfoGroups, toggleInfoGroup } from "./infoGroupState";
export function InfoGroup({ id, children }: { id: InfoGroupId; children: ReactNode }) {
const st = useSyncExternalStore(subscribeInfoGroups, getInfoGroupState);
const open = !st.collapsed.has(id);
const head = useRef<HTMLButtonElement>(null);
useEffect(() => {
if (st.focus?.id !== id) return;
head.current?.scrollIntoView?.({ block: "nearest" });
head.current?.focus();
clearInfoGroupFocus();
}, [st.focus, id]);
return (
<section className="objinfo-group" data-group={id} data-open={open}>
<button
ref={head}
type="button"
className="objinfo-group-head"
aria-expanded={open}
title={t("objinfo.group.toggle")}
onClick={() => toggleInfoGroup(id)}
>
<span className="objinfo-group-chev" aria-hidden="true">{open ? "▾" : "▸"}</span>
{t(INFO_GROUP_TITLE[id])}
</button>
{open && <div className="objinfo-group-body">{children}</div>}
</section>
);
}
+66
View File
@@ -0,0 +1,66 @@
// [189] Die einklappbaren Bauteil-/BIM-Abschnitte der Objekt-Info (früher im Attribute-Panel): welche es für die
// Auswahl gibt, bestimmt `groups.ts`; hier werden sie gerendert. Gerufen von `ObjectInfoPanel`.
import type { ReactNode } from "react";
import type { Drawing2D } from "../../model/types";
import type { SelectionInfo } from "../../state/selectionInfo";
import type { usePanelHost } from "../host";
import { SurfacePatternPlacement } from "../SurfacePatternPlacement";
import { CeilingSection } from "./CeilingSection";
import { GridSection } from "./GridSection";
import { InfoGroup } from "./InfoGroup";
import { NewComponentSection } from "./NewComponentSection";
import { OpeningSection } from "./OpeningSections";
import { DetailRefSection, DimRefsSection, DimTextSection } from "./RefSections";
import { RoofSection } from "./RoofSections";
import { RoomSection } from "./RoomSection";
import { SectionLineSection } from "./SectionLineSection";
import { ColumnSection, ExtrudedSolidSection } from "./SolidSections";
import { StairSection } from "./StairSection";
import { WallSection } from "./WallSection";
import { infoGroups, type InfoGroupId } from "./groups";
type Host = ReturnType<typeof usePanelHost>;
function groupIds(sel: SelectionInfo | null, drawing: Drawing2D | undefined, host: Host): InfoGroupId[] {
return infoGroups({
sel,
isGrid: drawing?.geom.shape === "grid",
sectionLine: !!host.sectionLine,
newComponentTool: host.activeTool === "wall" || host.activeTool === "ceiling",
});
}
/** Ob für diese Auswahl mindestens ein Abschnitt erscheint. */
export function hasInfoGroups(sel: SelectionInfo | null, drawing: Drawing2D | undefined, host: Host): boolean {
return groupIds(sel, drawing, host).length > 0;
}
export function InfoGroups({ sel, drawing, host }: { sel: SelectionInfo | null; drawing: Drawing2D | undefined; host: Host }) {
const body = (id: InfoGroupId): ReactNode => {
switch (id) {
case "newComponent": return <NewComponentSection host={host} />;
case "sectionLine": return host.sectionLine ? <SectionLineSection level={host.sectionLine} host={host} /> : null;
case "wall": return sel?.wall ? <WallSection wall={sel.wall} host={host} /> : null;
case "ceiling": return sel?.ceiling ? <CeilingSection ceiling={sel.ceiling} host={host} /> : null;
case "roof": return sel?.roof ? <RoofSection roof={sel.roof} host={host} /> : null;
case "surfacePattern": return sel ? <SurfacePatternPlacement kind={sel.wall ? "wall" : "roof"} id={sel.id} host={host} /> : null;
case "opening": return sel?.opening ? <OpeningSection opening={sel.opening} host={host} /> : null;
case "stair": return sel?.stair ? <StairSection stair={sel.stair} host={host} /> : null;
case "room": return sel?.room ? <RoomSection room={sel.room} roomId={sel.id} host={host} /> : null;
case "extrudedSolid": return sel?.extrudedSolid ? <ExtrudedSolidSection solid={sel.extrudedSolid} host={host} /> : null;
case "column": return sel?.column ? <ColumnSection column={sel.column} host={host} /> : null;
case "detailRef": return sel?.detailRef ? <DetailRefSection detailRef={sel.detailRef} drawingId={sel.id} host={host} /> : null;
case "dimRefs": return sel?.dimRefs ? <DimRefsSection refs={sel.dimRefs} drawingId={sel.id} host={host} /> : null;
case "dimText": return sel ? <DimTextSection drawingId={sel.id} host={host} /> : null;
case "grid": return drawing ? <GridSection drawing={drawing} host={host} /> : null;
}
};
return (
<>
{groupIds(sel, drawing, host).map((id) => (
<InfoGroup key={id} id={id}>{body(id)}</InfoGroup>
))}
</>
);
}
@@ -0,0 +1,24 @@
// Abschnitt „Neues Bauteil" der Objekt-Info ([189], früher im Attribute-Panel): Aufbau-Typ für die nächste
// Wand bzw. Decke, solange das Wand-/Decken-Werkzeug aktiv ist. Wand und Decke teilen sich denselben Typ.
import { t } from "../../i18n";
import { wallTypeLabel } from "../../model/types";
import { useStore } from "../../state/appStore";
import { Dropdown } from "../../ui/Dropdown";
import type { usePanelHost } from "../host";
export function NewComponentSection({ host }: { host: ReturnType<typeof usePanelHost> }) {
const wallTypes = useStore((s) => s.project.wallTypes);
const components = useStore((s) => s.project.components);
return (
<div className="objinfo-field">
<span className="objinfo-flabel">{t(host.activeTool === "wall" ? "tool.wallType" : "tool.ceilingType")}</span>
<Dropdown
value={host.activeWallTypeId}
disabled={!host.toolsEnabled}
onChange={(v) => host.onActiveWallTypeId(v)}
options={wallTypes.map((wt) => ({ value: wt.id, label: wallTypeLabel(wt, components), title: wt.name }))}
/>
</div>
);
}
+75
View File
@@ -0,0 +1,75 @@
// [189] Zuordnung der Panels: Attribute zeigen nur Gestaltung, alles Bauteil-/BIM-Bezogene gehört in die Objekt-Info;
// Taste T öffnet für Fenster/Türen den Öffnungs-Dialog, sonst den passenden Abschnitt der Objekt-Info.
import { describe, expect, it } from "vitest";
import { buildComplexSampleProject } from "../../model/sampleProjectComplex";
import { deriveSelection } from "../../state/selectionInfo";
import { attrGroups, infoGroups, objectSettingsTarget, INFO_GROUP_TITLE, type InfoGroupId } from "./groups";
const p = buildComplexSampleProject();
const ctx = { isGrid: false, sectionLine: false, newComponentTool: false };
describe("Panel-Zuordnung [189]", () => {
it("Wand: Gestaltung in Attribute, Typ/Aufbau/Ansichtsschraffur in der Objekt-Info", () => {
const sel = deriveSelection(p, { walls: [p.walls[0].id] });
expect(sel?.wall).toBeTruthy();
expect(attrGroups({ sel, openEnds: false, isDimension: false })).toEqual(["stroke", "fill"]);
expect(infoGroups({ sel, ...ctx })).toEqual(["wall", "surfacePattern"]);
});
it("Fenster/Tür: nur die Objekt-Info trägt den Öffnungs-Abschnitt", () => {
const sel = deriveSelection(p, { openings: [p.openings![0].id] });
expect(infoGroups({ sel, ...ctx })).toEqual(["opening"]);
});
it("Decke, Raum, Treppe, Dach: je ein eigener Abschnitt der Objekt-Info", () => {
const cases: [string, Partial<Parameters<typeof deriveSelection>[1]>, InfoGroupId][] = [
["Decke", { ceilings: [p.ceilings?.[0].id] }, "ceiling"],
["Raum", { rooms: [p.rooms?.[0].id] }, "room"],
["Treppe", { stairs: [p.stairs?.[0]?.id] }, "stair"],
["Dach", { roofs: [p.roofs?.[0]?.id] }, "roof"],
] as never;
for (const [name, selection, group] of cases) {
const sel = deriveSelection(p, selection);
if (!sel) continue; // Beispielprojekt ohne dieses Element
expect(infoGroups({ sel, ...ctx }), name).toContain(group);
}
});
it("Attribute: ohne Auswahl nichts; Linienenden/Bemassung nur wo sie gelten", () => {
expect(attrGroups({ sel: null, openEnds: true, isDimension: true })).toEqual([]);
const sel = deriveSelection(p, { walls: [p.walls[0].id] });
expect(attrGroups({ sel, openEnds: true, isDimension: false })).toEqual(["stroke", "ends", "fill"]);
expect(attrGroups({ sel, openEnds: false, isDimension: true })).toEqual(["stroke", "dimension", "fill"]);
});
it("Werkzeug-Voreinstellung und Schnittlinie stehen ohne Auswahl in der Objekt-Info", () => {
expect(infoGroups({ sel: null, isGrid: false, sectionLine: false, newComponentTool: true })).toEqual(["newComponent"]);
expect(infoGroups({ sel: null, isGrid: false, sectionLine: true, newComponentTool: false })).toEqual(["sectionLine"]);
expect(infoGroups({ sel: null, ...ctx })).toEqual([]);
});
it("jede Gruppe hat einen Titel", () => {
const all: InfoGroupId[] = ["newComponent", "sectionLine", "wall", "ceiling", "roof", "surfacePattern", "opening", "stair", "room", "extrudedSolid", "column", "detailRef", "dimRefs", "dimText", "grid"];
for (const g of all) expect(INFO_GROUP_TITLE[g]).toBeTruthy();
});
});
describe("Taste T: Ziel [189]", () => {
it("Fenster/Tür öffnet den Öffnungs-Dialog", () => {
const sel = deriveSelection(p, { openings: [p.openings![0].id] });
expect(objectSettingsTarget(sel, "select")).toEqual({ kind: "opening", id: p.openings![0].id });
});
it("Wand öffnet den Wand-Abschnitt der Objekt-Info", () => {
const sel = deriveSelection(p, { walls: [p.walls[0].id] });
expect(objectSettingsTarget(sel, "select")).toEqual({ kind: "info", group: "wall" });
});
it("ohne Auswahl: Wand-/Decken-Werkzeug → Typ des neuen Bauteils, sonst nichts", () => {
expect(objectSettingsTarget(null, "wall")).toEqual({ kind: "info", group: "newComponent" });
expect(objectSettingsTarget(null, "ceiling")).toEqual({ kind: "info", group: "newComponent" });
expect(objectSettingsTarget(null, "select")).toBeNull();
expect(objectSettingsTarget(null, "line")).toBeNull();
});
});
+115
View File
@@ -0,0 +1,115 @@
// [189] Zuordnung der Panels: welche Abschnitte zeigt „Attribute" (nur Gestaltung: Stift, Linienenden,
// Bemassungs-Darstellung, Füllung) und welche die Objekt-Info (alles Bauteil-/BIM-bezogene: Typ, Aufbau, Masse,
// Raumdaten, Dach-/Treppen-Parameter, Verweise, Achsraster …). Rein, ohne React — der Test
// `groups.test.ts` hält die Aufteilung fest, `ObjectInfoPanel` und `AttributesPanel` richten sich danach.
import type { TranslationKey } from "../../i18n";
import type { SelectionInfo } from "../../state/selectionInfo";
/** Einklappbare Abschnitte der Objekt-Info (Reihenfolge = Anzeige). */
export type InfoGroupId =
| "newComponent"
| "sectionLine"
| "wall"
| "ceiling"
| "roof"
| "surfacePattern"
| "opening"
| "stair"
| "room"
| "extrudedSolid"
| "column"
| "detailRef"
| "dimRefs"
| "dimText"
| "grid";
export const INFO_GROUP_TITLE: Record<InfoGroupId, TranslationKey> = {
newComponent: "attr.newComponent",
sectionLine: "objinfo.sectionLine.section",
wall: "objinfo.wall.section",
ceiling: "objinfo.ceiling.section",
roof: "objinfo.roof.section",
surfacePattern: "objinfo.surfacePattern",
opening: "objinfo.opening.section",
stair: "objinfo.stair.section",
room: "objinfo.room.section",
extrudedSolid: "objinfo.extrudedSolid.section",
column: "objinfo.column.section",
detailRef: "objinfo.detailRef.section",
dimRefs: "objinfo.dimRefs.section",
dimText: "objinfo.dimText.section",
grid: "attr.grid.section",
};
export interface InfoGroupContext {
sel: SelectionInfo | null;
/** Gewählte 2D-Form ist ein Achsraster. */
isGrid: boolean;
/** Eine Schnitt-/Ansichtslinie ist gewählt (kein Projekt-Bauteil, daher nicht in `sel`). */
sectionLine: boolean;
/** Wand- oder Decken-Werkzeug aktiv: Typ für das NEUE Bauteil wählen. */
newComponentTool: boolean;
}
/** Abschnitte der Objekt-Info für die aktuelle Auswahl, in Anzeige-Reihenfolge. */
export function infoGroups(c: InfoGroupContext): InfoGroupId[] {
const out: InfoGroupId[] = [];
const { sel } = c;
if (c.newComponentTool) out.push("newComponent");
if (!sel) {
if (c.sectionLine) out.push("sectionLine");
return out;
}
if (sel.wall) out.push("wall");
if (sel.ceiling) out.push("ceiling");
if (sel.roof) out.push("roof");
if (sel.wall || sel.roof) out.push("surfacePattern");
if (sel.opening) out.push("opening");
if (sel.stair) out.push("stair");
if (sel.room) out.push("room");
if (sel.extrudedSolid) out.push("extrudedSolid");
if (sel.column) out.push("column");
if (sel.detailRef) out.push("detailRef");
if (sel.dimRefs) out.push("dimRefs");
if (sel.dimTextMoved) out.push("dimText");
if (c.isGrid) out.push("grid");
return out;
}
/** Abschnitte des Attribute-Panels: nur Gestaltung. */
export type AttrGroupId = "stroke" | "ends" | "dimension" | "fill";
export interface AttrGroupContext {
sel: SelectionInfo | null;
/** Offene 2D-Form (oder Text mit Hinweislinie): trägt Linienenden. */
openEnds: boolean;
/** Gewählte 2D-Form ist eine Masskette. */
isDimension: boolean;
}
export function attrGroups(c: AttrGroupContext): AttrGroupId[] {
if (!c.sel) return [];
const out: AttrGroupId[] = ["stroke"];
if (c.openEnds) out.push("ends");
if (c.isDimension) out.push("dimension");
out.push("fill");
return out;
}
/**
* Ziel der Taste T ([189], wie Archicad Cmd+T): Fenster/Tür → Öffnungs-Dialog; sonst der Abschnitt der
* Objekt-Info (fokussiert und aufgeklappt, `group: null` = nur das Panel); ohne Auswahl die Voreinstellung des
* aktiven Werkzeugs (Wand/Decke: Typ des neuen Bauteils), sonst nichts.
*/
export type ObjectSettingsTarget =
| { kind: "opening"; id: string }
| { kind: "info"; group: InfoGroupId | null }
| null;
export function objectSettingsTarget(sel: SelectionInfo | null, activeTool: string, isGrid = false): ObjectSettingsTarget {
if (!sel) return activeTool === "wall" || activeTool === "ceiling" ? { kind: "info", group: "newComponent" } : null;
if (sel.opening) return { kind: "opening", id: sel.id };
const first = infoGroups({ sel, isGrid, sectionLine: false, newComponentTool: false })[0];
return { kind: "info", group: first ?? null };
}
+73
View File
@@ -0,0 +1,73 @@
// [189] Zustand der einklappbaren Abschnitte der Objekt-Info: welche Abschnitte zugeklappt sind (je Viewer in
// localStorage) und die Anfrage „diesen Abschnitt aufklappen und fokussieren" (Taste T). Ausserhalb von React
// lesbar, damit der Tastendruck (`state/objectSettings.ts`) den Abschnitt auch öffnen kann, bevor das Panel
// montiert ist.
import type { InfoGroupId } from "./groups";
interface GroupState {
collapsed: ReadonlySet<string>;
/** Offene Fokus-Anfrage; die Gruppe löscht sie, sobald sie fokussiert hat. */
focus: { id: InfoGroupId } | null;
}
const KEY = "dossier.objinfo.collapsed";
function load(): ReadonlySet<string> {
try {
const raw = window.localStorage.getItem(KEY);
const arr: unknown = raw ? JSON.parse(raw) : [];
return new Set(Array.isArray(arr) ? arr.filter((x): x is string => typeof x === "string") : []);
} catch {
return new Set();
}
}
function save(c: ReadonlySet<string>): void {
try {
window.localStorage.setItem(KEY, JSON.stringify([...c]));
} catch {
// Bestes Bemühen (Quota/privates Fenster).
}
}
let state: GroupState = { collapsed: load(), focus: null };
const listeners = new Set<() => void>();
function set(next: GroupState): void {
state = next;
for (const l of [...listeners]) l();
}
export function subscribeInfoGroups(l: () => void): () => void {
listeners.add(l);
return () => listeners.delete(l);
}
export function getInfoGroupState(): GroupState {
return state;
}
export function toggleInfoGroup(id: InfoGroupId): void {
const c = new Set(state.collapsed);
if (!c.delete(id)) c.add(id);
save(c);
set({ ...state, collapsed: c });
}
/** Klappt den Abschnitt auf und bittet ihn, den Fokus zu nehmen (sobald er sichtbar ist). */
export function expandAndFocusInfoGroup(id: InfoGroupId): void {
const c = new Set(state.collapsed);
c.delete(id);
save(c);
set({ collapsed: c, focus: { id } });
}
export function clearInfoGroupFocus(): void {
if (state.focus) set({ ...state, focus: null });
}
/** Nur für Tests. */
export function resetInfoGroupsForTest(): void {
state = { collapsed: new Set(), focus: null };
}
+1
View File
@@ -48,6 +48,7 @@ in `ProjectSync`.
| `useDormerNotice.ts` | Gauben-Hinweis (in `ProjectSync`, abonniert nur Dächer und Projekt-Id) |
| `useMouseSelectionHandlers.ts` | Auswahl und Kontextmenü aus Grundriss und 3D |
| `useKeyboardShortcuts.ts`, `keyboardShortcuts.ts`, `commandKeys.ts` | Tastenkürzel, Esc/Enter laufender Befehle |
| `objectSettings.ts` | Taste T / Menü „Objekteinstellungen…" ([189]): Öffnungs-Dialog oder Abschnitt der Objekt-Info |
| `useDisplayResolvers.ts` | sichtbar, gedimmt, gesperrt je Ebene und Kategorie |
| `useTextTarget.ts`, `useSectionLineState.ts`, `useStatusBarInfo.ts` | Text-Ziel der Formatierleiste; Schnittlinie, 3D-Live-Schnitt; Status-Leiste (je mit schmalen Selektoren) |
| `usePanelHostBase.ts`, `panelHost/` | Host-Wert für die Panels: Zusammenbau aus Teil-Bauern je Bereich (`toolsHost`, `selectionStyleHost`, `elementAttributesHost`, `siteHost`, `viewSnapshotsHost` + `viewState`, `layoutsHost`); `stableHost.ts` hält die Identität fest (Handler als Trampoline), solange sich kein Wert-Feld ändert. Projekt und Objekt-Info kommen beim Bau aus dem Store; die Fassung hinter den Trampolinen wird bei geändertem Projekt/Auswahl erst beim Aufruf neu gebaut |
+4 -1
View File
@@ -52,7 +52,8 @@ export type ShortcutId =
| "floorDown"
| "floorUp"
| "showSelection3d"
| "hideSelection3d";
| "hideSelection3d"
| "objectSettings";
export type ShortcutCategory =
| "general"
@@ -214,6 +215,8 @@ export const SHORTCUT_DEFS: ShortcutDef[] = [
{ id: "floorUp", category: "navigation", labelKey: "shortcut.floorUp", defaultCombo: "mod+6" },
{ id: "showSelection3d", category: "navigation", labelKey: "shortcut.showSelection3d", defaultCombo: "mod+3" },
{ id: "hideSelection3d", category: "navigation", labelKey: "shortcut.hideSelection3d", defaultCombo: "mod+4" },
// [189] Einstellungsdialog des gewählten Objekts (Archicad Cmd+T), hier schlicht „t".
{ id: "objectSettings", category: "edit", labelKey: "shortcut.objectSettings", defaultCombo: "t", bareKeyOnly: true },
];
const DEFS_BY_ID = new Map<ShortcutId, ShortcutDef>(SHORTCUT_DEFS.map((d) => [d.id, d]));
+41
View File
@@ -0,0 +1,41 @@
// [189] Taste T (wie Archicad Cmd+T): Einstellungen des gewählten Objekts öffnen. Fenster/Tür → der Öffnungs-
// Dialog; alles andere → die Objekt-Info (Panel zeigen, passenden Abschnitt aufklappen und fokussieren);
// ohne Auswahl die Voreinstellung des aktiven Werkzeugs (Wand/Decke: Typ des neuen Bauteils), sonst nichts.
// Die Zuordnung Auswahl → Ziel ist rein (`panels/objectInfo/groups.ts::objectSettingsTarget`).
import { objectSettingsTarget } from "../panels/objectInfo/groups";
import { expandAndFocusInfoGroup } from "../panels/objectInfo/infoGroupState";
import { getState } from "./appStore";
import { selectionInfoFor } from "./useSelectionInfo";
export interface ObjectSettingsDeps {
/** Aktives Werkzeug (React-State der App). */
activeTool: string;
openOpeningEditor: (openingId: string) => void;
/** Objekt-Info-Panel sichtbar machen (Dock-Tab, schwebendes Fenster …). */
revealObjectInfo: () => void;
}
/** Öffnet die Einstellungen; `false`, wenn es nichts zu öffnen gibt. */
export function openObjectSettings(deps: ObjectSettingsDeps): boolean {
const { project, selection } = getState();
const sel = selectionInfoFor(project, selection);
let target = objectSettingsTarget(sel, deps.activeTool, isGridDrawing(sel?.kind === "drawing2d" ? sel.id : undefined));
// Baum, Lage-Darstellung und Schnittlinie sind keine `SelectionInfo`, haben aber ihre Felder in der Objekt-Info.
if (!target && (selection.trees.length > 0 || selection.site.length > 0 || selection.sectionLines.length > 0)) {
target = { kind: "info", group: selection.sectionLines.length > 0 ? "sectionLine" : null };
}
if (!target) return false;
if (target.kind === "opening") {
deps.openOpeningEditor(target.id);
return true;
}
if (target.group) expandAndFocusInfoGroup(target.group);
deps.revealObjectInfo();
return true;
}
function isGridDrawing(id: string | undefined): boolean {
if (!id) return false;
return getState().project.drawings2d.find((d) => d.id === id)?.geom.shape === "grid";
}
+27
View File
@@ -672,3 +672,30 @@ export function useViewNavigationShortcuts(overrides: ShortcutOverrides): void {
return () => window.removeEventListener("keydown", onKey);
}, [overrides]);
}
/**
* [189] Taste T (rebindbar, `objectSettings`): Einstellungen des gewählten Objekts öffnen (`state/objectSettings.ts`).
* Nicht in Textfeldern/Auswahllisten und nicht, wenn ein laufender Befehl diese Taste als Option-Kürzel belegt.
* `run` liefert `true`, wenn es etwas zu öffnen gab (dann wird die Taste verbraucht).
*/
export function useObjectSettingsShortcut(
overrides: ShortcutOverrides,
engineRef: RefObject<CommandEngine | null>,
run: () => boolean,
): void {
const runRef = useRef(run);
runRef.current = run;
useEffect(() => {
const onKey = (e: KeyboardEvent) => {
if (e.defaultPrevented || isEditableTarget(e) || (e.target as HTMLElement | null)?.tagName === "SELECT") return;
if (!matchesShortcut(e, "objectSettings", overrides)) return;
// Ein laufender Befehl behält seine Option-Kürzel (U/I/O/P …); sonst gilt T auch mitten im Zeichnen.
const eng = engineRef.current;
const k = e.key.toLowerCase();
if (eng?.isActive() && eng.view().options.some((o) => o.key?.toLowerCase() === k)) return;
if (runRef.current()) e.preventDefault();
};
window.addEventListener("keydown", onKey);
return () => window.removeEventListener("keydown", onKey);
}, [overrides, engineRef]);
}
+3
View File
@@ -52,6 +52,8 @@ export function useNativeMenu(opts: {
openSettings: () => void;
openLayerSettings: (code: string, x: number, y: number) => void;
activeCategoryCode: string;
/** [189] Objekteinstellungen (Taste T): Öffnungs-Dialog bzw. Objekt-Info. */
onObjectSettings: () => boolean;
}) {
const {
notify,
@@ -154,6 +156,7 @@ export function useNativeMenu(opts: {
onMove: () => onRunCommand("move"),
onMirror: () => onRunCommand("mirror"),
onRotate: () => onRunCommand("rotate"),
onObjectSettings: () => void opts.onObjectSettings(),
onViewType: setViewType,
onView3d: setView3d,
onReferenceLines: setReferenceLines,
+54 -8
View File
@@ -5187,7 +5187,8 @@ body {
`.attr-panel` — denselben sauberen Look wie das obere Attribut-Grid: Sektion-
Balken, Zeilentrenner, einheitliche Label-Spalte, linksbündig füllende Felder.
Das eigenständige ObjectInfo-Panel (Bezugspunkt/Masse) bleibt unberührt. */
.attr-panel .objinfo-section-label {
.attr-panel .objinfo-section-label,
.objinfo-group-body .objinfo-section-label {
color: var(--label);
font-weight: 700;
text-transform: uppercase;
@@ -5199,18 +5200,21 @@ body {
border-radius: 3px;
}
/* Sektion-Balken trennen bereits → die dünnen Extra-Striche entfallen. */
.attr-panel .objinfo-sep {
.attr-panel .objinfo-sep,
.objinfo-group-body .objinfo-sep {
display: none;
}
/* Zeile: Label-Spalte | Wert/Control, mit dezentem Zeilentrenner (wie .attr-*). */
.attr-panel .objinfo-field {
.attr-panel .objinfo-field,
.objinfo-group-body .objinfo-field {
display: flex;
align-items: center;
gap: 6px;
padding: 2px 2px 2px 2px;
border-bottom: 1px solid var(--line);
}
.attr-panel .objinfo-flabel {
.attr-panel .objinfo-flabel,
.objinfo-group-body .objinfo-flabel {
flex: 0 0 104px;
width: 104px;
white-space: nowrap;
@@ -5220,25 +5224,67 @@ body {
color: var(--label);
}
/* Werte/Controls füllen die Zelle linksbündig (statt rechtsbündig). */
.attr-panel .objinfo-fval {
.attr-panel .objinfo-fval,
.objinfo-group-body .objinfo-fval {
flex: 1 1 auto;
text-align: left;
}
.attr-panel .objinfo-input {
.attr-panel .objinfo-input,
.objinfo-group-body .objinfo-input {
text-align: left;
}
.attr-panel .objinfo-field .tb-dd-trigger {
.attr-panel .objinfo-field .tb-dd-trigger,
.objinfo-group-body .objinfo-field .tb-dd-trigger {
flex: 1 1 auto;
min-width: 0;
justify-content: space-between;
}
/* Segment-Umschalter + verschachtelte Felder füllen ebenfalls die Wert-Spalte. */
.attr-panel .objinfo-segment,
.attr-panel .objinfo-subfield {
.objinfo-group-body .objinfo-segment,
.attr-panel .objinfo-subfield,
.objinfo-group-body .objinfo-subfield {
flex: 1 1 auto;
min-width: 0;
}
/* [189] Einklappbare Gruppen der Objekt-Info: Kopfzeile als Knopf; Trennlinie und Titel, die jede
Abschnitts-Komponente selbst mitbringt, entfallen im Rumpf der Gruppe (der Kopf ersetzt sie). */
.objinfo-group {
margin-top: 4px;
}
.objinfo-group-head {
display: flex;
align-items: center;
gap: 6px;
width: 100%;
margin: 0;
padding: 3px 6px;
border: 0;
border-radius: 3px;
background: var(--panel-2);
color: var(--label);
font: inherit;
font-weight: 700;
font-size: 10px;
letter-spacing: 0.05em;
text-transform: uppercase;
text-align: left;
cursor: pointer;
}
.objinfo-group-head:hover {
background: var(--accent-dim);
}
.objinfo-group-chev {
flex: 0 0 auto;
width: 10px;
color: var(--muted);
}
.objinfo-group-body > .objinfo-sep:first-child,
.objinfo-group-body > .objinfo-sep:first-child + .objinfo-section-label {
display: none;
}
/* ── Wand-Abschnitt (Object-Info) ─────────────────────────────────────── */
/* Referenzlinie-Dropdown rechts oben im Kopf. */
.objinfo-head-ref {