AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.
Open a note in a new window (desktop)
Problem and outcome
Implements Issue #67. Desktop users could only edit one note at a time in the main window. A note can now be moved to its own window from the note's "More" menu or with File → Open Note in New Window (Cmd/Ctrl+Shift+O), so it can sit next to the main window or on another screen.
Behavior
| ID | Behavior | Acceptance |
|---|---|---|
| W01 | A note is shown in at most one window. Moving it to a new window first saves pending edits in the main editor; the main window then shows a placeholder with a "Show window" button instead of a second editor. | Electron scenario A1: text typed in the main window appears in the new window, and the main window has no editor for that note. |
| W02 | Opening the same note again from the menu item, the shortcut, the note list, quick switcher, plugin links or the placeholder focuses the existing window instead of creating another one. | Unit test "opens one window per note"; Electron scenario A2. |
| W03 | Closing the note window saves pending edits first. The note then opens in the main window again with the saved content. | Unit test "closing asks the renderer first"; Electron scenarios B1, B2. |
| W04 | If saving fails before the move (for example local storage does not answer within 15 s), the note stays in the main window with its content and a message. If saving fails when the window closes, the window stays open with a message; closing it again closes it and the local draft is recovered in the main window. A renderer that stops answering is closed on the second close after 5 s. | Unit tests for failed save and stuck renderer; Electron scenarios D1 (storage paused) and E1. |
| W05 | Quitting, switching account or instance, clearing the session or clearing local data asks every note window to save first and closes it after at most 5 s. Note windows are not restored after a restart. | Unit test "closeAll"; Electron scenario F1 (quit, relaunch, content kept). |
| W06 | Note windows are editor-only: links to other notes open them in the main window, deleting the note closes its window, and several notes can each have their own window. They cannot open further windows, switch account, change the instance or start plugins. | Electron scenarios A3, C1, C2, G1. |
| W07 | Only notes that already exist in storage can be moved; a note that has not been created yet shows "Open in new window after sync". Diagrams, tables, trash and the web app do not offer the action. | Manual check of the menu states. |
| W08 | A move counts as done only once the new window shows the note. If the window fails to load, cannot show the note, crashes, or does not report back within 30 s, it is destroyed, the main window shows the note in its editor again and explains what happened ("can't be shown in a separate window" for a missing or unsupported note, "couldn't open" otherwise). A note window that crashes after the move also gives the note back with a message. Failure reasons are written to desktop diagnostics. | Unit tests for readiness, load failure, timeout, closing while loading, crash after the move and replacing a window that is still going away; Electron scenarios H1 (load blocked), H2 (renderer crash), H3 (missing note). |
| W09 | Sync still runs only in the main window. Each sync result, and a conflict discard, is passed on to the window of the note it concerns: its editor advances its sync state and reloads the note, so changes from other devices and conflicts reach it the same way they reach the main editor. A failed reload keeps the note the window already shows. | Unit tests for picking and rebuilding the per-note sync update; Electron scenarios I1 (edit on another device appears after sync) and I2 (conflicting edit: same result as the main window, local edit kept as a conflict in the sync queue). H1, H2, I1 and I2 fail without this change. |
Risk and rollback
The change is desktop-only and adds no data, API or migration change. Main-process IPC that used to accept only the main window now also accepts note windows for the session token, image upload, AI direct requests and renderer error reports; account, instance, data reset and window commands still require the main window. A synchronous IPC handler (desktop:rich-text-heading-shortcut) previously returned nothing for other windows, which froze them; it now always answers, and each note window has its own heading-shortcut guard. Sync forwarding goes from the main window through the main process to one note window; only the main window may send it and only a note window may report that it is ready. A sync result that arrives while a note window is still loading is not replayed; the window reads the note from storage when it loads. Electron scenarios were run against the local dev server on macOS only; Windows and Linux are covered by CI unit tests and builds, not by interactive runs. Rollback is a revert; no stored state refers to note windows.
Packaged E2E
tests/desktop-note-window.integration.mjs (bun run verify:desktop-note-window-e2e -- <packaged executable>) runs the main scenarios against the packaged app and a test API on a temporary database (tests/desktop-note-window-api.mjs, run under Bun; the driver runs under Node because Playwright cannot open its Electron connection from Bun 1.3): moving unsaved edits (A1), focusing the existing window from every entry (A2), note-window IPC limits (A3), saving on close (B1), two windows and links (C1), failed saves before the move and on close (D1, E1; skipped on Windows because pausing storage needs POSIX signals), quitting (F1), deleting (G1), a renderer crash (H1), a note that cannot be shown (H2), a change from another device (I1) and a sync conflict (I2). The desktop release workflow runs it after the packaged first-launch and protocol checks on macOS, Windows and Linux (under xvfb-run).