Replace browser popups with in-page dialogs; focus new-task prompt

This commit is contained in:
Ian Gulliver
2026-10-14 22:42:46 -07:00
parent 1dc09c77e0
commit 4ffdc1e517
32 changed files with 270 additions and 195 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import { post } from "./api.js";
import { errorText, h, replace } from "./dom.js";
import { errorText, h, replace, showAlert } from "./dom.js";
import { openTranscript } from "./panes.js";
import { activeTasks, currentSession, findTask, onEach, state } from "./state.js";
export function mountNavbar(root, show) {
@@ -28,7 +28,7 @@ export function mountNavbar(root, show) {
replace(root, h("a", { href: "#/", class: "brand" }, "byre"), crumb, h("span", { class: "spacer" }), inbox, admin, connLabel, conn, me);
render();
addEventListener("keydown", (e) => {
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
if (e.key === "k" && (e.metaKey || e.ctrlKey) && !document.querySelector("dialog[open]")) {
e.preventDefault();
openSwitcher();
}
@@ -72,7 +72,7 @@ function openSwitcher() {
go(task.id);
}
catch (err) {
alert(errorText(err));
void showAlert(errorText(err));
}
};
const render = () => {