[239] Objekt-Info: Bezugspunkt, Masse, Gelände-Einstellungen und Georeferenzierung als einklappbare Abschnitte (Zustand je Art im localStorage, Georeferenzierung standardmässig zu)
This commit is contained in:
8 files changed
+180
-58
No files matched your search
@@ -10,7 +10,7 @@ Wer zu einer ID mehr wissen will (Entscheide, Tests, Bilder), sucht dort nach `*
|
||||
stehen im Archiv („Bewusst nicht übernommen“).
|
||||
- **Grösse** (eine Person mit Agenten): S ≤ 1 Tag · M ≤ 1 Woche · L ≤ 1 Monat · XL > 1 Monat.
|
||||
Steht keine Grösse im Archiv, ist sie hier geschätzt.
|
||||
- **IDs sind stabil.** Neue ID = nächste freie Zahl nach der höchsten im Archiv und hier (aktuell 236);
|
||||
- **IDs sind stabil.** Neue ID = nächste freie Zahl nach der höchsten im Archiv und hier (aktuell 239);
|
||||
nie eine ID wiederverwenden oder umnummerieren. Präfix-IDs (`[K]`, `[G]`, `[T]`, `[B]`, `[C]`) bleiben.
|
||||
- **Pro Punkt:** was fehlt · wo im Code · Grösse. Höchstens ein bis drei Sätze je Punkt;
|
||||
Messwerte und Befunde gehören in den Commit.
|
||||
@@ -243,6 +243,15 @@ Kennwort, anonym) als PDF; Austausch mit Fachplanern über DXF/IFC.
|
||||
`add_textures`: keine Normalenkarte, stattdessen Rauigkeitskarte als Höhenfeld (Bump, Stärke 0.3, rahmenfrei). Test:
|
||||
`blenderRender.test.ts` (Skript ohne Normal-Map-Knoten). Geprüft: echter Lauf `bpy` 5.3 (CPU) vorher/nachher. Offen: Mac/Blender 3.6/4.x;
|
||||
echte Normalenkarten bräuchten UVs im GLB-Export. · S
|
||||
- ✓ **[239]** Objekt-Info mit einklappbaren Abschnitten durchgängig (13.11., UI-Sichtprüfung): Wand/Decke/Dach … waren schon Gruppen ([189]), aber
|
||||
Bezugspunkt, Masse und beim Gelände Einstellungen (Material, Höhenversatz, Netzpunkt, Zuschneiden) + Georeferenzierung (LV95) waren feste
|
||||
Blöcke — beim Gelände musste man scrollen. Jetzt alle `InfoGroup` (Klick/Enter/Leertaste auf den Kopf, Pfeil, `aria-expanded`); neue Gruppen
|
||||
`refpoint`, `dimensions`, `contextProps`, `georef` (`objectInfo/groups.ts`). Zustand je Abschnitts-Art in localStorage `dossier.objinfo.groups`
|
||||
(nur Abweichungen vom Standard; `infoGroupState.ts`), nicht im Projekt. Standard: alles offen ausser „Georeferenzierung“ (`georef`: Herkunft +
|
||||
LV95 — reine Auskunft, selten gebraucht, Kopf bleibt sichtbar); Bedienbares und Masse bleiben offen. Das Fenster Objekteinstellungen nutzt
|
||||
dasselbe `ObjectInfoPanel` (ohne Bezugspunkt/Masse) und damit dieselben Gruppen und denselben Zustand. Geprüft: vitest `src/panels src/ui
|
||||
src/i18n` (neu `infoGroupState.test.ts`), tsc, e2e objectSettings/objectSettingsWindow/roomStamp218, Screenshots hell/dunkel (Gelände,
|
||||
Wand; Tastatur Enter/Leertaste). Nicht geprüft: Mac/Tauri, natives Nebenfenster. · S
|
||||
- ✓ **[235]** `update-dossier` brach nach der Commit-Liste stumm ab (13.11., Maintainer, Void): `git log … | head -20` lieferte bei mehr als 20 neuen
|
||||
Commits SIGPIPE, mit `set -euo pipefail` endete das Skript ohne Meldung — weder WASM noch AppImage wurden gebaut, `dossier` startete das alte
|
||||
AppImage. Lösung: `git log -20`; `dossier` warnt, wenn das AppImage älter ist als der Checkout. Geprüft: Ursache nachgestellt (Exit 141), Syntax. · S
|
||||
|
||||
@@ -969,6 +969,7 @@ export const de = {
|
||||
// ── Extrusions-Attribute (truck-Integration, Object-Info-Panel) ─────────
|
||||
"objinfo.sectionLine.section": "Schnittlinie",
|
||||
"objinfo.dimText.section": "Masszahl",
|
||||
"objinfo.contextObject.props": "Einstellungen",
|
||||
"objinfo.group.toggle": "Abschnitt ein-/ausklappen",
|
||||
"objinfo.detailRef.section": "Detail-/Schnitt-Verweis",
|
||||
"objinfo.dimRefs.section": "Assoziative Bemassung",
|
||||
|
||||
@@ -965,6 +965,7 @@ export const en: Record<TranslationKey, string> = {
|
||||
// ── Extruded solid attributes (truck integration, object info panel) ────
|
||||
"objinfo.sectionLine.section": "Section line",
|
||||
"objinfo.dimText.section": "Dimension text",
|
||||
"objinfo.contextObject.props": "Settings",
|
||||
"objinfo.group.toggle": "Expand/collapse section",
|
||||
"objinfo.detailRef.section": "Detail/section reference",
|
||||
"objinfo.dimRefs.section": "Associative dimension",
|
||||
|
||||
@@ -36,6 +36,7 @@ import { ViewShadowsInfo, MeasurementSection } from "./objectInfo/InfoBlocks";
|
||||
import { DimensionField, RotateField } from "./objectInfo/fields";
|
||||
import { elementDimensions } from "./objectInfo/elementDims";
|
||||
import { InfoGroups, hasInfoGroups } from "./objectInfo/InfoGroups";
|
||||
import { InfoGroup } from "./objectInfo/InfoGroup";
|
||||
|
||||
// ── Bezugspunkt-Raster ───────────────────────────────────────────────────────
|
||||
// Neun Anker als 3×3-Raster. Zeile 0 = oben (fy=0), Spalte 0 = links (fx=0).
|
||||
@@ -193,10 +194,9 @@ export function ObjectInfoPanel({ showPlacement = true }: { showPlacement?: bool
|
||||
|
||||
{showPlacement && (
|
||||
<>
|
||||
<div className="objinfo-sep" />
|
||||
<InfoGroup id="refpoint">
|
||||
{/* Bezugspunkt-Würfel (3×3, immer quadratisch) links, X/Y/Z als Spalte
|
||||
rechts daneben (Nutzer-Wunsch). */}
|
||||
<div className="objinfo-section-label">{t("objinfo.refpoint")}</div>
|
||||
<div className="objinfo-refrow">
|
||||
<div className="objinfo-cube" role="group" aria-label={t("objinfo.refpoint")}>
|
||||
{FRACTIONS.map((fy) =>
|
||||
@@ -248,11 +248,10 @@ export function ObjectInfoPanel({ showPlacement = true }: { showPlacement?: bool
|
||||
<RotateField onCommit={(deg) => host.onRotateSelectionAround(px, py, deg)} />
|
||||
</div>
|
||||
</div>
|
||||
</InfoGroup>
|
||||
|
||||
<div className="objinfo-sep" />
|
||||
|
||||
<InfoGroup id="dimensions">
|
||||
{/* Maße (editierbar) — Commit auf blur/Enter skaliert um den Anker. */}
|
||||
<div className="objinfo-section-label">{t("objinfo.dimensions")}</div>
|
||||
{elementDims ? (
|
||||
// [204a] Wand: Länge/Dicke/Höhe, Öffnung: Breite/Höhe/Brüstung (nur Anzeige).
|
||||
elementDims.map((d) => (
|
||||
@@ -352,6 +351,7 @@ export function ObjectInfoPanel({ showPlacement = true }: { showPlacement?: bool
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</InfoGroup>
|
||||
</>
|
||||
)}
|
||||
{/* Gelände-/Umgebungs-Element (Netzkörper, Gelände, Höhenlinien …): Art, Herkunft (nur Auskunft, [181]),
|
||||
@@ -359,39 +359,42 @@ export function ObjectInfoPanel({ showPlacement = true }: { showPlacement?: bool
|
||||
georeferenziert importiert wurde (Nutzer-Wunsch zum Prüfen). */}
|
||||
{sel.contextObject && (
|
||||
<>
|
||||
<div className="objinfo-sep" />
|
||||
<div className="objinfo-section-label">{t("objinfo.contextObject.section")}</div>
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.contextObject.type")}</span>
|
||||
<span className="objinfo-fval">{t(`objinfo.contextObject.type.${sel.contextObject.objType}`)}</span>
|
||||
</div>
|
||||
{sel.contextObject.source && (
|
||||
<InfoGroup id="contextProps">
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.contextObject.source")}</span>
|
||||
<span className="objinfo-fval" data-testid="context-source">{sel.contextObject.source}</span>
|
||||
<span className="objinfo-flabel">{t("objinfo.contextObject.type")}</span>
|
||||
<span className="objinfo-fval">{t(`objinfo.contextObject.type.${sel.contextObject.objType}`)}</span>
|
||||
</div>
|
||||
)}
|
||||
{ctxObj && (
|
||||
<div className="site-panel objinfo-site">
|
||||
<ContextObjectProps obj={ctxObj} quantities={quantities} />
|
||||
</div>
|
||||
)}
|
||||
{sel.contextObject.lv95Center ? (
|
||||
<>
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.contextObject.lv95E")}</span>
|
||||
<span className="objinfo-fval">{sel.contextObject.lv95Center.e.toFixed(1)}</span>
|
||||
{ctxObj && (
|
||||
<div className="site-panel objinfo-site">
|
||||
<ContextObjectProps obj={ctxObj} quantities={quantities} />
|
||||
</div>
|
||||
)}
|
||||
</InfoGroup>
|
||||
{/* [239] Herkunft und LV95 stehen in eigener Gruppe (Standard zugeklappt: nur Auskunft). */}
|
||||
<InfoGroup id="georef">
|
||||
{sel.contextObject.source && (
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.contextObject.lv95N")}</span>
|
||||
<span className="objinfo-fval">{sel.contextObject.lv95Center.n.toFixed(1)}</span>
|
||||
<span className="objinfo-flabel">{t("objinfo.contextObject.source")}</span>
|
||||
<span className="objinfo-fval" data-testid="context-source">{sel.contextObject.source}</span>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-fval objinfo-muted">{t("objinfo.contextObject.noAnchor")}</span>
|
||||
</div>
|
||||
)}
|
||||
)}
|
||||
{sel.contextObject.lv95Center ? (
|
||||
<>
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.contextObject.lv95E")}</span>
|
||||
<span className="objinfo-fval">{sel.contextObject.lv95Center.e.toFixed(1)}</span>
|
||||
</div>
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-flabel">{t("objinfo.contextObject.lv95N")}</span>
|
||||
<span className="objinfo-fval">{sel.contextObject.lv95Center.n.toFixed(1)}</span>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div className="objinfo-field">
|
||||
<span className="objinfo-fval objinfo-muted">{t("objinfo.contextObject.noAnchor")}</span>
|
||||
</div>
|
||||
)}
|
||||
</InfoGroup>
|
||||
</>
|
||||
)}
|
||||
{/* [189] Bauteil-/BIM-Abschnitte (Wand, Decke, Öffnung, Treppe, Raum …) als einklappbare Gruppen. */}
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
import { useEffect, useRef, useSyncExternalStore, type ReactNode } from "react";
|
||||
import { t } from "../../i18n";
|
||||
import { INFO_GROUP_TITLE, type InfoGroupId } from "./groups";
|
||||
import { clearInfoGroupFocus, getInfoGroupState, subscribeInfoGroups, toggleInfoGroup } from "./infoGroupState";
|
||||
import { clearInfoGroupFocus, getInfoGroupState, isInfoGroupOpen, subscribeInfoGroups, toggleInfoGroup } from "./infoGroupState";
|
||||
|
||||
export function InfoGroup({ id, children }: { id: InfoGroupId; children: ReactNode }) {
|
||||
const st = useSyncExternalStore(subscribeInfoGroups, getInfoGroupState, getInfoGroupState);
|
||||
const open = !st.collapsed.has(id);
|
||||
const open = isInfoGroupOpen(st, id);
|
||||
const head = useRef<HTMLButtonElement>(null);
|
||||
useEffect(() => {
|
||||
if (st.focus?.id !== id) return;
|
||||
|
||||
@@ -24,7 +24,12 @@ export type InfoGroupId =
|
||||
| "detailRef"
|
||||
| "dimRefs"
|
||||
| "dimText"
|
||||
| "grid";
|
||||
| "grid"
|
||||
// [239] Abschnitte, die das Panel selbst hält (Platzierung, Masse, Gelände/Umgebung) — nicht in `infoGroups()`.
|
||||
| "refpoint"
|
||||
| "dimensions"
|
||||
| "contextProps"
|
||||
| "georef";
|
||||
|
||||
export const INFO_GROUP_TITLE: Record<InfoGroupId, TranslationKey> = {
|
||||
newComponent: "attr.newComponent",
|
||||
@@ -44,8 +49,18 @@ export const INFO_GROUP_TITLE: Record<InfoGroupId, TranslationKey> = {
|
||||
dimRefs: "objinfo.dimRefs.section",
|
||||
dimText: "objinfo.dimText.section",
|
||||
grid: "attr.grid.section",
|
||||
refpoint: "objinfo.refpoint",
|
||||
dimensions: "objinfo.dimensions",
|
||||
contextProps: "objinfo.contextObject.props",
|
||||
georef: "objinfo.contextObject.section",
|
||||
};
|
||||
|
||||
/**
|
||||
* [239] Standardmässig zugeklappt: nur Auskunft ohne Eingabe (Herkunft, LV95-Mittelpunkt) — selten gebraucht,
|
||||
* bei Geländen aber lang. Alles, was man bedient oder ständig prüft, bleibt offen. Der Kopf bleibt sichtbar.
|
||||
*/
|
||||
export const INFO_GROUP_DEFAULT_COLLAPSED: ReadonlySet<InfoGroupId> = new Set<InfoGroupId>(["georef"]);
|
||||
|
||||
export interface InfoGroupContext {
|
||||
sel: SelectionInfo | null;
|
||||
/** Gewählte 2D-Form ist ein Achsraster. */
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
// [239] Einklappbare Abschnitte der Objekt-Info: Standard, Merken je Abschnitts-Art, Fokus-Anfrage, Server-Render.
|
||||
import { createElement } from "react";
|
||||
import { renderToString } from "react-dom/server";
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import { buildComplexSampleProject } from "../../model/sampleProjectComplex";
|
||||
import { getState, setState } from "../../state/appStore";
|
||||
import { EMPTY_SELECTION } from "../../state/selection";
|
||||
import { PanelHostProvider } from "../host";
|
||||
import type { PanelHost } from "../types";
|
||||
import { ObjectInfoPanel } from "../ObjectInfoPanel";
|
||||
import { InfoGroup } from "./InfoGroup";
|
||||
import { INFO_GROUP_DEFAULT_COLLAPSED, type InfoGroupId } from "./groups";
|
||||
import {
|
||||
expandAndFocusInfoGroup, getInfoGroupState, isInfoGroupOpen, resetInfoGroupsForTest, toggleInfoGroup,
|
||||
} from "./infoGroupState";
|
||||
|
||||
const store = new Map<string, string>();
|
||||
beforeEach(() => {
|
||||
store.clear();
|
||||
(globalThis as unknown as { window: unknown }).window = {
|
||||
localStorage: { getItem: (k: string) => store.get(k) ?? null, setItem: (k: string, v: string) => void store.set(k, v) },
|
||||
};
|
||||
resetInfoGroupsForTest();
|
||||
});
|
||||
|
||||
const open = (id: InfoGroupId) => isInfoGroupOpen(getInfoGroupState(), id);
|
||||
|
||||
describe("Abschnitte einklappen [239]", () => {
|
||||
it("Standard: alles offen ausser der Auskunfts-Gruppe Georeferenzierung", () => {
|
||||
expect([...INFO_GROUP_DEFAULT_COLLAPSED]).toEqual(["georef"]);
|
||||
expect(open("wall")).toBe(true);
|
||||
expect(open("refpoint")).toBe(true);
|
||||
expect(open("georef")).toBe(false);
|
||||
});
|
||||
|
||||
it("Umschalten gilt je Abschnitts-Art und wird gemerkt (nur Abweichungen vom Standard)", () => {
|
||||
toggleInfoGroup("dimensions");
|
||||
toggleInfoGroup("georef");
|
||||
expect(open("dimensions")).toBe(false);
|
||||
expect(open("georef")).toBe(true);
|
||||
expect(open("wall")).toBe(true);
|
||||
expect(JSON.parse(store.get("dossier.objinfo.groups")!)).toEqual({ dimensions: false, georef: true });
|
||||
resetInfoGroupsForTest(true); // neues Fenster / neuer Start liest den Speicher
|
||||
expect(open("dimensions")).toBe(false);
|
||||
expect(open("georef")).toBe(true);
|
||||
toggleInfoGroup("dimensions"); // zurück auf Standard: kein Eintrag mehr
|
||||
expect(JSON.parse(store.get("dossier.objinfo.groups")!)).toEqual({ georef: true });
|
||||
});
|
||||
|
||||
it("Fokus-Anfrage (Taste T) klappt den Abschnitt auf", () => {
|
||||
toggleInfoGroup("wall");
|
||||
expect(open("wall")).toBe(false);
|
||||
expandAndFocusInfoGroup("wall");
|
||||
expect(open("wall")).toBe(true);
|
||||
expect(getInfoGroupState().focus?.id).toBe("wall");
|
||||
});
|
||||
|
||||
it("Kopf ist ein Knopf (Enter/Leertaste) mit aria-expanded; zugeklappt fehlt der Rumpf", () => {
|
||||
const html = () => renderToString(createElement(InfoGroup, { id: "dimensions", children: createElement("i", { id: "body" }) }));
|
||||
expect(html()).toMatch(/<button[^>]*aria-expanded="true"/);
|
||||
expect(html()).toContain('id="body"');
|
||||
toggleInfoGroup("dimensions");
|
||||
expect(html()).toMatch(/aria-expanded="false"/);
|
||||
expect(html()).not.toContain('id="body"');
|
||||
});
|
||||
|
||||
it("Objekt-Info: Bezugspunkt und Masse sind Abschnitte, zugeklappt bleibt der Kopf", () => {
|
||||
const p = buildComplexSampleProject();
|
||||
getState().loadProject(p);
|
||||
setState({ selection: { ...EMPTY_SELECTION, walls: [p.walls[0].id] } });
|
||||
const host = { activeTool: "select", sectionLine: null, displayMode: { mode: "all", setMode: () => {} } } as unknown as PanelHost;
|
||||
const html = () => renderToString(createElement(PanelHostProvider, { value: host }, createElement(ObjectInfoPanel)));
|
||||
expect(html()).toContain('data-group="refpoint"');
|
||||
expect(html()).toContain('data-group="dimensions"');
|
||||
expect(html()).toContain("objinfo-cube");
|
||||
toggleInfoGroup("refpoint");
|
||||
expect(html()).toContain('data-group="refpoint"');
|
||||
expect(html()).not.toContain("objinfo-cube");
|
||||
});
|
||||
});
|
||||
@@ -3,35 +3,41 @@
|
||||
// lesbar, damit der Tastendruck (`state/objectSettings.ts`) den Abschnitt auch öffnen kann, bevor das Panel
|
||||
// montiert ist.
|
||||
|
||||
import type { InfoGroupId } from "./groups";
|
||||
import { INFO_GROUP_DEFAULT_COLLAPSED, type InfoGroupId } from "./groups";
|
||||
|
||||
interface GroupState {
|
||||
collapsed: ReadonlySet<string>;
|
||||
/** Ausdrückliche Wahl je Abschnitt (true = offen); fehlt ein Eintrag, gilt der Standard. */
|
||||
overrides: Readonly<Record<string, boolean>>;
|
||||
/** Offene Fokus-Anfrage; die Gruppe löscht sie, sobald sie fokussiert hat. */
|
||||
focus: { id: InfoGroupId } | null;
|
||||
}
|
||||
|
||||
const KEY = "dossier.objinfo.collapsed";
|
||||
// [239] Standard je Abschnitts-Art: `INFO_GROUP_DEFAULT_COLLAPSED`; nur abweichende Wahlen werden gemerkt.
|
||||
const KEY = "dossier.objinfo.groups";
|
||||
|
||||
function load(): ReadonlySet<string> {
|
||||
function load(): Readonly<Record<string, boolean>> {
|
||||
try {
|
||||
const raw = window.localStorage.getItem(KEY);
|
||||
const arr: unknown = raw ? JSON.parse(raw) : [];
|
||||
return new Set(Array.isArray(arr) ? arr.filter((x): x is string => typeof x === "string") : []);
|
||||
const o: unknown = raw ? JSON.parse(raw) : {};
|
||||
const out: Record<string, boolean> = {};
|
||||
if (o && typeof o === "object" && !Array.isArray(o)) {
|
||||
for (const [k, v] of Object.entries(o)) if (typeof v === "boolean") out[k] = v;
|
||||
}
|
||||
return out;
|
||||
} catch {
|
||||
return new Set();
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function save(c: ReadonlySet<string>): void {
|
||||
function save(o: Readonly<Record<string, boolean>>): void {
|
||||
try {
|
||||
window.localStorage.setItem(KEY, JSON.stringify([...c]));
|
||||
window.localStorage.setItem(KEY, JSON.stringify(o));
|
||||
} catch {
|
||||
// Bestes Bemühen (Quota/privates Fenster).
|
||||
}
|
||||
}
|
||||
|
||||
let state: GroupState = { collapsed: load(), focus: null };
|
||||
let state: GroupState = { overrides: load(), focus: null };
|
||||
const listeners = new Set<() => void>();
|
||||
|
||||
function set(next: GroupState): void {
|
||||
@@ -39,6 +45,19 @@ function set(next: GroupState): void {
|
||||
for (const l of [...listeners]) l();
|
||||
}
|
||||
|
||||
/** Ob der Abschnitt offen ist: gemerkte Wahl, sonst Standard. */
|
||||
export function isInfoGroupOpen(st: GroupState, id: InfoGroupId): boolean {
|
||||
return st.overrides[id] ?? !INFO_GROUP_DEFAULT_COLLAPSED.has(id);
|
||||
}
|
||||
|
||||
function withOpen(id: InfoGroupId, open: boolean): Readonly<Record<string, boolean>> {
|
||||
const o = { ...state.overrides };
|
||||
if (open === !INFO_GROUP_DEFAULT_COLLAPSED.has(id)) delete o[id];
|
||||
else o[id] = open;
|
||||
save(o);
|
||||
return o;
|
||||
}
|
||||
|
||||
export function subscribeInfoGroups(l: () => void): () => void {
|
||||
listeners.add(l);
|
||||
return () => listeners.delete(l);
|
||||
@@ -49,25 +68,19 @@ export function getInfoGroupState(): GroupState {
|
||||
}
|
||||
|
||||
export function toggleInfoGroup(id: InfoGroupId): void {
|
||||
const c = new Set(state.collapsed);
|
||||
if (!c.delete(id)) c.add(id);
|
||||
save(c);
|
||||
set({ ...state, collapsed: c });
|
||||
set({ ...state, overrides: withOpen(id, !isInfoGroupOpen(state, id)) });
|
||||
}
|
||||
|
||||
/** Klappt den Abschnitt auf und bittet ihn, den Fokus zu nehmen (sobald er sichtbar ist). */
|
||||
export function expandAndFocusInfoGroup(id: InfoGroupId): void {
|
||||
const c = new Set(state.collapsed);
|
||||
c.delete(id);
|
||||
save(c);
|
||||
set({ collapsed: c, focus: { id } });
|
||||
set({ overrides: withOpen(id, true), focus: { id } });
|
||||
}
|
||||
|
||||
export function clearInfoGroupFocus(): void {
|
||||
if (state.focus) set({ ...state, focus: null });
|
||||
}
|
||||
|
||||
/** Nur für Tests. */
|
||||
export function resetInfoGroupsForTest(): void {
|
||||
state = { collapsed: new Set(), focus: null };
|
||||
/** Nur für Tests: Zustand zurücksetzen (ohne Speicher) bzw. neu aus dem Speicher laden. */
|
||||
export function resetInfoGroupsForTest(reload = false): void {
|
||||
state = { overrides: reload ? load() : {}, focus: null };
|
||||
}
|
||||
Reference in new issue
Block a user