diff --git a/src/i18n/de.ts b/src/i18n/de.ts index a57b977..4253697 100644 --- a/src/i18n/de.ts +++ b/src/i18n/de.ts @@ -221,6 +221,7 @@ export const de = { // Attribute-Palette (AttributesPanel) "attr.title": "Attribute", "attr.empty": "Keine Auswahl", + "attr.newComponent": "Neues Bauteil", "attr.stroke": "Stift", "attr.color": "Farbe", "attr.weight": "Strichstärke (mm)", diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 58e2540..ad79cd3 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -220,6 +220,7 @@ export const en: Record = { // Attribute-Palette (AttributesPanel) "attr.title": "Attributes", "attr.empty": "No selection", + "attr.newComponent": "New component", "attr.stroke": "Pen", "attr.color": "Color", "attr.weight": "Line weight (mm)", diff --git a/src/panels/AttributesPanel.tsx b/src/panels/AttributesPanel.tsx index 31881d0..c525dc9 100644 --- a/src/panels/AttributesPanel.tsx +++ b/src/panels/AttributesPanel.tsx @@ -47,11 +47,38 @@ export function AttributesPanel() { const sel = host.selection; const { project } = host; - // Leerzustand: kompakter Hinweis, wenn nichts (Sinnvolles) selektiert ist. + // 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 ? ( + <> +
{t("attr.newComponent")}
+
+ + {t(host.activeTool === "wall" ? "tool.wallType" : "tool.ceilingType")} + + + host.onActiveWallTypeId(v)} + options={project.wallTypes.map((wt) => ({ value: wt.id, label: wt.name }))} + /> + +
+ + ) : null; + + // Leerzustand: der Typ-Picker (falls ein Bauteil-Werkzeug aktiv ist), sonst ein + // kompakter Hinweis. if (sel === null) { return (
-
{t("attr.empty")}
+ {typeSection} + {!typeSection &&
{t("attr.empty")}
}
); } @@ -158,6 +185,8 @@ export function AttributesPanel() { return (
+ {/* 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. */} diff --git a/src/panels/ToolsPanel.tsx b/src/panels/ToolsPanel.tsx index 4dc87b7..d9cbc00 100644 --- a/src/panels/ToolsPanel.tsx +++ b/src/panels/ToolsPanel.tsx @@ -13,7 +13,6 @@ import { t } from "../i18n"; import { usePanelHost } from "./host"; import type { ToolId } from "./host"; import { TOOL_ORDER, getTool } from "../tools/tools"; -import { Dropdown } from "../ui/Dropdown"; // ── Icons ────────────────────────────────────────────────────────────────── // Keine echten Asset-Icons vorhanden: schlichte Inline-SVG-Glyphen je Werkzeug @@ -162,44 +161,9 @@ export function ToolsPanel() { ); })} -
- - {/* Wandtyp-Auswahl — nur sichtbar, wenn das Wand-Werkzeug aktiv ist. */} - {host.activeTool === "wall" && ( - - )} - - {host.activeTool === "wall" &&
} - - {/* Deckentyp-Auswahl — nur sichtbar, wenn das Decken-Werkzeug aktiv ist. - Nutzt denselben Aufbau-Typ (WallType) wie die Wand. */} - {host.activeTool === "ceiling" && ( - - )} - - {host.activeTool === "ceiling" &&
} + {/* Wandtyp-/Deckentyp-Auswahl ist ins Attribute-Panel gewandert (Ribbon-UI + Phase 3: Werkzeug-Sidebar nicht mehr im Default-Layout). Der Picker + erscheint dort bei aktivem Wand-/Decken-Werkzeug. */}
); } diff --git a/src/panels/layout.ts b/src/panels/layout.ts index 37c7dea..e05ae55 100644 --- a/src/panels/layout.ts +++ b/src/panels/layout.ts @@ -31,7 +31,10 @@ import type { * der rechten unteren Gruppe. Das Hochzählen verwirft alt gespeicherte Layouts * sauber auf den neuen Standard (kein Migrationspfad über die Strukturgrenze). */ -export const LAYOUT_VERSION = 7; +// v8: Werkzeug-Sidebar aus dem Default-Layout entfernt (Ribbon-UI Phase 3) → +// Version-Bump, damit gespeicherte Layouts auf den neuen Standard zurückfallen +// (Attribute volle linke Höhe statt Werkzeug-Palette oben). +export const LAYOUT_VERSION = 8; /** localStorage-Schlüssel des zuletzt benutzten Layouts. */ const CURRENT_KEY = "cad.layout"; @@ -55,9 +58,12 @@ const NAMED_PREFIX = "cad.layouts."; * OBEN, Zeichnungsebenen + Ebenen als Tab-Stapel UNTEN. (Ressourcen bleibt ein * schwebendes Fenster.) Jede Gruppe trägt ein Höhen-Gewicht. */ +// Ribbon-UI Phase 3: die Werkzeug-Sidebar ("tools") ist NICHT mehr im Default- +// Layout — die Werkzeuge liegen im Ribbon, der Wandtyp-/Deckentyp-Picker im +// Attribute-Panel. `ToolsPanel` bleibt registriert (per Fenster-Menü andockbar), +// nur nicht mehr per Default sichtbar → Attribute bekommt die volle linke Höhe. const DEFAULT_LEFT_GROUPS: DockGroup[] = [ - { tabs: ["tools"], activeTab: "tools", weight: 1 }, - { tabs: ["attributes"], activeTab: "attributes", weight: 1.1 }, + { tabs: ["attributes"], activeTab: "attributes", weight: 1 }, ]; const DEFAULT_RIGHT_GROUPS: DockGroup[] = [ { tabs: ["object-info", "room-balance"], activeTab: "object-info", weight: 1 }, @@ -86,9 +92,10 @@ function cloneGroups(groups: DockGroup[]): DockGroup[] { // ── Standard ──────────────────────────────────────────────────────────────── /** - * Liefert den eingebauten Startzustand: links zwei Gruppen (Werkzeuge oben, - * Zeichnungsebenen/Ebenen unten), rechts LEER. Jeder Aufruf erzeugt frische - * Objekte/Arrays, damit Aufrufer das Ergebnis gefahrlos mutieren können. + * Liefert den eingebauten Startzustand: links das Attribute-Panel (volle Höhe), + * rechts Objektinfo/Raumbilanz oben + Zeichnungsebenen/Ebenen/Umgebung unten. + * Die Werkzeuge liegen im Ribbon (keine Sidebar mehr). Jeder Aufruf erzeugt + * frische Objekte/Arrays, damit Aufrufer das Ergebnis gefahrlos mutieren können. */ export function defaultLayout(): LayoutState { return {