web: app shell — left destination rail, settings-hosted connection, viewport panes

The layout item's work plus the two defects its review found:
- the wide grid sized the list track from its MAX, so at 600-759px the detail pane
  was clipped to 40-199px; cap the list below 900px and narrow the rail there
  (measured now: detail 232px at 600, 332 at 700, 340 at 900, 880 at 1440);
- the shell said 'Not connected' on a fresh page because the prefilled proxy URL
  validated; the status now reflects a SAVED endpoint ('Not configured' until then)
  and refreshes as the draft changes.

Includes the rail + bottom dock, connection moved into Settings, viewport-only
scrolling with panes that scroll themselves, tab semantics, skip link, h1 per
route, and the design tokens.
This commit is contained in:
2026-10-19 20:03:56 +01:00
parent 321e046377
commit 84e136436c
26 changed files with 2619 additions and 830 deletions
+20 -6
View File
@@ -258,6 +258,7 @@ export function createChatView(rt) {
let chatClock = null;
let chatNow = Date.now();
const renderContent = (...args) => rt.renderContent(...args);
const focusDetailHeading = (...args) => rt.focusDetailHeading(...args);
const renderActionFailedDialog = (...args) => rt.views.dialogs.renderActionFailedDialog(...args);
/** Remember one conversation's scroll position (index of the first visible row). */
@@ -406,6 +407,7 @@ function startNewChat() {
state.chatCreate = newChatCreateState(newChatOperationId());
state.chatDirectoriesError = "";
renderContent();
focusDetailHeading();
loadChatDirectories();
}
@@ -504,6 +506,7 @@ async function openChatSession(id) {
error: "",
});
renderContent();
focusDetailHeading();
// Attach the shared live stream once per session per connection; its failure is
// non-fatal — history stays usable and the badge reads "not live".
subscribeChatSession(id);
@@ -511,6 +514,9 @@ async function openChatSession(id) {
// only after the next pushed shell frame.
loadChatShells(id);
await loadChatHistory(id);
// The history load repaints the pane; keep the row activation's focus contract
// true after it lands, not only for the loading paint.
focusDetailHeading();
}
/** Replace one conversation's fields, keeping every other field intact. */
@@ -1443,7 +1449,7 @@ function renderChatList() {
}),
);
list.append(toolbar);
const rows = h("div", { id: "chatRows", class: "chat-rows" });
const rows = h("div", { id: "chatRows", class: "chat-rows list-scroll" });
fillChatRows(rows);
list.append(rows);
return list;
@@ -1600,7 +1606,13 @@ function renderChatCreate() {
},
h("span", { class: "chat-create-back-glyph", "aria-hidden": "true", text: "←" }),
),
h("h2", { class: "chat-bar-title chat-create-title", text: CHAT_CREATE_TITLE }),
// The create pane is a chat detail too: its title is the route's h1.
h("h1", {
class: "chat-bar-title chat-create-title",
id: "detailTitle",
tabindex: "-1",
text: CHAT_CREATE_TITLE,
}),
);
pane.append(bar);
@@ -1775,14 +1787,16 @@ function renderChatConversation() {
const thread = state.chatThreads.get(state.chatActiveId) ?? null;
const title = effective ? sessionTitle(effective) : state.chatActiveId.slice(0, 18);
// The pending approval card (C10), derived from the stored frame plus the local
// answer. While it is actionable the top bar offers a jump control and the
// answer. While it is actionable the chat pane offers a jump control and the
// running indicator stands down (a turn blocked on a decision is not generating).
const approval = approvalCard(thread?.permission, thread?.permissionAnswer);
const awaiting = approval?.actionable === true;
const bar = h("div", { class: "chat-bar" });
const titles = h("div", { class: "chat-bar-titles" });
titles.append(h("h2", { class: "chat-bar-title", text: title }));
// The open conversation is the route's one h1; the list heading above becomes
// its h2 while the detail is open.
titles.append(h("h1", { class: "chat-bar-title", id: "detailTitle", tabindex: "-1", text: title }));
const meta = chatHeaderMeta({
model: session?.model,
tag: session?.tag,
@@ -2127,7 +2141,7 @@ function renderChatTranscript(
// deliberately unlike a message bubble (see ChatCommandNoticeItem).
for (const notice of notices) transcript.append(renderChatCommandNotice(sessionId, notice));
// The approval card is the transcript's last item (C10) — after the notices and
// after the running indicator when it is shown — so the top bar's jump control
// after the running indicator when it is shown — so the pane's jump control
// and a fresh card both land at the end.
if (approval) transcript.append(renderChatApproval(sessionId, approval));
wrap.append(transcript);
@@ -2149,7 +2163,7 @@ function renderChatTranscript(
return wrap;
}
/** The top bar's approval jump control (C10), naming the pending request. */
/** The chat pane's approval jump control (C10), naming the pending request. */
function approvalJumpButton() {
return h("button", {
class: "ghost chat-approval-jump",