diff --git a/src/components/session/TabBar.vue b/src/components/session/TabBar.vue index 496480c..0339312 100644 --- a/src/components/session/TabBar.vue +++ b/src/components/session/TabBar.vue @@ -141,8 +141,11 @@ async function detachTab(): Promise { height: 600, resizable: true, center: true, + visible: false, + focus: true, url: `index.html#/detached-session?sessionId=${session.id}&name=${encodeURIComponent(session.name)}&protocol=${session.protocol}`, }); + wv.once("tauri://created", () => { wv.show(); }); wv.once("tauri://error", (e) => { console.error("Detach window error:", e); }); } diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 37075d9..7b6441c 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -375,8 +375,11 @@ async function handleHelpAction(page: string): Promise { height: 600, resizable: true, center: true, + visible: false, + focus: true, url: `index.html#/tool/help?page=${page}`, }); + wv.once("tauri://created", () => { wv.show(); }); wv.once("tauri://error", (e) => { console.error("Help window error:", e); alert("Window error: " + JSON.stringify(e.payload)); }); } @@ -413,7 +416,7 @@ async function handleToolAction(tool: string): Promise { const sessionId = activeSessionId.value || ""; - // Open tool in a new Tauri window + // Open tool in a new Tauri window — create hidden, show after webview confirms ready const label = `tool-${tool}-${Date.now()}`; const wv = new WebviewWindow(label, { title: `Wraith — ${config.title}`, @@ -421,8 +424,11 @@ async function handleToolAction(tool: string): Promise { height: config.height, resizable: true, center: true, + visible: false, + focus: true, url: `index.html#/tool/${tool}?sessionId=${sessionId}`, }); + wv.once("tauri://created", () => { wv.show(); }); wv.once("tauri://error", (e) => { console.error("Tool window error:", e); alert("Window error: " + JSON.stringify(e.payload)); }); } @@ -454,8 +460,11 @@ async function handleOpenFile(entry: FileEntry): Promise { height: 600, resizable: true, center: true, + visible: false, + focus: true, url: `index.html#/tool/editor?sessionId=${sessionId}&path=${encodeURIComponent(entry.path)}`, }); + wv.once("tauri://created", () => { wv.show(); }); wv.once("tauri://error", (e) => { console.error("Editor window error:", e); alert("Window error: " + JSON.stringify(e.payload)); }); } catch (err) { console.error("Failed to open editor:", err); } }