Files
ObsiGate/frontend/js/state.js
T
bruno c5b92eabe1
CI / lint (push) Failing after 21s
CI / test (push) Skipped
CI / build (push) Skipped
CI / e2e (push) Skipped
CI / security (push) Successful in 27s
Desktop Build / build-windows (push) Canceled after 0s
Desktop Build / build-linux (push) Canceled after 0s
feat(version): version x.y.z propre et cohérente partout + bump script
Corrige l'incoherence d'affichage (page principale 0.0.0-dev vs a propos
v2.0.0-dev) et unifie la gestion de version sur une seule source de verite.

Backend:
- version.py: get_version() retourne toujours le tag x.y.z propre du dernier
  tag (plus de 0.0.0-dev / -N-gHASH dans l'UI). Ajout get_git_describe() et
  get_git_commit() pour le detail.
- main.py: /api/health expose git_describe + git_commit (nouveaux champs).

Frontend:
- modale A propos (populateAbout): version + commit lus depuis /api/health,
  suppression du hardcode v2.0.0-dev dans index.html.
- section config A propos (loadAbout): lit health.version, plus de state.
  APP_VERSION obsolete.
- badge header: fetch /api/health (fallback neutre '...').
- state.js: suppression de APP_VERSION (1.5.0) devenu mort; imports nettoyes.

Script:
- scripts/bump_version.sh: incrementation SemVer selon les commits
  (breaking->major, feat->minor, sinon patch), creer/pousser le tag vX.Y.Z.

Tests: 507 passed, frontend validators OK.
2026-09-07 22:13:54 -04:00

57 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 = {
// 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: {},
};