[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:
22 files changed
+790
-37
No files matched your search
@@ -1,7 +1,7 @@
|
||||
// [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 { commonValue, selectionAppearance, selectionWallValues, selectedCount } from "./mixedValues";
|
||||
import { EMPTY_SELECTION, mergeSelection } from "./selection";
|
||||
|
||||
describe("commonValue [195]", () => {
|
||||
@@ -37,3 +37,26 @@ describe("selectionAppearance [195]", () => {
|
||||
expect(selectedCount(sel)).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Mehrfachwerte Füllung/Typ/Masse [195b]", () => {
|
||||
const p = buildComplexSampleProject();
|
||||
const [a, b] = p.walls;
|
||||
const other = p.wallTypes.find((t) => t.id !== a.wallTypeId)!;
|
||||
const same = { ...p, walls: p.walls.map((w) => (w.id === b.id ? { ...w, wallTypeId: a.wallTypeId } : w)) };
|
||||
const sel = mergeSelection(EMPTY_SELECTION, { walls: [a.id, b.id] });
|
||||
|
||||
it("gleicher Wandtyp → ein Wert; anderer Typ → Typ gemischt", () => {
|
||||
const v = selectionWallValues(same, sel);
|
||||
expect(v.wallTypeId).toEqual({ value: a.wallTypeId, mixed: false });
|
||||
expect(v.thickness.mixed).toBe(false);
|
||||
const changed = { ...p, walls: p.walls.map((w) => (w.id === b.id ? { ...w, wallTypeId: other.id } : w)) };
|
||||
expect(selectionWallValues(changed, sel).wallTypeId.mixed).toBe(true);
|
||||
});
|
||||
|
||||
it("Schraffur: gleich → Wert, abweichend → gemischt", () => {
|
||||
expect(selectionAppearance(same, sel).hatch.mixed).toBe(false);
|
||||
const [h1, h2] = p.hatches.filter((x) => x.pattern !== "none");
|
||||
const changed = { ...same, walls: same.walls.map((w) => (w.id === a.id ? { ...w, hatchId: h1.id } : w.id === b.id ? { ...w, hatchId: h2.id } : w)) };
|
||||
expect(selectionAppearance(changed, sel).hatch.mixed).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user