web: finish modal focus handling and two real fixes it exposed
- the attention sheet is managed imperatively, so closing it now tells the controller; without that it stayed on the stack and left the app root inert, which silently swallowed every real click (found by the suite: the Settings Templates card stopped working after the sheet had been used); - the sheet returns focus to the bell after the repaint that replaces it; - opening a chat row's menu at the bottom edge now scrolls the row into view, not just flips the panel, so the items are actually reachable.
This commit is contained in:
@@ -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`);
|
||||
|
||||
Reference in New Issue
Block a user