web: gated access, anchored viewers, mobile tabs and chat colour

- serve.mjs requires a signed session cookie for every page, artifact and the
  WebSocket, with a password file, 30-day sessions, login throttling and public
  brand assets for the sign-in page.
- The diff viewer is a fixed-height top-anchored panel whose toolbar (modes,
  copy, previous, next, close as icons) is its first row; the artifact viewer is
  likewise a fixed frame so its navigation never moves.
- The audit's selected tab uses the app's normal selected surface and bottom
  accent. Sessions that were not recorded say so plainly.
- Chat code blocks are syntax-coloured; graph pinch-zoom works with two fingers
  while a single pointer still pans and clicks nodes.
- Phones always keep the destination bar (pane collapse is wide-only), with the
  destinations spread evenly and Search on the right; the list default width is
  narrower; the theme colour matches the app.
- Code-format and layout tests, plus the full browser suite, pass.
This commit is contained in:
2026-10-20 02:21:51 +01:00
parent d7763ec466
commit ebf02c3bed
17 changed files with 558 additions and 42 deletions
+9 -1
View File
@@ -8,6 +8,7 @@ import { writeChatStars } from "../chatStars.js";
import { describeError } from "../format.js";
import { SHELL_OUTPUT_LIMIT, newChatOperationId } from "../repository.js";
import { codeBlockLabel, parseInline, parseMarkdown } from "../markdown.js";
import { highlight } from "../highlight.js";
import { formatDuration } from "../runs.js";
import { humanBytes } from "../artifacts.js";
import { changeStat, diffLineClass, diffLineSymbol } from "../changes.js";
@@ -2710,7 +2711,14 @@ function renderMarkdownBlock(block) {
if (block.kind === "code") {
const code = h("div", { class: "md-code-block" });
code.append(h("div", { class: "md-code-label", text: codeBlockLabel(block.language) }));
code.append(h("pre", { class: "md-pre" }, h("code", { text: block.code })));
const pre = h("pre", { class: "md-pre" });
const body = h("code");
for (const token of highlight(block.code, block.language)) {
if (token.kind === "plain") body.append(document.createTextNode(token.text));
else body.append(h("span", { class: `tok-${token.kind}`, text: token.text }));
}
pre.append(body);
code.append(pre);
return code;
}
if (block.kind === "rule") return h("hr", { class: "md-rule" });