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
+16 -3
View File
@@ -603,7 +603,9 @@ const dock = h(
"nav",
{ id: "destinationDock", class: "destination-dock", "aria-label": "Destinations" },
h("div", { class: "dock-status-row" }, dockStatus, dockSettings),
h("div", { class: "dock-row" }, dockSearch, dockDestinations),
// The destinations come first and Search sits on the right; every item takes
// an equal share of the bar on a phone.
h("div", { class: "dock-row" }, dockDestinations, dockSearch),
);
// The attention sheet lives in its own layer so it can overlay any view without
// being torn down by a content re-render; renderAttentionSheet rebuilds it.
@@ -618,6 +620,15 @@ document.body.append(h("div", { class: "app-root" }, appRail, workspace, dock));
appRail.querySelector("#railCollapse")?.addEventListener("click", () => {
state.railCollapsed = !state.railCollapsed;
applyLayoutState();
if (typeof window.matchMedia === "function") {
const wideQuery = window.matchMedia("(min-width: 600px)");
const onWideChange = () => {
applyLayoutState();
renderContent();
};
if (typeof wideQuery.addEventListener === "function") wideQuery.addEventListener("change", onWideChange);
else if (typeof wideQuery.addListener === "function") wideQuery.addListener(onWideChange);
}
});
document.addEventListener("click", (event) => {
const button = event.target instanceof Element ? event.target.closest("#listCollapse") : null;
@@ -938,7 +949,7 @@ function listCollapseButton() {
}
function applyLayoutState() {
appRail.classList.toggle("collapsed", state.railCollapsed === true);
appRail.classList.toggle("collapsed", state.railCollapsed === true && isWideLayout());
const railButton = document.getElementById("railCollapse");
if (railButton) {
const label = state.railCollapsed ? "Expand navigation" : "Collapse navigation";
@@ -1129,7 +1140,9 @@ function renderContent() {
const activePane = detailOpen ? "detail" : "list";
const model = detailSections();
const layout = h("div", {
class: `pane-layout${state.listCollapsed ? " list-collapsed" : ""}`,
// Collapsing a pane is a wide-screen affordance; a phone always keeps the
// list and the bottom destination bar available.
class: `pane-layout${state.listCollapsed && isWideLayout() ? " list-collapsed" : ""}`,
"data-active-pane": activePane,
});