fix(dev-host): close debug pages without a confirmation modal

Closing a workbench page popped a centered confirm dialog that locked
the entire shell (busy gate) until answered. Developers who clicked the
tab's close button and immediately went for the connection list found
every button dead and reported the page as impossible to reopen. Debug
pages are stateless and rebuild on reopen, so the close now happens
immediately; destructive actions (delete connection, disconnect,
backend rebuild) keep their confirmations.
This commit is contained in:
t8y2
2026-09-16 16:26:58 +08:00
parent ad3c5cf239
commit 193e9e898d
+3 -1
View File
@@ -257,7 +257,9 @@ function removeFrames(connectionId) {
}
async function closeFrame(frame) {
await run(async () => {
if (!(await ask("关闭此页面?未保存修改将丢失;最后一个关联页面关闭后会断开连接。"))) return;
// Closing a debug page is cheap — the plugin UI is stateless and rebuilds
// on reopen — so it closes immediately instead of behind a modal that
// locks the whole shell until answered.
connections.value = (await api("frames/close", { id: frame.id })).connections;
windows.delete(frame.id);
frames.value = frames.value.filter((f) => f.id !== frame.id);