fix: preserve initial focus and guard account appearance saves

This commit is contained in:
snowspeeder committed 2026-10-03 13:22:43 -04:00
1 parent cd7d7d6251
commit e59c7123cf
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -91,10 +91,11 @@ function handleProgress(data) {
setState(working ? "thinking" : "listening");
}
function setTasksOpen(open) {
const wasOpen = !tasksPanel.hidden;
tasksPanel.hidden = !open; tasksPanel.inert = !open;
tasksPanel.classList.toggle("open", open);
tasksBtn.setAttribute("aria-expanded", String(open));
if (open) closeTasksBtn.focus(); else tasksBtn.focus();
if (open) closeTasksBtn.focus(); else if (wasOpen) tasksBtn.focus();
}
tasksBtn.setAttribute("aria-expanded", "false");
tasksBtn.addEventListener("click", () => setTasksOpen(!tasksPanel.classList.contains("open")));