fix: load note windows without vault scan

This commit is contained in:
lucaronin
2026-04-25 10:53:09 +02:00
parent ef4ad256e3
commit 944efada94
8 changed files with 286 additions and 37 deletions

View File

@@ -1,7 +1,8 @@
import { isTauri } from '../mock-tauri'
import { shouldUseLinuxWindowChrome } from './platform'
import { rememberNoteWindowParams } from './windowMode'
export function buildNoteWindowUrl(notePath: string, vaultPath: string, noteTitle: string): string {
export function buildNoteWindowUrl(notePath: string, vaultPath: string, noteTitle: string, windowLabel?: string): string {
const params = new URLSearchParams({
window: 'note',
path: notePath,
@@ -9,6 +10,10 @@ export function buildNoteWindowUrl(notePath: string, vaultPath: string, noteTitl
title: noteTitle,
})
if (windowLabel) {
params.set('windowLabel', windowLabel)
}
return `/?${params.toString()}`
}
@@ -21,9 +26,10 @@ export async function openNoteInNewWindow(notePath: string, vaultPath: string, n
const { WebviewWindow } = await import('@tauri-apps/api/webviewWindow')
const label = `note-${Date.now()}`
rememberNoteWindowParams(label, { notePath, vaultPath, noteTitle })
new WebviewWindow(label, {
url: buildNoteWindowUrl(notePath, vaultPath, noteTitle),
url: buildNoteWindowUrl(notePath, vaultPath, noteTitle, label),
title: noteTitle,
width: 800,
height: 700,