feat: open note in new window (Cmd+Shift+Click / Cmd+Shift+O)

Add multi-window support: notes can be opened in dedicated secondary
Tauri windows with editor-only layout (no sidebar, no note list).

Triggers: Cmd+Shift+Click on notes, Cmd+K → "Open in New Window",
Cmd+Shift+O shortcut, Note → "Open in New Window" menu bar item.

Secondary windows have their own auto-save, theme, and wikilink
navigation. Closing a secondary window does not affect the main window.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
lucaronin
2026-03-19 08:47:25 +01:00
parent b53243938d
commit 26f09093cf
18 changed files with 467 additions and 9 deletions

View File

@@ -0,0 +1,23 @@
import { isTauri } from '../mock-tauri'
/**
* Opens a note in a new Tauri window with a minimal editor-only layout.
* In browser mode (non-Tauri), this is a no-op.
*/
export async function openNoteInNewWindow(notePath: string, vaultPath: string, noteTitle: string): Promise<void> {
if (!isTauri()) return
const { WebviewWindow } = await import('@tauri-apps/api/webviewWindow')
const label = `note-${Date.now()}`
const url = `index.html?window=note&path=${encodeURIComponent(notePath)}&vault=${encodeURIComponent(vaultPath)}&title=${encodeURIComponent(noteTitle)}`
new WebviewWindow(label, {
url,
title: noteTitle,
width: 800,
height: 700,
resizable: true,
titleBarStyle: 'Overlay',
hiddenTitle: true,
})
}