[208] [253] [255] UI-Review: Flächentabelle ohne Querscrollen (Zeilenkarten), Fundstelle im Anonymitäts-Dialog lesbar, Baurecht-Blatt-Tabelle mit kurzen Köpfen, Objekt-Palette höher und Gruppen merken Zustand

This commit is contained in:
Claude committed 2026-11-14 09:53:41 +00:00
1 parent a098ac54a7
commit 7ab04d4fc0
11 files changed
+335 -16

No files matched your search

+2 -2
View File
@@ -73,11 +73,11 @@ export function AreaTableSection() {
{r.cells.map((c, ci) =>
typeof c === "string" ? (
// Kurze Textzellen in Zahlenspalten (Strich, ja/nein) stehen wie die Zahlen rechts.
<td key={ci} className={ci > 0 && c.length <= 4 ? "num" : undefined}>
<td key={ci} data-label={ci > 0 ? s.columns[ci] : undefined} className={ci > 0 && c.length <= 4 ? "num" : undefined}>
{c}
</td>
) : (
<td key={ci} className="num">
<td key={ci} data-label={ci > 0 ? s.columns[ci] : undefined} className="num">
{c.n === null ? "–" : c.n.toFixed(c.d)}
</td>
),
+26 -2
View File
@@ -2,7 +2,7 @@
// mit Vorschau-Symbol je Objekt. Klick wählt das Objekt und startet den Befehl `libobj` (Einfügepunkt klicken,
// R = drehen, M = spiegeln). Der Katalog kommt aus dem Rust-Kern; die Vorschau zeichnet der Kern (grob).
import { useMemo } from "react";
import { useMemo, useState } from "react";
import { t } from "../i18n";
import type { TranslationKey } from "../i18n";
import { usePanelHostAction } from "./host";
@@ -43,7 +43,31 @@ function Preview({ def }: { def: LibObjectDef }) {
);
}
const OPEN_KEY = "cad.objlib.open";
/** Gemerkter Zustand der Gruppen (offen/zu) je Gruppen-Schlüssel; leer, wenn nichts gespeichert ist. */
function loadOpen(): Record<string, boolean> {
try {
const raw = localStorage.getItem(OPEN_KEY);
const v: unknown = raw ? JSON.parse(raw) : null;
return v && typeof v === "object" ? (v as Record<string, boolean>) : {};
} catch {
return {};
}
}
export function ObjectLibraryPanel() {
const [open, setOpen] = useState<Record<string, boolean>>(loadOpen);
const setGroupOpen = (g: string, v: boolean) =>
setOpen((o) => {
const next = { ...o, [g]: v };
try {
localStorage.setItem(OPEN_KEY, JSON.stringify(next));
} catch {
/* Speicher gesperrt: der Zustand gilt nur für diese Sitzung */
}
return next;
});
const onRunCommand = usePanelHostAction("onRunCommand");
const catalog = useMemo(() => libCatalog(), []);
const groups = useMemo(() => libGroups(), []);
@@ -60,7 +84,7 @@ export function ObjectLibraryPanel() {
<div className="objlib-panel" style={{ overflowY: "auto", padding: "6px 8px" }}>
<div style={{ fontSize: 11, color: "var(--muted)", marginBottom: 6 }}>{t("lib.hint")}</div>
{groups.map((g) => (
<details key={g} open={g === groups[0]} style={{ marginBottom: 4 }}>
<details key={g} open={open[g] ?? g === groups[0]} onToggle={(e) => { const v = e.currentTarget.open; if (v !== (open[g] ?? g === groups[0])) setGroupOpen(g, v); }} style={{ marginBottom: 4 }}>
<summary style={{ cursor: "pointer", fontSize: 12, fontWeight: 600, padding: "3px 0" }}>{t(`lib.g.${g}` as TranslationKey)}</summary>
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(72px, 1fr))", gap: 4, padding: "4px 0" }}>
{catalog.objects
+3 -2
View File
@@ -46,7 +46,8 @@ import type {
// v13 ([238]): rechts oben (Objekt-Info/Flächenbilanz) bekommt mehr Höhe: Gewichte 1,6 : 1 statt 1 : 1,5 (die
// Flächenbilanz mit Raumprogramm war nur ~300 px hoch). Die Höhe merkt sich der Gruppen-Splitter (`resizeGroups`).
// v14 ([253]): Objekt-Bibliothek ("object-library") als Tab neben den Werkzeugen links oben.
export const LAYOUT_VERSION = 14;
// v15 ([253]): links oben (Werkzeuge/Objekte) bekommt mehr Höhe: Gewichte 1,6 : 1 (die Objekt-Palette war im 900-px-Fenster nur ~270 px hoch).
export const LAYOUT_VERSION = 15;
/** localStorage-Schlüssel des zuletzt benutzten Layouts. */
const CURRENT_KEY = "cad.layout";
@@ -74,7 +75,7 @@ const NAMED_PREFIX = "cad.layouts.";
// der Attribute-Palette darunter (Vectorworks-Bild). Das Ribbon-Band bleibt als
// Reiter erreichbar, ist aber nicht mehr der primäre Weg zu den Werkzeugen.
const DEFAULT_LEFT_GROUPS: DockGroup[] = [
{ tabs: ["tools", "object-library"], activeTab: "tools", weight: 1 },
{ tabs: ["tools", "object-library"], activeTab: "tools", weight: 1.6 },
{ tabs: ["attributes"], activeTab: "attributes", weight: 1 },
];
const DEFAULT_RIGHT_GROUPS: DockGroup[] = [