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:
+31
-23
@@ -114,24 +114,7 @@ function openChangeViewer(files, startIndex, trigger = null) {
|
||||
text: `${changePositionLabel(index, files.length)} · changed by ${(entry.steps ?? []).join(" → ")}`,
|
||||
}),
|
||||
);
|
||||
const head = h(
|
||||
"div",
|
||||
{ class: "change-viewer-head" },
|
||||
titles,
|
||||
h("button", {
|
||||
class: "change-viewer-copy",
|
||||
type: "button",
|
||||
text: "Copy raw patch",
|
||||
disabled: !hasPatch,
|
||||
onclick: () => copyText(entry.patch ?? ""),
|
||||
}),
|
||||
h("button", {
|
||||
class: "change-viewer-close",
|
||||
type: "button",
|
||||
text: "Close diff",
|
||||
onclick: closeChangeViewer,
|
||||
}),
|
||||
);
|
||||
const head = h("div", { class: "change-viewer-head" }, titles);
|
||||
|
||||
const controls = h(
|
||||
"div",
|
||||
@@ -160,10 +143,22 @@ function openChangeViewer(files, startIndex, trigger = null) {
|
||||
}),
|
||||
h("div", { class: "change-viewer-spacer" }),
|
||||
h("button", {
|
||||
class: "change-page",
|
||||
class: "change-icon",
|
||||
type: "button",
|
||||
"data-action": "copy",
|
||||
title: "Copy raw patch",
|
||||
"aria-label": "Copy raw patch",
|
||||
text: "\u29c9",
|
||||
disabled: !hasPatch,
|
||||
onclick: () => copyText(entry.patch ?? ""),
|
||||
}),
|
||||
h("button", {
|
||||
class: "change-icon",
|
||||
type: "button",
|
||||
"data-page": "prev",
|
||||
text: "Previous file",
|
||||
title: "Previous file",
|
||||
"aria-label": "Previous file",
|
||||
text: "\u2039",
|
||||
disabled: index === 0,
|
||||
onclick: () => {
|
||||
index = Math.max(index - 1, 0);
|
||||
@@ -172,10 +167,12 @@ function openChangeViewer(files, startIndex, trigger = null) {
|
||||
},
|
||||
}),
|
||||
h("button", {
|
||||
class: "change-page",
|
||||
class: "change-icon",
|
||||
type: "button",
|
||||
"data-page": "next",
|
||||
text: "Next file",
|
||||
title: "Next file",
|
||||
"aria-label": "Next file",
|
||||
text: "\u203a",
|
||||
disabled: index === files.length - 1,
|
||||
onclick: () => {
|
||||
index = Math.min(index + 1, files.length - 1);
|
||||
@@ -183,6 +180,15 @@ function openChangeViewer(files, startIndex, trigger = null) {
|
||||
renderViewer();
|
||||
},
|
||||
}),
|
||||
h("button", {
|
||||
class: "change-icon",
|
||||
type: "button",
|
||||
"data-action": "close",
|
||||
title: "Close diff",
|
||||
"aria-label": "Close diff",
|
||||
text: "\u00d7",
|
||||
onclick: closeChangeViewer,
|
||||
}),
|
||||
);
|
||||
|
||||
const body = h("div", { class: "change-viewer-body" });
|
||||
@@ -199,7 +205,9 @@ function openChangeViewer(files, startIndex, trigger = null) {
|
||||
body.append(renderRenderedDiff(entry));
|
||||
}
|
||||
|
||||
panel.replaceChildren(head, controls, body);
|
||||
// The toolbar is the first row: paging/copy/close never move when the
|
||||
// path or the diff length changes.
|
||||
panel.replaceChildren(controls, head, body);
|
||||
};
|
||||
|
||||
renderViewer();
|
||||
|
||||
Reference in New Issue
Block a user