Files
ObsiGate/desktop/frontend-static/js/state.js
T
bruno 301c325af7
CI / lint (push) Successful in 25s
CI / security (push) Successful in 19s
CI / test (push) Successful in 29s
CI / build (push) Successful in 8s
CI / e2e (push) Failing after 21s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
Refactor frontend into ES modules with modern tooling
2026-07-26 10:29:19 -04:00

59 lines
1.4 KiB
JavaScript

/* ObsiGate — Shared mutable application state.
Use state.xxx to read/write any value. ES module imports are read-only,
so we export a single mutable object instead of individual let bindings. */
export const state = {
APP_VERSION: "1.5.0",
// Core navigation
currentVault: null,
currentPath: null,
allVaults: [],
selectedContextVault: "all",
// Search
searchTimeout: null,
searchAbortController: null,
advancedSearchOffset: 0,
advancedSearchTotal: 0,
advancedSearchSort: "relevance",
advancedSearchLastQuery: "",
suggestAbortController: null,
dropdownActiveIndex: -1,
dropdownItems: [],
currentSearchId: 0,
selectedTags: [],
searchCaseSensitive: false,
searchWholeWord: false,
searchRegex: false,
searchFilterVisible: false,
// Search constants
SEARCH_HISTORY_KEY: "obsigate_search_history",
MAX_HISTORY_ENTRIES: 50,
SUGGEST_DEBOUNCE_MS: 150,
ADVANCED_SEARCH_LIMIT: 50,
MIN_SEARCH_LENGTH: 2,
SEARCH_TIMEOUT_MS: 30000,
// Viewer state
showingSource: false,
cachedRawSource: null,
editorView: null,
editorVault: null,
editorPath: null,
fallbackEditorEl: null,
_iconDebounceTimer: null,
// Outline/TOC
outlineObserver: null,
activeHeadingId: null,
headingsCache: [],
rightSidebarVisible: true,
rightSidebarWidth: 280,
// Sidebar
sidebarFilterCaseSensitive: false,
activeSidebarTab: "vaults",
filterDebounce: null,
vaultSettings: {},
};