mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 02:02:33 +00:00
Eng-council sweep: export hygiene, dead code, helper dedup, declare vega-expression
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user