Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -47,6 +47,30 @@ function savePlacement(fileName: string, fineTuning: FineTuning) {
|
||||
} catch {}
|
||||
}
|
||||
|
||||
// ── Visibility (selection-based hide/isolate) persistence ────────────
|
||||
const VISIBILITY_KEY = 'tsxr_visibility_v1';
|
||||
interface StoredVisibility { hidden: string[]; isolated: string[] | null; }
|
||||
function loadVisibilityMap(): Record<string, StoredVisibility> {
|
||||
try {
|
||||
const raw = localStorage.getItem(VISIBILITY_KEY);
|
||||
if (raw) return JSON.parse(raw);
|
||||
} catch {}
|
||||
return {};
|
||||
}
|
||||
function saveVisibility(fileName: string, hidden: Set<string>, isolated: Set<string> | null) {
|
||||
try {
|
||||
const all = loadVisibilityMap();
|
||||
all[fileName] = { hidden: [...hidden], isolated: isolated ? [...isolated] : null };
|
||||
localStorage.setItem(VISIBILITY_KEY, JSON.stringify(all));
|
||||
} catch {}
|
||||
}
|
||||
function loadVisibility(fileName: string): { hidden: Set<string>; isolated: Set<string> | null } {
|
||||
const v = loadVisibilityMap()[fileName];
|
||||
if (!v) return { hidden: new Set(), isolated: null };
|
||||
return { hidden: new Set(v.hidden ?? []), isolated: v.isolated ? new Set(v.isolated) : null };
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface ScaleRatio {
|
||||
label: string; // e.g. "1:50", "2:1", "1:1"
|
||||
|
||||
Reference in New Issue
Block a user