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:
23
src/utils/openNoteWindow.ts
Normal file
23
src/utils/openNoteWindow.ts
Normal 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,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user