Eng-council sweep: export hygiene, dead code, helper dedup, declare vega-expression

This commit is contained in:
2026-06-12 19:39:54 +03:00
parent f26ac66633
commit 0e225d7d5c
26 changed files with 89 additions and 98 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ export function resnapshot(): void {
}
/** True when the active modal's editable state differs from its baseline. */
export function hasUnsavedChanges(): boolean {
function hasUnsavedChanges(): boolean {
const name = useAppStore.getState().activeModal;
if (!name) return false;
const current = snapshotOf(name);
+2 -7
View File
@@ -34,6 +34,7 @@ import { useChartBuilderStore } from '../stores/ChartBuilderStore';
import { useDatasetStore } from '../stores/DatasetStore';
import { useSnippetStore } from '../stores/SnippetStore';
import {
currentHash,
pushView,
readView,
replaceView,
@@ -72,7 +73,7 @@ export function deriveViewState(): ViewState {
/** True when `view` already matches the current URL hash. */
function isCurrent(view: ViewState): boolean {
return serializeHash(view) === window.location.hash;
return serializeHash(view) === currentHash();
}
/**
@@ -174,12 +175,6 @@ export function startRouting(): void {
useChartBuilderStore.subscribe(syncUrlFromState);
}
/** Test seam: reset the module's start/applying flags between cases. */
export function resetRoutingForTest(): void {
started = false;
applying = false;
}
// --- Coordinator seam (unchanged call sites) -------------------------------
// The coordinator calls these on modal open/close; both now just re-derive the
// hash from state. Kept as named exports so ModalCoordinator needs no edit.