Share the notes database between Nightly and stable, and give the Nightly page a blueprint theme

Merged
CO
2mo ago
+374-89

Summary

Problem: Nightly (restored in #7492) kept a separate local database, so trying it meant working in an empty app, and its download page looked like every other page.

Fix:

  • Anarlog Nightly opens the same SQLite database as stable (desktop_db_dir maps the Nightly bundle id onto stable's folder; the anarlog-nightly CLI follows). Settings, store, vault config, and sign-in stay per app.
  • Schema changes between the two builds rely on db-migrate's existing compat floor: stable tolerates additive migrations applied by a newer Nightly and refuses the file after a -- breaking one until stable includes it. The newer-schema prompt (macOS alert and in-app gate) now names Nightly and says to keep using the newer app. The root and db-app guidelines require additive migrations and allow a breaking step only in the candidate that becomes the next stable release.
  • A per-channel run lock (<bundle-id>.running.lock in the shared folder) keeps Nightly and stable from opening the shared database at the same time; the peer is probed before the own lock is taken so a simultaneous start fails open. Same-channel relaunches still go through the single-instance plugin.
  • /download/nightly/ gets a blueprint theme: --color-blueprint-* tokens with the hue and chroma of the Blueprint app icon (#0091ff) at the brightest lightness that keeps white body text at WCAG AA, a drafting-paper grid background class, white download pills, and the same Apple/Windows/Linux section icons as the stable page (the icon map now lives in lib/download). The reliability and shared-notes notice is a full-width banner at the top of the page, linking to the docs section on database format changes.
  • Docs, release skill, packages/changelog/nightly.md, and the newsletter draft say the same. 1.4.24.md is left as is because 1.4.24 is being prepared from the current Nightly; the shared-database note belongs to the stable release that carries this change.

Verification

  • cargo test --locked -p desktop --lib (53 passing, including new shared-DB and channel-lock tests); cargo test --locked -p anarlog-cli db::; cargo test --locked -p storage global; cargo clippy --locked -p anarlog-cli --all-targets --no-deps -- -D warnings; cargo fmt --check
  • pnpm -F @anlg/web typecheck; NODE_OPTIONS='--experimental-strip-types' pnpm -F @anlg/web test (348 passing)
  • pnpm -F @anlg/desktop exec vitest run src/shared/long-load-gate.test.tsx; pnpm exec oxlint --quiet --format=github apps/desktop/src/; pnpm exec eslint on the touched TSX
  • ci.yaml node tests and license-boundary checks; dprint on all changed files
  • Browser: /download/nightly/ at desktop and 390px widths (banner alignment and wrapping, section icons, grid, contrast, footer on light background, azure matches the icon); /download/ section icons unchanged

Not verified here: the macOS osascript alert paths and an end-to-end Nightly + stable run on one machine (no packaged builds in this environment).

Open in Web Open in Cursor