Files
Marcos Paulo a71e294566
ci / ci (macos-latest) (push) Has been cancelled
ci / ci (ubuntu-latest) (push) Has been cancelled
ci / ci (windows-latest) (push) Has been cancelled
docs: specs, designs, research and agent rules for mobile, sync and collaboration
- specs: mobile-and-sync, collaboration, vault-launcher, e2ee, attachments-and-history, capture-and-publish, agents (brief and orchestrator notes for MiniMax and GLM agents)
- research: sync landscape, security and server, mobile platform (browsed, cited)
- design/mobile: 24 PaperCraft exports (dark and light) of the phone, desktop, sharing and launcher screens
- .claude: project skills and path rules so delegated agents follow the repo rules; CLAUDE.md imports AGENTS.md
- ARCHITECTURE and ROADMAP updated; AGENTS.md lists the approved sync dependencies

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 07:46:30 -03:00

4.9 KiB

Vault launcher (main menu)

Problem

Today the app opens the newest recent vault or throws up a folder dialog; recents live only in the File menu (5 entries, no metadata). With many local vaults, shared folders and server vaults there is no place to see them all, pick one, or manage the list. A vault is bound to one Session for the life of the process, so switching relaunches the app.

Goal

A launcher screen: on start (when no vault is forced), from File > Vaults, and when a vault is closed, it lists every vault the user can open, with status, and offers Open folder, Create, Connect to server and Join with a code.

Non-Goals

  • Opening two vaults in one window (the session stays one vault per window; "open in new window" is allowed).
  • Cloud vault browsing without a connected server; templates gallery (rail entry is a placeholder in v1).

Behaviour

  1. Launcher shows when: no recent vault exists or none is found on disk; the user passes --launcher; the user chooses File > Vaults... or closes the vault; the user holds Shift at start (desktop). A plain launch with a valid recent still reopens it directly (setting "Reopen last vault", default on).
  2. Recent list (design design/mobile/14-home-vaults-desktop.png): per vault name, path, last opened, sync pill (Synced, N changes waiting, Not synced, Offline, Error), role badge and avatars when shared, pinned first, then newest first; filter field; missing folders shown with "folder not found" and Remove from list; row menu: Open, Open in new window, Reveal in file manager, Rename, Pin/Unpin, Copy path, Remove from list (never deletes files).
  3. Actions: Open folder as vault (native dialog; Obsidian vaults open as they are), Create new vault (name + folder, optional "also create on server"), Connect to server (lists GET /v1/vaults entries not yet bound, then a folder to sync into), Join with a code (shared folder invite, see collaboration spec).
  4. Left rail: Vaults, Shared with me (vaults where I am not owner), Servers (accounts and servers I paired, with sign out), Templates (placeholder), Settings, Help.
  5. Phone (design 15-vaults-phone.png): one column "On this phone" and "On your server" (tap Connect), buttons New vault and Join.
  6. Data: AppSettings.recent_vaults stays (compat); new vault_catalog: BTreeMap<path, VaultMeta{name, pinned, last_opened_ms}> with the existing repair rules (cap 200 entries, hostile data repaired not trusted). Sync status is read cheaply from <vault>/.notescraft/sync/binding.json and state.json (no network at launch); live status arrives after a vault opens or a background refresh runs.
  7. Cap and safety: the launcher never opens a folder at list time (no indexing); reading metadata of 200 vaults takes under 100 ms; a vault on a missing volume must not block the UI (stat on a worker thread with a 500 ms budget).

Acceptance Criteria

  • Given 12 recent vaults (2 pinned, 1 missing), the launcher lists pinned first, then newest first, marks the missing one, and Remove from list drops it without touching disk.
  • Given a vault bound to a server, its row shows the sync pill derived from local files only, with no network call at launch.
  • Given Open in new window, a second process opens that vault while the launcher stays open.
  • Given Create new vault with a name that exists as a folder, the app refuses with a message and creates nothing.
  • Given keyboard only, Up/Down moves the selection, Enter opens, Cmd/Ctrl+F focuses the filter, Delete asks before removing from the list.
  • Given a 390 pt window, the launcher uses the phone layout with 44 pt targets.

Tasks

  1. Engine catalog (vault_catalog, repair, commands vaults.list/pin/rename/remove), brief scripts/mm/vault-catalog.md. Done 2026-10-20 by GLM 5.3 Flash through Pi: 19 tests, clippy clean, verified by the orchestrator.
  2. Launcher view in ui-egui (desktop and phone layout), 11 driven tests, examples/launcher.rs. Started by GLM 5.3 Flash via Pi until its quota ended; finished by the orchestrator (fixed format_ago mixing days and milliseconds, Cmd/Ctrl+F focus, optimistic rename, 7 clippy lints). Polish left: pin star spacing, avatar initials, filter field box, wrapped card descriptions.
  3. Host wiring in apps/notescraft (launcher_window.rs): the launcher shows when no recent vault exists or with --launcher; Open and Open-in-new-window start the vault as its own process; Pin, Rename, Remove go through the new pure catalog functions set_pinned, set_name, forget (shared with the vaults.* commands); every opened vault is recorded with touch. Not checked in a live window (this session cannot paint one). The File > Vaults... menu entry (command ui.open_launcher, request VaultRequest::Launcher) is done. Still open: Connect to server and Join with a code actions (need the sync UI).
  4. Server vaults in the launcher (needs accounts task of specs/collaboration).