[195b] Objekteinstellungen als natives Nebenfenster (Tauri), Spiegel-Store + Ops zurück

Unter Tauri öffnet T das Fenster „object-settings“ (wie Einstellungen/Ressourcen); Browser/Electron
behalten das schwebende Panel. Schlankste Lösung ohne Doppelspur: das Fenster lädt denselben Store als
Spiegel (Projekt per projectDelta + eigenes Kern-Dokument, Auswahl, aktive Ebene, Host-Wertfelder, Fokus
von T) und rendert unverändert ObjectSettingsPanel. Store-Änderungen rechnen dort ihre Ops auf dem Spiegel
und gehen über state/changeSink.ts ans Hauptfenster (applyChange, Undo je Änderung, coalesceKey bleibt);
Host-Handler per Proxy (remoteHost). Cmd+Z im Fenster wirkt auf den Verlauf des Hauptfensters.
Mehrfachwerte: Schraffur, Wandtyp/Dicke „gemischt“; Wandtyp gilt für alle gewählten Wände.
Nicht auf macOS gebaut/getestet (nur tsc/vitest im Linux-Container).
This commit is contained in:
Claude committed 2026-11-12 03:29:45 +00:00
1 parent 2119bbd51c
commit 2954a6d296
22 files changed
+790 -37

No files matched your search

+16 -12
View File
@@ -614,18 +614,22 @@ export function AttributesPanel() {
fillEditable,
hatchUi,
onHatchSourceChange,
<Dropdown
value={hatchPatternIsNone ? "" : sel.effectiveHatchId ?? ""}
disabled={!fillEditable}
onChange={(v) => host.onSetSelectionFill(v || null)}
options={[
{ value: "", label: t("attr.hatch.none") },
// Die Ressource „Ohne" (Muster none) wäre dasselbe wie „Keine Schraffur".
...project.hatches
.filter((h) => h.pattern !== "none")
.map((h) => ({ value: h.id, label: h.name })),
]}
/>,
<>
<Dropdown
value={hatchPatternIsNone ? "" : sel.effectiveHatchId ?? ""}
disabled={!fillEditable}
onChange={(v) => host.onSetSelectionFill(v || null)}
options={[
{ value: "", label: t("attr.hatch.none") },
// Die Ressource „Ohne" (Muster none) wäre dasselbe wie „Keine Schraffur".
...project.hatches
.filter((h) => h.pattern !== "none")
.map((h) => ({ value: h.id, label: h.name })),
]}
/>
{/* [195b] Mehrfachauswahl mit abweichender Schraffur. */}
{appearance.hatch.mixed && <span className="attr-mixed" data-mixed="hatch">{t("objsettings.mixed")}</span>}
</>,
)}
{/* Transparenz NUR der Füllung/Schraffurfläche (Umriss bleibt deckend);
+1 -1
View File
@@ -7,7 +7,7 @@ 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 st = useSyncExternalStore(subscribeInfoGroups, getInfoGroupState, getInfoGroupState);
const open = !st.collapsed.has(id);
const head = useRef<HTMLButtonElement>(null);
useEffect(() => {
+19 -5
View File
@@ -1,7 +1,9 @@
// Abschnitt „Wand" der Attribute ([165] aus `ObjectInfoPanel.tsx`): Referenzlinie, Aufbau, Geschoss, Unter-
// und Oberkante. Gerufen von `AttributesPanel`.
import { useMemo } from "react";
import { useStore } from "../../state/appStore";
import { selectionWallValues } from "../../state/mixedValues";
import type { WallInfo } from "../../state/selectionInfo";
import { usePanelHost } from "../host";
import { t } from "../../i18n";
@@ -22,6 +24,14 @@ export function WallSection({
host: ReturnType<typeof usePanelHost>;
}) {
const storeProject = useStore((st) => st.project);
const selection = useStore((st) => st.selection);
// [195b] Mehrfachauswahl: abweichender Typ/abweichende Dicke als „gemischt" kennzeichnen.
const multi = useMemo(
() => (selection.walls.length > 1 ? selectionWallValues(storeProject, selection) : null),
[storeProject, selection],
);
const mixedMark = (on: boolean | undefined, what: string) =>
on ? <span className="attr-mixed" data-mixed={what}>{t("objsettings.mixed")}</span> : null;
// Aufbau-Typ-Segment: einschichtig vs. mehrschichtig. Aus dem Modell
// abgeleitet (singleLayer); der Umschalter auf „mehrschichtig" wählt einen
// mehrschichtigen Wandtyp-Preset (erster mit >1 Schicht), auf „einschichtig"
@@ -134,11 +144,14 @@ export function WallSection({
{/* Einschichtig → Dicke-Zahlfeld. Mehrschichtig → Preset-Dropdown. */}
{isSingle ? (
<DimensionField
label={t("objinfo.wall.thickness")}
value={wall.thickness}
onCommit={(v) => host.onSetWallThickness(v)}
/>
<>
<DimensionField
label={t("objinfo.wall.thickness")}
value={wall.thickness}
onCommit={(v) => host.onSetWallThickness(v)}
/>
{mixedMark(multi?.thickness.mixed, "thickness")}
</>
) : (
<div className="objinfo-field">
<span className="objinfo-flabel">{t("objinfo.wall.preset")}</span>
@@ -153,6 +166,7 @@ export function WallSection({
title={t("objinfo.wall.preset")}
width={150}
/>
{mixedMark(multi?.wallTypeId.mixed, "wallType")}
</div>
)}
@@ -20,7 +20,7 @@ export function ObjectSettingsPanel() {
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 wanted = useSyncExternalStore(subscribeSettingsArea, getSettingsArea, getSettingsArea);
const areas = settingsAreas({
sel,