diff --git a/web/src/views/attention.js b/web/src/views/attention.js index a0b688b7..e36c930b 100644 --- a/web/src/views/attention.js +++ b/web/src/views/attention.js @@ -243,8 +243,13 @@ function closeAttentionSheet({ restoreFocus = true } = {}) { if (!state.attentionSheetOpen) return; state.attentionSheetOpen = false; state.attentionSnapshot = null; - if (!restoreFocus) modal.close("attention-sheet", { restoreFocus: false }); + // The sheet is managed imperatively (renderManaged: false), so the controller + // must be told it closed; otherwise it stays on the stack and the app root is + // left inert, which silently swallows every real click. Focus moves after the + // repaint, since the close re-renders the surface the trigger lives in. + modal.close("attention-sheet", { restoreFocus: false }); render(); + if (restoreFocus) document.getElementById("attentionBell")?.focus(); } /** Dismiss one or more entries for good, persisting the identity set. */ diff --git a/web/src/views/chat.js b/web/src/views/chat.js index e3f9d831..4a1d3248 100644 --- a/web/src/views/chat.js +++ b/web/src/views/chat.js @@ -926,6 +926,15 @@ function openChatMenu(sessionId) { panel.style.top = "auto"; panel.style.bottom = "calc(100% + 4px)"; } + // Flipping is not always enough: a row at the very bottom edge can leave the + // panel (and its items) below the viewport even when it opens upwards. Bring + // the row into view so the menu is actually reachable. + if (panel && row) { + const rect = panel.getBoundingClientRect(); + if (rect.top < 8 || rect.bottom > window.innerHeight - 8) { + row.scrollIntoView({ block: "nearest" }); + } + } // The re-render replaced the focused button; move focus into the panel so a // keyboard operator can walk the items without hunting for the next Tab stop. const first = document.querySelector(`#chatRows .chat-row[data-session="${CSS.escape(sessionId)}"] .chat-menu-item`);