Add a per-user lead agent and make the right pane task-focused

This commit is contained in:
Ian Gulliver
2026-10-15 09:40:30 -07:00
parent d212590cdc
commit bdd1ae48f0
68 changed files with 3332 additions and 1364 deletions
+21
View File
@@ -55,6 +55,27 @@ function modal(text, buttons) {
actions.at(-1)?.focus();
});
}
export function openPanel(title, mount) {
if (document.querySelector("dialog.panel[open]")) {
return;
}
const close = h("button", { type: "button", class: "panel-close", title: "Close (Esc)" }, "×");
const body = h("div", { class: "panel-body" });
const dialog = h("dialog", { class: "modal panel" }, h("header", { class: "panel-head" }, h("h2", {}, title), close), body);
close.onclick = () => dialog.close();
dialog.onclick = (e) => {
if (e.target === dialog || e.target.closest("a[href^='#']")) {
dialog.close();
}
};
document.body.append(dialog);
const dispose = mount(body);
dialog.onclose = () => {
dispose();
dialog.remove();
};
dialog.showModal();
}
export async function showAlert(text) {
await modal(text, [{ label: "OK", value: "ok", class: "primary" }]);
}