web: finish L6 routes against the integrated shell

Fixes found by running the full suite after merging main, not by the route
model itself:
- start the run-alert watch on the FIRST connection too: L6's early return for a
  pending deep link skipped it, so no subscribe was sent (R10 broke silently);
- an ephemeral /new chat no longer refreshes the session list (the server
  intentionally omits it), which had replaced the open conversation and dropped
  its local notice;
- the chat row menu flips above the row when it would fall off the window, so the
  last rows' items are hit-testable (a real defect, not clipping);
- smoke robustness for drifted live data: the C2 closed-row assertion opens C13's
  menu, the C13 hide step opens a conversation when none is left open, the
  timeline empty-state capture is skipped when no empty run exists, and the last
  row is scrolled into view.
Full suite: 551 unit tests green, UI SMOKE PASS.
This commit is contained in:
2026-10-19 14:59:06 +01:00
parent 9c2b50df44
commit c0dc525135
2 changed files with 72 additions and 19 deletions
+19 -3
View File
@@ -4808,9 +4808,18 @@ function effectiveChatSession(session) {
function openChatMenu(sessionId) {
state.chatMenu = state.chatMenu === sessionId ? null : sessionId;
renderContent();
// 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.
if (state.chatMenu) {
// The panel hangs below its button. Near the bottom of the window that would
// put the items off-screen (a real hit-test failure, not just clipping), so
// flip the panel above the row when it does not fit below.
const row = document.querySelector(`#chatRows .chat-row[data-session="${CSS.escape(sessionId)}"]`);
const panel = row?.querySelector(".chat-menu-panel");
if (panel && panel.getBoundingClientRect().bottom > window.innerHeight - 8) {
panel.style.top = "auto";
panel.style.bottom = "calc(100% + 4px)";
}
// 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`);
first?.focus();
}
@@ -5168,7 +5177,11 @@ async function startChatSession(directory) {
const title = String(created.title ?? "").trim() || "New chat";
addChatNotice(created.id, `Started a new session “${title}” in ${directory}.`);
await openChatSession(created.id);
await loadChatSessions();
// An ephemeral (verification) create is intentionally absent from the server's
// list, so a refresh here would replace the just-opened conversation and drop
// its local notice. The row is already spliced above and is kept by
// loadChatSessions via chatEphemeralIds, so a listed create still refreshes.
if (!ephemeral) await loadChatSessions();
} catch (error) {
if (from) addChatNotice(from, `Couldn't start a new session in ${directory}: ${describeError(error)}`, { failed: true });
state.actionError = describeError(error);
@@ -7468,6 +7481,9 @@ async function onConnected() {
state.routeFirstConnect = true;
const route = state.pendingRoute ?? state.route ?? DEFAULT_ROUTE;
state.pendingRoute = null;
// The alert watch is connection-scoped, not route-scoped: it must start on the
// first connection too, which returns early after opening a pending deep link.
await startRunAlertWatch();
await applyRoute(route);
return;
}