[195] Objekteinstellungen-Fenster: Taste T öffnet schwebendes Fenster mit Bereichen Objekt/Darstellung
Neues Panel `object-settings` (schwebend, verschiebbar, folgt der Auswahl, „Keine Auswahl" bei leerer): Bereich Objekt = Objekt-Info samt Abschnitten, Bereich Darstellung = Attribute (dieselben Komponenten, keine Doppelspur). Taste T / Menü ersetzt den Öffnungs-Dialog als Ziel (der Detaildialog bleibt über das Zahnrad im Abschnitt Öffnung). Mehrfachauswahl: Strichstärke und Farbe gelten für alle gewählten Wände/Decken/2D-Elemente (ein Undo-Schritt je Auswahl und Feld), abweichende Werte erscheinen leer. Tests: areas.test.ts, mixedValues.test.ts, e2e objectSettings/objectSettingsWindow. Natives macOS- Nebenfenster offen (TODO.md), nicht in der Tauri-App geprüft.
This commit is contained in:
23 files changed
+491
-51
No files matched your search
@@ -89,7 +89,7 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `*
|
||||
- ○ **[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
|
||||
- ○ **[197]** Cmd+3/4 Nachbesserung (12.11., Maintainer): (1) Kamera bleibt bei Cmd+3/Cmd+4 exakt stehen (kein Einpassen; Einpassen nur mit Cmd+Shift+F); (2) Dachfenster/Deckenöffnungen bleiben bei „nur Auswahl“ (eine Wand) sichtbar → Öffnungen nur mit sichtbarem Wirt (Wand, Dach, Decke) oder selbst gewählt (`model3d::ElementSelection`). e2e. · S
|
||||
- ○ **[196]** (12.11., Maintainer, PRIO) (1) Raster-Bodenschraffur in Gebäudeform (mit Loch an der Wendeltreppe) im EG-Grundriss lässt sich weder anwählen noch löschen — Vermutung: Ansichtsschraffur der Decke des darunterliegenden Geschosses (UG-Decke von oben) bzw. Bodenbelag; klären (Musterhaus komplex EG), Pick wählt das Quell-Element (auch wenn es zu einem anderen Geschoss gehört), Entf löscht es bzw. Hinweis. (2) Zeichnungsebenen-Panel: Auge/„sichtbar“ bei einer Ansicht blendet bei den Grundrissen alle Geschosse ein → Auge schaltet nur die eigene Ebene. (3) Auge eines Geschosses aus → Geschoss fehlt auch im 3D (heute zeigt 3D immer alle Geschosse; Filter wie Klassen [180] im 3D-Cache-Ausgang). e2e für alles. · S
|
||||
- ○ **[195]** Objekt-Einstellungsfenster (12.11., Maintainer): T öffnet ein EIGENES Fenster (macOS-Nebenfenster wie Einstellungen/Ressourcen über die Sync-Brücke, Browser: verschiebbares Fenster), für ALLE Bauteile (Wand, Decke, Dach, Treppe, Stütze, Öffnung, Raum, Körper, Gelände/Baugrube, 2D, Bemassung), mit Abschnitten Objektspezifisch (Typ/Aufbau/Masse/Parameter) + Darstellung (Stift, Füllung, Schraffur, Linienstil, Modelldarstellung). Mehrfachauswahl gleicher Art, live mit Undo je Änderung; dieselben Abschnitts-Komponenten wie Objekt-Info (keine Doppelspur). Ersetzt den bisherigen Öffnungs-Dialog bei T. · L
|
||||
- ◐ **[195]** Objekt-Einstellungsfenster (12.11., Maintainer): T öffnet ein EIGENES Fenster (macOS-Nebenfenster wie Einstellungen/Ressourcen über die Sync-Brücke, Browser: verschiebbares Fenster), für ALLE Bauteile (Wand, Decke, Dach, Treppe, Stütze, Öffnung, Raum, Körper, Gelände/Baugrube, 2D, Bemassung), mit Abschnitten Objektspezifisch (Typ/Aufbau/Masse/Parameter) + Darstellung (Stift, Füllung, Schraffur, Linienstil, Modelldarstellung). Mehrfachauswahl gleicher Art, live mit Undo je Änderung; dieselben Abschnitts-Komponenten wie Objekt-Info (keine Doppelspur). Ersetzt den bisherigen Öffnungs-Dialog bei T. · L Stand 11.11.: schwebendes Fenster `object-settings` (Panel, Browser/Electron, auch auf macOS im Hauptfenster) mit Bereichen Objekt (= Objekt-Info) und Darstellung (= Attribute), folgt der Auswahl, „Keine Auswahl" bei leerer; Taste T öffnet es statt des Öffnungs-Dialogs; Strichstärke/Farbe für Mehrfachauswahl (Wand/Decke/2D) für alle, abweichend = leer, ein Undo-Schritt je Auswahl+Feld. Offen: natives macOS-Nebenfenster über die Sync-Brücke (die Abschnitts-Komponenten hängen an Store und Panel-Host — dort bräuchte es eine Store-Spiegelung; nicht begonnen); Mehrfachwerte erst für Stift (Farbe, Strichstärke), nicht für Füllung/Typ/Masse; der Öffnungs-Detaildialog (`OpeningEditorDialog`, Vorschau + Rahmen-Details) bleibt über ⚙ im Abschnitt Öffnung erreichbar (nicht in den Bereich Objekt übernommen). Nicht in der Tauri-App geprüft.
|
||||
- ○ **[194]** Texte exakt synchron beim Zoomen (12.11., Maintainer Mac: Texte immer leicht verzögert, Bewegung sonst smooth; Nachfolger [145]): alle Texte (Raumstempel, Textfelder, Beschriftungen) und möglichst Griffe in der nativen Metal-Fläche im selben Frame zeichnen — glyphon-Textpfad aus render2d (WebGPU) auch für `native2d` (mehrzeilig, fett, Ausrichtung), Overlay nur noch für Interaktion. Prüfbar im Container nur mit Software-Vulkan; Urteil auf dem Mac. Opus. · M
|
||||
- ○ **[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
|
||||
- ◐ **[190]** Verbinden wie Archicad + Kürzel (12.11., Wunsch Maintainer). Umgesetzt (12.11.): Cmd/Ctrl+J („join") schliesst bei
|
||||
|
||||
+20
-13
@@ -49,40 +49,47 @@ test("Wand gewählt: Attribute ohne Aufbau/Typ-Felder, Objekt-Info mit Wand-Absc
|
||||
}
|
||||
});
|
||||
|
||||
test("Taste T: Fenster gewählt → Einstellungsdialog ([189])", async ({ page }) => {
|
||||
test("Taste T: Fenster gewählt → Fenster Objekteinstellungen mit Öffnungs-Feldern ([195])", 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);
|
||||
const win = page.locator(".objset-panel");
|
||||
await expect(win).toHaveCount(0);
|
||||
await page.keyboard.press("t");
|
||||
await expect(page.locator(".oed-dialog")).toBeVisible();
|
||||
await expect(win).toBeVisible();
|
||||
await expect(win.locator('[data-group="opening"] .objinfo-group-head')).toHaveAttribute("aria-expanded", "true");
|
||||
await expect(win.locator('[data-group="opening"]').getByText("Brüstung").first()).toBeVisible();
|
||||
await expect(page.locator(".oed-dialog")).toHaveCount(0);
|
||||
});
|
||||
|
||||
test("Taste T: Wand gewählt → Wand-Abschnitt der Objekt-Info fokussiert und aufgeklappt ([189])", async ({ page }) => {
|
||||
test("Taste T: Wand gewählt → Wand-Abschnitt im Fenster fokussiert und aufgeklappt ([195])", async ({ page }) => {
|
||||
await startNewProject(page);
|
||||
await openSample(page);
|
||||
await selectW1(page);
|
||||
const head = page.locator('[data-group="wall"] .objinfo-group-head');
|
||||
await blurFocus(page);
|
||||
await page.keyboard.press("t");
|
||||
const head = page.locator('.objset-panel [data-group="wall"] .objinfo-group-head');
|
||||
await expect(head).toHaveAttribute("aria-expanded", "true");
|
||||
await expect(head).toBeFocused();
|
||||
await head.click(); // zuklappen
|
||||
await expect(head).toHaveAttribute("aria-expanded", "false");
|
||||
await blurFocus(page);
|
||||
await page.keyboard.press("t");
|
||||
await page.keyboard.press("t"); // klappt wieder auf, Fenster bleibt einmalig
|
||||
await expect(head).toHaveAttribute("aria-expanded", "true");
|
||||
await expect(head).toBeFocused();
|
||||
await expect(page.locator(".objset-panel")).toHaveCount(1);
|
||||
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 }) => {
|
||||
test("Taste T ohne Auswahl bei Wand-Werkzeug: Typ des neuen Bauteils im Fenster ([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('.objset-panel [data-group="newComponent"] .objinfo-group-head')).toBeFocused();
|
||||
await expect(page.locator(".attr-panel").getByText("Neues Bauteil")).toHaveCount(0);
|
||||
});
|
||||
|
||||
@@ -91,14 +98,14 @@ test("Taste T: in Textfeldern wirkungslos, ohne Auswahl und Werkzeug nichts ([18
|
||||
await openSample(page);
|
||||
await openTab(page, "Elemente");
|
||||
await elementRows(page).filter({ hasText: /Fenster/ }).first().click();
|
||||
// Tippen im Befehlsfeld darf den Dialog nicht öffnen.
|
||||
// Tippen im Befehlsfeld darf das Fenster nicht öffnen.
|
||||
await page.locator(".cmdline-input").fill("t");
|
||||
await page.locator(".cmdline-input").press("t");
|
||||
await expect(page.locator(".oed-dialog")).toHaveCount(0);
|
||||
await expect(page.locator(".objset-panel")).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);
|
||||
await expect(page.locator(".objset-panel")).toHaveCount(0);
|
||||
});
|
||||
@@ -0,0 +1,72 @@
|
||||
// [195] Fenster „Objekteinstellungen" (Taste T): Bereiche Objekt/Darstellung, live mit Undo, Mehrfachauswahl.
|
||||
// Mit DOSSIER_SHOTS=<ordner> entsteht ein Screenshot für die Abnahme.
|
||||
import { blurFocus, elementRows, expect, openSample, openTab, test } from "./app";
|
||||
import type {} from "../src/state/testHooks"; // Typ von window.__dossierTest
|
||||
|
||||
test.use({ deviceScaleFactor: 2 });
|
||||
|
||||
test("Wand → T → Bereiche Objekt/Darstellung, Strichstärke live, Undo ([195])", async ({ page }) => {
|
||||
await page.goto("/?dossierTest");
|
||||
await page.getByRole("button", { name: /Neues Projekt/ }).first().click();
|
||||
await expect(page.getByRole("group", { name: "Befehlszeile" })).toBeVisible();
|
||||
await openSample(page);
|
||||
await openTab(page, "Elemente");
|
||||
await elementRows(page).filter({ hasText: "W1" }).click();
|
||||
await expect(page.getByText("Auswahl: 1 Wand")).toBeVisible();
|
||||
await blurFocus(page);
|
||||
await page.keyboard.press("t");
|
||||
|
||||
const win = page.locator(".objset-panel");
|
||||
await expect(win).toBeVisible();
|
||||
await expect(win.getByRole("tab", { name: "Objekt" })).toHaveAttribute("aria-selected", "true");
|
||||
await expect(win.locator('[data-group="wall"]')).toBeVisible();
|
||||
|
||||
await win.getByRole("tab", { name: "Darstellung" }).click();
|
||||
await expect(win.getByText("Strichstärke (mm)", { exact: true })).toBeVisible();
|
||||
const before = await page.evaluate(() => window.__dossierTest!.wallWeights());
|
||||
const weight = win.locator(".attr-num").first();
|
||||
await weight.fill("0.7");
|
||||
await expect.poll(() => page.evaluate(() => Object.values(window.__dossierTest!.wallWeights()))).toContain(0.7);
|
||||
|
||||
const shots = process.env.DOSSIER_SHOTS;
|
||||
if (shots) await win.screenshot({ path: `${shots}/objekteinstellungen-darstellung.png` });
|
||||
|
||||
await blurFocus(page);
|
||||
await page.keyboard.press("Control+z");
|
||||
await expect.poll(() => page.evaluate(() => window.__dossierTest!.wallWeights())).toEqual(before);
|
||||
|
||||
// Das Fenster bleibt offen und folgt der Auswahl: leer → „Keine Auswahl".
|
||||
await expect(win).toBeVisible();
|
||||
await page.evaluate(() => window.__dossierTest!.select({ walls: [], drawings: [] }));
|
||||
await expect(win.getByText("Keine Auswahl")).toBeVisible();
|
||||
});
|
||||
|
||||
test("Mehrfachauswahl: eine Änderung gilt für alle, abweichende Werte erscheinen leer ([195])", async ({ page }) => {
|
||||
await page.goto("/?dossierTest");
|
||||
await page.getByRole("button", { name: /Neues Projekt/ }).first().click();
|
||||
await expect(page.getByRole("group", { name: "Befehlszeile" })).toBeVisible();
|
||||
await openSample(page);
|
||||
const ids = await page.evaluate(() => window.__dossierTest!.heights().walls.slice(0, 2).map((w) => w.id));
|
||||
await page.evaluate((w) => window.__dossierTest!.select({ walls: [w[0]] }), ids);
|
||||
await blurFocus(page);
|
||||
await page.keyboard.press("t");
|
||||
const win = page.locator(".objset-panel");
|
||||
await win.getByRole("tab", { name: "Darstellung" }).click();
|
||||
await win.locator(".attr-num").first().fill("0.5");
|
||||
await expect.poll(() => page.evaluate(() => Object.keys(window.__dossierTest!.wallWeights()).length)).toBe(1);
|
||||
|
||||
// Beide Wände: 0.5 gegen Standard → gemischt, Feld leer.
|
||||
await page.evaluate((w) => window.__dossierTest!.select({ walls: w }), ids);
|
||||
const field = win.locator(".attr-num").first();
|
||||
await expect(field).toHaveValue("");
|
||||
await field.fill("0.35");
|
||||
await expect
|
||||
.poll(() => page.evaluate(() => Object.values(window.__dossierTest!.wallWeights())))
|
||||
.toEqual([0.35, 0.35]);
|
||||
await expect(field).toHaveValue("0.35");
|
||||
|
||||
// Ein Undo-Schritt macht beide Wände zurück.
|
||||
await blurFocus(page);
|
||||
await page.keyboard.press("Control+z");
|
||||
await expect.poll(() => page.evaluate(() => Object.values(window.__dossierTest!.wallWeights()))).toEqual([0.5]);
|
||||
});
|
||||
+2
-3
@@ -499,12 +499,11 @@ export default function App() {
|
||||
pa,
|
||||
});
|
||||
|
||||
// [189] Taste T / Menü „Objekteinstellungen…": Öffnungs-Dialog bzw. Objekt-Info (state/objectSettings.ts).
|
||||
// [195] Taste T / Menü „Objekteinstellungen…": schwebendes Fenster (state/objectSettings.ts).
|
||||
const openSettingsOfObject = () =>
|
||||
openObjectSettings({
|
||||
activeTool,
|
||||
openOpeningEditor: setOpeningEditorId,
|
||||
revealObjectInfo: () => setLayout((l) => revealPanel(l, "object-info")),
|
||||
revealObjectSettings: () => setLayout((l) => revealPanel(l, "object-settings", { x: 96, y: 96, w: 360, h: 560 })),
|
||||
});
|
||||
useObjectSettingsShortcut(shortcutOverrides, engineRef, openSettingsOfObject);
|
||||
|
||||
|
||||
@@ -364,6 +364,10 @@ export const de = {
|
||||
"nav.tools": "Werkzeuge",
|
||||
"nav.attributes": "Attribute",
|
||||
"nav.objectInfo": "Objekt-Info",
|
||||
"nav.objectSettings": "Objekteinstellungen",
|
||||
"objsettings.area.object": "Objekt",
|
||||
"objsettings.area.appearance": "Darstellung",
|
||||
"objsettings.mixed": "gemischt",
|
||||
|
||||
// Attribute-Palette (AttributesPanel)
|
||||
"attr.title": "Attribute",
|
||||
|
||||
@@ -362,6 +362,10 @@ export const en: Record<TranslationKey, string> = {
|
||||
"nav.tools": "Tools",
|
||||
"nav.attributes": "Attributes",
|
||||
"nav.objectInfo": "Object Info",
|
||||
"nav.objectSettings": "Object Settings",
|
||||
"objsettings.area.object": "Object",
|
||||
"objsettings.area.appearance": "Appearance",
|
||||
"objsettings.mixed": "mixed",
|
||||
|
||||
// Attribute-Palette (AttributesPanel)
|
||||
"attr.title": "Attributes",
|
||||
|
||||
@@ -26,9 +26,10 @@
|
||||
// Label→Wert-Grid. Bezeichner englisch, UI-Text/Kommentare deutsch (CONVENTIONS.md).
|
||||
// Alle sichtbaren Texte über t(...).
|
||||
|
||||
import { Fragment } from "react";
|
||||
import { Fragment, useMemo } from "react";
|
||||
import { useSelectionInfo } from "../state/useSelectionInfo";
|
||||
import { useStore } from "../state/appStore";
|
||||
import { selectionAppearance } from "../state/mixedValues";
|
||||
import { attrGroups } from "./objectInfo/groups";
|
||||
import type { ReactNode } from "react";
|
||||
import { t } from "../i18n";
|
||||
@@ -67,6 +68,9 @@ export function AttributesPanel() {
|
||||
const host = usePanelHost();
|
||||
const project = useStore((s) => s.project);
|
||||
const sel = useSelectionInfo();
|
||||
const selection = useStore((s) => s.selection);
|
||||
// [195] Mehrfachauswahl: gemeinsamer Wert, bei Abweichung leeres Feld.
|
||||
const appearance = useMemo(() => selectionAppearance(project, selection), [project, selection]);
|
||||
|
||||
// Leerzustand: Hinweis. (Typ des neuen Bauteils und Schnittlinie liegen seit [189] in der Objekt-Info.)
|
||||
if (sel === null) {
|
||||
@@ -244,6 +248,7 @@ export function AttributesPanel() {
|
||||
onColorChange={host.onSetSelectionColor}
|
||||
onPenChange={host.onSetSelectionColorPen}
|
||||
/>
|
||||
{appearance.color.mixed && <span className="attr-mixed" data-mixed="color">{t("objsettings.mixed")}</span>}
|
||||
</span>
|
||||
|
||||
{/* Strichstärke (mm): Wand/Decke/Drawing2D mit Nach-Ebene/Nach-Bauteil/
|
||||
@@ -269,7 +274,8 @@ export function AttributesPanel() {
|
||||
min={0}
|
||||
disabled={!weightEditable || !!sel.colorPenId}
|
||||
list="attr-pen-weights"
|
||||
value={sel.colorPenId ? resolvePenWeight(project, sel.colorPenId) : sel.weightMm}
|
||||
value={appearance.weightMm.mixed ? "" : sel.colorPenId ? resolvePenWeight(project, sel.colorPenId) : sel.weightMm}
|
||||
placeholder={appearance.weightMm.mixed ? t("objsettings.mixed") : undefined}
|
||||
onChange={(e) => {
|
||||
const v = Number(e.target.value);
|
||||
if (Number.isFinite(v)) host.onSetSelectionWeight(v);
|
||||
|
||||
@@ -20,6 +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) |
|
||||
| `objectSettings/` | Fenster „Objekteinstellungen" ([195], Taste T): `ObjectSettingsPanel` (schwebendes Panel `object-settings`) zeigt Bereich Objekt = `ObjectInfoPanel` und Darstellung = `AttributesPanel` (dieselben Komponenten, keine Doppelspur); `areas.ts` = Bereichs-Zuordnung, `areaState.ts` = gewählter Bereich |
|
||||
| `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 |
|
||||
|
||||
@@ -28,6 +28,7 @@ import { LayoutsPanel, LayoutsTabIcon } from "./LayoutsPanel";
|
||||
import { BcfPanel } from "./BcfPanel";
|
||||
import { ClashPanel } from "./ClashPanel";
|
||||
import { HistoryPanel } from "./HistoryPanel";
|
||||
import { ObjectSettingsPanel } from "./objectSettings/ObjectSettingsPanel";
|
||||
import {
|
||||
ToolsTabIcon,
|
||||
AttributesTabIcon,
|
||||
@@ -55,6 +56,7 @@ export const BUILTIN_PANEL_IDS = {
|
||||
bcf: "bcf",
|
||||
clash: "clash",
|
||||
history: "history",
|
||||
objectSettings: "object-settings",
|
||||
} as const;
|
||||
|
||||
// Werkzeug-Palette (Symbol + Name je Werkzeug, ArchiCAD/Vectorworks-Stil).
|
||||
@@ -183,3 +185,13 @@ registerPanel({
|
||||
hasDisplayMode: false,
|
||||
render: () => <HistoryPanel />,
|
||||
});
|
||||
|
||||
// Objekteinstellungen ([195]) — Taste T: schwebendes Fenster, folgt der Auswahl; Bereiche „Objekt" (Objekt-Info)
|
||||
// und „Darstellung" (Attribute). Nicht im Standard-Layout; öffnet sich mit T bzw. „Bearbeiten > Objekteinstellungen…".
|
||||
registerPanel({
|
||||
id: BUILTIN_PANEL_IDS.objectSettings,
|
||||
title: "nav.objectSettings",
|
||||
icon: <ObjectInfoTabIcon />,
|
||||
hasDisplayMode: false,
|
||||
render: () => <ObjectSettingsPanel />,
|
||||
});
|
||||
@@ -373,7 +373,11 @@ export function setActiveTab(
|
||||
* • angedockt, inaktiver Tab → als aktiven Tab seiner Gruppe setzen.
|
||||
* • nirgends vorhanden → als neues schwebendes Fenster öffnen (Default-Rect).
|
||||
*/
|
||||
export function revealPanel(layout: LayoutState, panelId: string): LayoutState {
|
||||
export function revealPanel(
|
||||
layout: LayoutState,
|
||||
panelId: string,
|
||||
rect: { x: number; y: number; w: number; h: number } = { x: 120, y: 120, w: 320, h: 420 },
|
||||
): LayoutState {
|
||||
if (layout.floating.some((f) => f.panelId === panelId)) {
|
||||
return bringToFront(layout, panelId);
|
||||
}
|
||||
@@ -382,7 +386,7 @@ export function revealPanel(layout: LayoutState, panelId: string): LayoutState {
|
||||
return setActiveTab(layout, dock, panelId);
|
||||
}
|
||||
}
|
||||
return moveToFloat(layout, panelId, { x: 120, y: 120, w: 320, h: 420 });
|
||||
return moveToFloat(layout, panelId, rect);
|
||||
}
|
||||
|
||||
// `otherDock` wird (noch) nicht extern gebraucht, ist aber Teil der Aufräum-
|
||||
|
||||
@@ -56,19 +56,19 @@ describe("Panel-Zuordnung [189]", () => {
|
||||
});
|
||||
|
||||
describe("Taste T: Ziel [189]", () => {
|
||||
it("Fenster/Tür öffnet den Öffnungs-Dialog", () => {
|
||||
it("Fenster/Tür öffnet den Öffnungs-Abschnitt (kein eigener Dialog mehr, [195])", () => {
|
||||
const sel = deriveSelection(p, { openings: [p.openings![0].id] });
|
||||
expect(objectSettingsTarget(sel, "select")).toEqual({ kind: "opening", id: p.openings![0].id });
|
||||
expect(objectSettingsTarget(sel, "select")).toEqual({ group: "opening" });
|
||||
});
|
||||
|
||||
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" });
|
||||
expect(objectSettingsTarget(sel, "select")).toEqual({ 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, "wall")).toEqual({ group: "newComponent" });
|
||||
expect(objectSettingsTarget(null, "ceiling")).toEqual({ group: "newComponent" });
|
||||
expect(objectSettingsTarget(null, "select")).toBeNull();
|
||||
expect(objectSettingsTarget(null, "line")).toBeNull();
|
||||
});
|
||||
|
||||
@@ -98,18 +98,14 @@ export function attrGroups(c: AttrGroupContext): AttrGroupId[] {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* Ziel der Taste T ([195], wie Archicad Cmd+T): immer das Fenster Objekteinstellungen; `group` ist der Abschnitt
|
||||
* des Bereichs Objekt, der aufgeklappt und fokussiert wird (`null` = nur das Fenster). 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 type ObjectSettingsTarget = { 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 };
|
||||
if (!sel) return activeTool === "wall" || activeTool === "ceiling" ? { group: "newComponent" } : null;
|
||||
const first = infoGroups({ sel, isGrid, sectionLine: false, newComponentTool: false })[0];
|
||||
return { kind: "info", group: first ?? null };
|
||||
return { group: first ?? null };
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// [195] Inhalt des Fensters „Objekteinstellungen" (Taste T, wie Archicad Cmd+T): folgt der Auswahl und zeigt zwei
|
||||
// Bereiche — „Objekt" (Objekt-Info samt Abschnitten) und „Darstellung" (Attribute: Stift, Füllung, Schraffur,
|
||||
// Linienstil, Linienenden). Keine eigenen Felder: es sind dieselben Komponenten wie in den Dock-Panels, also
|
||||
// dieselben Handler (Ops mit Undo, Regler/Tippen über coalesceKey) und keine Doppelspur.
|
||||
|
||||
import { useSyncExternalStore } from "react";
|
||||
import { t } from "../../i18n";
|
||||
import { useStore } from "../../state/appStore";
|
||||
import { useSelectionInfo } from "../../state/useSelectionInfo";
|
||||
import { AttributesPanel } from "../AttributesPanel";
|
||||
import { usePanelHost } from "../host";
|
||||
import { ObjectInfoPanel } from "../ObjectInfoPanel";
|
||||
import { settingsAreas, type SettingsArea } from "./areas";
|
||||
import { getSettingsArea, setSettingsArea, subscribeSettingsArea } from "./areaState";
|
||||
|
||||
const AREA_TITLE = { object: "objsettings.area.object", appearance: "objsettings.area.appearance" } as const;
|
||||
|
||||
export function ObjectSettingsPanel() {
|
||||
const host = usePanelHost();
|
||||
const sel = useSelectionInfo();
|
||||
const otherSelected = useStore((s) => s.selection.trees.length + s.selection.site.length > 0);
|
||||
const isGrid = useStore((s) => (sel?.kind === "drawing2d" ? s.project.drawings2d.find((d) => d.id === sel.id)?.geom.shape === "grid" : false));
|
||||
const wanted = useSyncExternalStore(subscribeSettingsArea, getSettingsArea);
|
||||
|
||||
const areas = settingsAreas({
|
||||
sel,
|
||||
otherSelected,
|
||||
isGrid,
|
||||
sectionLine: !!host.sectionLine,
|
||||
newComponentTool: host.activeTool === "wall" || host.activeTool === "ceiling",
|
||||
});
|
||||
if (areas.length === 0) {
|
||||
return (
|
||||
<div className="objset-panel">
|
||||
<div className="objset-empty">{t("attr.empty")}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
// Fehlt der gewünschte Bereich für diese Auswahl, zeigt das Fenster den ersten vorhandenen.
|
||||
const area: SettingsArea = areas.includes(wanted) ? wanted : areas[0];
|
||||
return (
|
||||
<div className="objset-panel" data-area={area}>
|
||||
{areas.length > 1 && (
|
||||
<div className="objset-tabs" role="tablist">
|
||||
{areas.map((a) => (
|
||||
<button
|
||||
key={a}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={a === area}
|
||||
className="objset-tab"
|
||||
data-area={a}
|
||||
onClick={() => setSettingsArea(a)}
|
||||
>
|
||||
{t(AREA_TITLE[a])}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<div className="objset-body" role="tabpanel" aria-label={t(AREA_TITLE[area])}>
|
||||
{area === "object" ? <ObjectInfoPanel /> : <AttributesPanel />}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// [195] Gewählter Bereich des Objekteinstellungs-Fensters („Objekt" / „Darstellung"). Ausserhalb von React
|
||||
// lesbar und setzbar, damit Taste T den Bereich wählen kann, bevor das Fenster montiert ist.
|
||||
|
||||
import type { SettingsArea } from "./areas";
|
||||
|
||||
let area: SettingsArea = "object";
|
||||
const listeners = new Set<() => void>();
|
||||
|
||||
export const getSettingsArea = (): SettingsArea => area;
|
||||
|
||||
export function setSettingsArea(next: SettingsArea): void {
|
||||
if (next === area) return;
|
||||
area = next;
|
||||
for (const l of [...listeners]) l();
|
||||
}
|
||||
|
||||
export function subscribeSettingsArea(l: () => void): () => void {
|
||||
listeners.add(l);
|
||||
return () => {
|
||||
listeners.delete(l);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
// [195] Bereichs-Zuordnung des Objekteinstellungs-Fensters je Elementart.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildComplexSampleProject } from "../../model/sampleProjectComplex";
|
||||
import { deriveSelection } from "../../state/selectionInfo";
|
||||
import { settingsAreas } from "./areas";
|
||||
|
||||
const p = buildComplexSampleProject();
|
||||
const none = { otherSelected: false };
|
||||
|
||||
describe("Bereiche des Objekteinstellungs-Fensters [195]", () => {
|
||||
it("jedes Bauteil im Beispielprojekt: Objekt + Darstellung", () => {
|
||||
const cases: [string, string, string | undefined][] = [
|
||||
["Wand", "walls", p.walls[0]?.id],
|
||||
["Decke", "ceilings", p.ceilings?.[0]?.id],
|
||||
["Dach", "roofs", p.roofs?.[0]?.id],
|
||||
["Treppe", "stairs", p.stairs?.[0]?.id],
|
||||
["Stütze", "columns", p.columns?.[0]?.id],
|
||||
["Öffnung", "openings", p.openings?.[0]?.id],
|
||||
["Raum", "rooms", p.rooms?.[0]?.id],
|
||||
["Körper", "solids", p.extrudedSolids?.[0]?.id],
|
||||
["Gelände/Kontext", "contextObjects", p.context?.[0]?.id],
|
||||
["2D-Zeichnung", "drawings", p.drawings2d[0]?.id],
|
||||
];
|
||||
let seen = 0;
|
||||
for (const [name, kind, id] of cases) {
|
||||
if (!id) continue; // Beispielprojekt ohne dieses Element
|
||||
const sel = deriveSelection(p, { [kind]: [id] });
|
||||
if (!sel) continue;
|
||||
seen++;
|
||||
expect(settingsAreas({ sel, ...none }), name).toEqual(["object", "appearance"]);
|
||||
}
|
||||
expect(seen).toBeGreaterThan(4);
|
||||
});
|
||||
|
||||
it("Achsraster und Bemassung (2D) tragen beide Bereiche", () => {
|
||||
const grid = p.drawings2d.find((d) => d.geom.shape === "grid");
|
||||
const dim = p.drawings2d.find((d) => d.geom.shape === "dimension");
|
||||
for (const d of [grid, dim]) {
|
||||
if (!d) continue;
|
||||
const sel = deriveSelection(p, { drawings: [d.id] });
|
||||
expect(settingsAreas({ sel, isGrid: d.geom.shape === "grid", ...none })).toEqual(["object", "appearance"]);
|
||||
}
|
||||
});
|
||||
|
||||
it("Schnittlinie, Baum/Lage und Werkzeug-Voreinstellung: nur Objekt", () => {
|
||||
expect(settingsAreas({ sel: null, otherSelected: false, sectionLine: true })).toEqual(["object"]);
|
||||
expect(settingsAreas({ sel: null, otherSelected: true })).toEqual(["object"]);
|
||||
expect(settingsAreas({ sel: null, otherSelected: false, newComponentTool: true })).toEqual(["object"]);
|
||||
});
|
||||
|
||||
it("ohne Auswahl: keine Bereiche", () => {
|
||||
expect(settingsAreas({ sel: null, ...none })).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
// [195] Bereiche des Objekteinstellungs-Fensters (Taste T): „Objekt" = Typ/Aufbau/Masse/Höhen/Parameter (die
|
||||
// Objekt-Info samt ihren Abschnitten, `objectInfo/groups.ts`), „Darstellung" = Stift, Füllung, Schraffur,
|
||||
// Linienstil, Linienenden (das Attribute-Panel, `attrGroups`). Rein, ohne React; das Fenster
|
||||
// (`ObjectSettingsPanel`) zeigt nur die Bereiche, die es für die Auswahl gibt.
|
||||
|
||||
import type { SelectionInfo } from "../../state/selectionInfo";
|
||||
import { attrGroups, infoGroups } from "../objectInfo/groups";
|
||||
|
||||
export type SettingsArea = "object" | "appearance";
|
||||
|
||||
export interface SettingsAreaContext {
|
||||
sel: SelectionInfo | null;
|
||||
/** Baum, Lage-Darstellung (Schatten/Baurecht) oder Schnittlinie gewählt: keine `SelectionInfo`, aber Objekt-Felder. */
|
||||
otherSelected: boolean;
|
||||
isGrid?: boolean;
|
||||
sectionLine?: boolean;
|
||||
/** Wand-/Decken-Werkzeug aktiv: Typ des neuen Bauteils. */
|
||||
newComponentTool?: boolean;
|
||||
}
|
||||
|
||||
/** Bereiche in Anzeige-Reihenfolge; leer = „Keine Auswahl". */
|
||||
export function settingsAreas(c: SettingsAreaContext): SettingsArea[] {
|
||||
const out: SettingsArea[] = [];
|
||||
const groups = infoGroups({ sel: c.sel, isGrid: !!c.isGrid, sectionLine: !!c.sectionLine, newComponentTool: !!c.newComponentTool });
|
||||
// Jedes gewählte Element hat Objekt-Felder (Kopf mit Art, Ebene, Mass); die Abschnitte kommen dazu.
|
||||
if (c.sel || c.otherSelected || groups.length > 0) out.push("object");
|
||||
if (attrGroups({ sel: c.sel, openEnds: false, isDimension: false }).length > 0) out.push("appearance");
|
||||
return out;
|
||||
}
|
||||
+1
-1
@@ -48,7 +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 |
|
||||
| `objectSettings.ts` | Taste T / Menü „Objekteinstellungen…" ([195]): öffnet das schwebende Fenster `object-settings` und klappt den passenden Abschnitt der Objekt-Info auf; `mixedValues.ts`: gemeinsamer Wert über die Mehrfachauswahl (abweichend = leer) |
|
||||
| `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 |
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// [195] Mehrfach-Werte: gleiche Werte → ein Wert, abweichende → leer (gemischt).
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildComplexSampleProject } from "../model/sampleProjectComplex";
|
||||
import { commonValue, selectionAppearance, selectedCount } from "./mixedValues";
|
||||
import { EMPTY_SELECTION, mergeSelection } from "./selection";
|
||||
|
||||
describe("commonValue [195]", () => {
|
||||
it("gleich → Wert, abweichend → gemischt, leer → weder noch", () => {
|
||||
expect(commonValue([0.25, 0.25])).toEqual({ value: 0.25, mixed: false });
|
||||
expect(commonValue([0.25, 0.5])).toEqual({ value: undefined, mixed: true });
|
||||
expect(commonValue([])).toEqual({ value: undefined, mixed: false });
|
||||
expect(commonValue(["#000"])).toEqual({ value: "#000", mixed: false });
|
||||
});
|
||||
});
|
||||
|
||||
describe("selectionAppearance [195]", () => {
|
||||
const p = buildComplexSampleProject();
|
||||
const w = p.walls.slice(0, 2).map((x) => x.id);
|
||||
|
||||
it("zwei Wände mit gleicher Strichstärke → ein Wert", () => {
|
||||
const sel = mergeSelection(EMPTY_SELECTION, { walls: [w[0], w[0]] });
|
||||
const a = selectionAppearance(p, sel);
|
||||
expect(a.weightMm.mixed).toBe(false);
|
||||
expect(typeof a.weightMm.value).toBe("number");
|
||||
});
|
||||
|
||||
it("abweichende Strichstärke → gemischt", () => {
|
||||
const q = { ...p, walls: p.walls.map((x) => (x.id === w[1] ? { ...x, strokeWeight: 1.7 } : x)) };
|
||||
const sel = mergeSelection(EMPTY_SELECTION, { walls: w });
|
||||
const a = selectionAppearance(q, sel);
|
||||
expect(a.count).toBe(2);
|
||||
expect(a.weightMm).toEqual({ value: undefined, mixed: true });
|
||||
});
|
||||
|
||||
it("Zählung ohne Gruppen und Lage-Marker", () => {
|
||||
const sel = mergeSelection(EMPTY_SELECTION, { walls: [w[0]], groups: ["g"], site: ["sunStudy"] });
|
||||
expect(selectedCount(sel)).toBe(1);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,53 @@
|
||||
// [195] Mehrfachauswahl im Objekteinstellungs-Fenster: gemeinsamer Wert einer Eigenschaft über alle gewählten
|
||||
// Elemente. Weichen die Werte ab, zeigt das Feld nichts („gemischt"); eine Änderung gilt für alle.
|
||||
|
||||
import type { Project } from "../model/types";
|
||||
import { ELEMENT_KINDS, type Selection, type SelectionKind } from "./selection";
|
||||
import { deriveSelection } from "./selectionInfo";
|
||||
|
||||
/** Gemeinsamer Wert (`value`) oder `mixed`, wenn die Werte abweichen. Leere Liste: weder Wert noch gemischt. */
|
||||
export interface Common<T> {
|
||||
value: T | undefined;
|
||||
mixed: boolean;
|
||||
}
|
||||
|
||||
export function commonValue<T>(values: readonly T[]): Common<T> {
|
||||
if (values.length === 0) return { value: undefined, mixed: false };
|
||||
const first = values[0];
|
||||
return values.every((v) => v === first) ? { value: first, mixed: false } : { value: undefined, mixed: true };
|
||||
}
|
||||
|
||||
/** Arten, deren Stift (Farbe, Strichstärke) das Fenster für alle gewählten Elemente setzt. */
|
||||
export const STYLE_KINDS: readonly SelectionKind[] = ["walls", "ceilings", "drawings"];
|
||||
|
||||
/** Obergrenze, damit eine riesige Auswahl das Fenster nicht ausbremst (je Element eine Kern-Abfrage). */
|
||||
const MAX_COMPARED = 200;
|
||||
|
||||
export interface SelectionAppearance {
|
||||
/** Anzahl gewählter Elemente (ohne gemeinsame Gruppen/Lage-Marker). */
|
||||
count: number;
|
||||
weightMm: Common<number>;
|
||||
color: Common<string>;
|
||||
}
|
||||
|
||||
/** Zahl der gewählten Elemente (ohne Gruppen, Schnittlinien, Lage-Darstellung, Bäume). */
|
||||
export function selectedCount(sel: Selection): number {
|
||||
return ELEMENT_KINDS.filter((k) => k !== "sectionLines" && k !== "site" && k !== "trees").reduce((n, k) => n + sel[k].length, 0);
|
||||
}
|
||||
|
||||
/** Effektive Strichstärke und Farbe über die gewählten Wände/Decken/2D-Elemente. */
|
||||
export function selectionAppearance(project: Project, sel: Selection): SelectionAppearance {
|
||||
const weights: number[] = [];
|
||||
const colors: string[] = [];
|
||||
let n = 0;
|
||||
for (const kind of STYLE_KINDS) {
|
||||
for (const id of sel[kind]) {
|
||||
if (n++ >= MAX_COMPARED) break;
|
||||
const info = deriveSelection(project, { [kind]: [id] });
|
||||
if (!info) continue;
|
||||
weights.push(info.weightMm);
|
||||
colors.push(info.color);
|
||||
}
|
||||
}
|
||||
return { count: selectedCount(sel), weightMm: commonValue(weights), color: commonValue(colors) };
|
||||
}
|
||||
+10
-13
@@ -1,9 +1,10 @@
|
||||
// [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`).
|
||||
// [195] Taste T (wie Archicad Cmd+T): das Fenster „Objekteinstellungen" öffnen (schwebendes Panel `object-settings`,
|
||||
// folgt der Auswahl; Bereiche Objekt + Darstellung). Der passende Abschnitt des Bereichs Objekt wird aufgeklappt
|
||||
// und fokussiert; ohne Auswahl die Voreinstellung des aktiven Werkzeugs (Wand/Decke: Typ des neuen Bauteils), sonst
|
||||
// nichts. Die Zuordnung Auswahl → Abschnitt ist rein (`panels/objectInfo/groups.ts::objectSettingsTarget`).
|
||||
|
||||
import { objectSettingsTarget } from "../panels/objectInfo/groups";
|
||||
import { setSettingsArea } from "../panels/objectSettings/areaState";
|
||||
import { expandAndFocusInfoGroup } from "../panels/objectInfo/infoGroupState";
|
||||
import { getState } from "./appStore";
|
||||
import { selectionInfoFor } from "./useSelectionInfo";
|
||||
@@ -11,9 +12,8 @@ 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;
|
||||
/** Fenster Objekteinstellungen sichtbar machen (schwebend öffnen bzw. nach vorne holen). */
|
||||
revealObjectSettings: () => void;
|
||||
}
|
||||
|
||||
/** Öffnet die Einstellungen; `false`, wenn es nichts zu öffnen gibt. */
|
||||
@@ -23,15 +23,12 @@ export function openObjectSettings(deps: ObjectSettingsDeps): boolean {
|
||||
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 };
|
||||
target = { group: selection.sectionLines.length > 0 ? "sectionLine" : null };
|
||||
}
|
||||
if (!target) return false;
|
||||
if (target.kind === "opening") {
|
||||
deps.openOpeningEditor(target.id);
|
||||
return true;
|
||||
}
|
||||
setSettingsArea("object");
|
||||
if (target.group) expandAndFocusInfoGroup(target.group);
|
||||
deps.revealObjectInfo();
|
||||
deps.revealObjectSettings();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
// der gewählten Elemente und die Geometrie-Felder freier 2D-Elemente (Linie, Kreis, Bogen, Text).
|
||||
|
||||
import { applyFillMode } from "../fillMode";
|
||||
import { cmdMutation, opsMutation, patchItem } from "../../core";
|
||||
import { cmdMutation, opsMutation, patchItem, patchItems } from "../../core";
|
||||
import { getState } from "../appStore";
|
||||
import { STYLE_KINDS } from "../mixedValues";
|
||||
import { resolvePenColor } from "../../model/penSets";
|
||||
import type { TransformSelection } from "../../tools/transform";
|
||||
import type { FlatHostOpts, HostPart } from "./types";
|
||||
@@ -34,11 +36,28 @@ function singleTransformSel(kind: string, id: string): TransformSelection | null
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Mindestens ein Element der Arten mit Stift (Wand, Decke, 2D) gewählt ([195]: ein Pfad für eines und mehrere). */
|
||||
function multiStyle(): boolean {
|
||||
const s = getState().selection;
|
||||
return STYLE_KINDS.reduce((n, k) => n + s[k].length, 0) > 0;
|
||||
}
|
||||
|
||||
/** coalesceKey je Auswahl: Tippen in einem Feld = ein Undo-Schritt, ein Wechsel der Auswahl beginnt einen neuen. */
|
||||
function styleKey(s: { walls: string[]; ceilings: string[]; drawings: string[] }): string {
|
||||
return [...s.walls, ...s.ceilings, ...s.drawings].join(",");
|
||||
}
|
||||
|
||||
export function buildSelectionStyleHost(c: FlatHostOpts) {
|
||||
const { addColorToCustomPalette, applyChange, commitTransformOn, project, resizeElement, selection, setElementBackground, setElementColor, setElementFill, setElementFillColor, setElementForeground, setElementWeight, setProject, updateCeiling, updateDrawing2D, updateOpening, updateRoof, updateRoom, updateStair, updateWall } = c;
|
||||
return {
|
||||
onSetSelectionColor: (color) => {
|
||||
if (!selection) return;
|
||||
// [195] Farbe für alle gewählten Wände/Decken/2D-Elemente, ein Undo-Schritt.
|
||||
if (multiStyle()) {
|
||||
const s = getState().selection;
|
||||
applyChange((p) => [...patchItems(p, "walls", s.walls, (e) => ({ ...e, color })), ...patchItems(p, "ceilings", s.ceilings, (e) => ({ ...e, color })), ...patchItems(p, "drawings2d", s.drawings, (e) => ({ ...e, color }))], `sel-color:${styleKey(s)}`);
|
||||
return;
|
||||
}
|
||||
if (selection.kind === "wall" || selection.kind === "drawing2d")
|
||||
setElementColor(selection.kind, selection.id, color);
|
||||
else if (selection.kind === "ceiling")
|
||||
@@ -66,6 +85,12 @@ export function buildSelectionStyleHost(c: FlatHostOpts) {
|
||||
else if (selection.kind === "room") updateRoom(selection.id, patch);
|
||||
},
|
||||
onSetSelectionWeight: (weightMm) => {
|
||||
// [195] Für alle gewählten Wände/Decken/2D-Elemente; Tippen = ein Undo-Schritt (coalesceKey).
|
||||
if (multiStyle()) {
|
||||
const s = getState().selection;
|
||||
applyChange((p) => [...patchItems(p, "walls", s.walls, (e) => ({ ...e, strokeWeight: weightMm })), ...patchItems(p, "ceilings", s.ceilings, (e) => ({ ...e, strokeWeight: weightMm })), ...patchItems(p, "drawings2d", s.drawings, (e) => ({ ...e, weightMm }))], `sel-weight:${styleKey(s)}`);
|
||||
return;
|
||||
}
|
||||
// Strichstärke-Override: Wand/Decke (`strokeWeight`) oder Drawing2D (`weightMm`).
|
||||
if (selection?.kind === "wall") updateWall(selection.id, { strokeWeight: weightMm });
|
||||
else if (selection?.kind === "ceiling")
|
||||
|
||||
@@ -56,6 +56,8 @@ declare global {
|
||||
viewCamera: () => { levelId: string; center: { x: number; y: number } | null; pxPerMeter: number | null; scale: number };
|
||||
/** [192] Sichtbare Ebenen-Codes und Zahl der Plan-Primitive (gesamt / mit Wand-Bezug) der aktiven Ebene. */
|
||||
layerView: () => { wallId: string; visible: string[]; prims: number; wallPrims: number };
|
||||
/** [195] Strichstärke-Override der Wände (id → mm), nur gesetzte. */
|
||||
wallWeights: () => Record<string, number>;
|
||||
/** [185] 3D-Element-Filter (Store) und die Wand-ids des 3D-Modells bzw. der Pick-Geometrie mit ihm. */
|
||||
view3d: () => { only: string[] | null; hidden: string[]; walls: string[]; pickWalls: string[] };
|
||||
};
|
||||
@@ -93,6 +95,7 @@ export function installTestHooks(): void {
|
||||
openings: (p.openings ?? []).map((o) => ({ id: o.id, sillHeight: o.sillHeight, height: o.height })),
|
||||
};
|
||||
},
|
||||
wallWeights: () => Object.fromEntries(getState().project.walls.flatMap((w) => (w.strokeWeight === undefined ? [] : [[w.id, w.strokeWeight]]))),
|
||||
select: (patch) => getState().setSelection(patch),
|
||||
dimPts: (id) => {
|
||||
const g = getState().project.drawings2d.find((d) => d.id === id)?.geom;
|
||||
|
||||
@@ -8817,3 +8817,51 @@ body {
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Objekteinstellungen-Fenster ([195]): Bereiche Objekt / Darstellung ───────────────── */
|
||||
.objset-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
}
|
||||
.objset-tabs {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
padding: 6px 8px 0;
|
||||
border-bottom: 1px solid var(--line);
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.objset-tab {
|
||||
padding: 4px 12px;
|
||||
border: 0;
|
||||
border-bottom: 2px solid transparent;
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
font: inherit;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.objset-tab:hover {
|
||||
color: var(--label);
|
||||
}
|
||||
.objset-tab[aria-selected="true"] {
|
||||
color: var(--label);
|
||||
font-weight: 600;
|
||||
border-bottom-color: var(--accent);
|
||||
}
|
||||
.objset-body {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.objset-empty {
|
||||
color: var(--muted);
|
||||
padding: 16px 8px;
|
||||
text-align: center;
|
||||
}
|
||||
.attr-mixed {
|
||||
color: var(--muted);
|
||||
font-size: 11px;
|
||||
font-style: italic;
|
||||
}
|
||||
Reference in new issue
Block a user