Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3ca6c44
web: rotate pathologically wide compression trees instead of shrinkin…
Oct 21, 2026
beaba8c
web: live tree thumbnail in the session page head (#4173)
Oct 21, 2026
3a254c2
web: stop heuristic browser caching from pinning a stale UI build (#4…
Oct 21, 2026
39d4738
web: replace the page-head tree chip with an in-pane live panorama (#…
Oct 21, 2026
b3ec262
web: keep the tree panorama at natural size — scroll instead of meet-…
Oct 21, 2026
4b8e6b4
fix: count fold edges in the tree-map refresh signature (#4173 review)
Oct 21, 2026
78a123f
web: merge the live tree panorama into the 树图 view — one tree, with z…
Oct 22, 2026
7d2ba7b
fix: make the tree-pane Fit button reachable and keep the legend acro…
Oct 22, 2026
b2d59cc
Merge branch 'master' into 2026-10-21_web-graph-rotate
ranxianglei Oct 22, 2026
3044419
web: fix tree-graph click-to-jump (pointer capture retargeting); stac…
Oct 22, 2026
6098d02
web: render the live tree map above the block list, not below it (#4173)
Oct 22, 2026
7fd3ebb
web: collapsed list rows by default, message spans on tree nodes, act…
Oct 22, 2026
3779fa7
web: ship message spans in the live tree feed so tree-map nodes label…
Oct 22, 2026
194542c
web: jump to the top of a block row; clamp long summaries to five lin…
Oct 22, 2026
06e280a
web: flow the tree map with the page and draw its nodes tighter (#4173)
Oct 22, 2026
4b927aa
refactor: drop dead box-scroll restore from the tree map poller (#4173)
Oct 22, 2026
133cdd2
fix(ci): register tests/storage-durability.test.ts in LIVE_FILES (#4173)
Oct 22, 2026
f9ca15c
Merge branch 'master' into 2026-10-21_web-graph-rotate
ranxianglei Oct 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/live-files.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export const LIVE_FILES = [
"tests/win-cmd-argv.test.ts",
"tests/zcode-mcp-degraded.test.ts",
"tests/zcode-real-cli.test.ts",
// appended, NOT alphabetical: slot = index drives each file's zone port
// band (preload-zone-slot), so mid-list inserts renumber every later band
"tests/storage-durability.test.ts",
];

/** Band width per live file: the zone ladder drifts +1 per EADDRINUSE retry;
Expand Down
35 changes: 33 additions & 2 deletions src/server/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { formatUpstreamError, getUpstreamConnectionStatus, proxyDispatcher, reco
import { detectStaleInstall, getLastInstall } from "../update.js";
import { getPlannedUpgrade, getUpdatePolicyState } from "../update-policy.js";
import { PACKAGE_NAME, VERSION, BUILD_COMMIT } from "../version.js";
import { buildBlockContent, buildMessageContent, buildOverview, buildSessionDetail, buildSessionList, buildSessionPage, handleConfigGet, handleConfigPut, hiddenEmptyCount, renderUI, type BlockContentView } from "../web/index.js";
import { buildBlockContent, buildMessageContent, buildOverview, buildSessionDetail, buildSessionList, buildSessionPage, buildSessionTree, handleConfigGet, handleConfigPut, hiddenEmptyCount, renderUI, type BlockContentView } from "../web/index.js";
import { buildSessionReportMd, buildSessionReportSvg } from "../web/report.js";
import { queryLogLines } from "../web/logs-query.js";
import { buildDiagnostics } from "../web/diagnostics.js";
Expand Down Expand Up @@ -215,6 +215,8 @@ export async function handleAdminRoute(req: http.IncomingMessage, res: http.Serv
if (req.method === "GET" && req.url?.startsWith("/__bili/logs")) return sendWebLogs(res, req);
if (req.method === "GET" && req.url?.startsWith("/__bili/diagnostics")) return sendDiagnostics(res, req.url);
if (req.method === "GET" && req.url?.startsWith("/__bili/sessions/") && req.url.endsWith("/detail")) return sendWebSessionDetail(res, req.url);
// #4173: compact fold-edge feed for the live tree thumbnail (5s client poll).
if (req.method === "GET" && req.url?.startsWith("/__bili/sessions/") && req.url.endsWith("/tree")) return sendWebSessionTree(res, req.url);
// #3917: one block's original text for the 压缩结构 tree — lazy per click, so
// the detail payload never carries whole originals.
if (req.method === "GET" && req.url !== undefined && isBlockContentPath(req.url)) return sendWebBlockContent(res, req.url);
Expand Down Expand Up @@ -264,7 +266,16 @@ export async function handleAdminRoute(req: http.IncomingMessage, res: http.Serv
// framed document's prefers-color-scheme.
const rawTheme = u.searchParams.get("theme");
const theme = rawTheme === "light" || rawTheme === "dark" ? rawTheme : undefined;
const headers: Record<string, string> = { "content-type": "text/html; charset=utf-8" };
const headers: Record<string, string> = {
"content-type": "text/html; charset=utf-8",
// The entire client bundle ships INLINE in this one document, so
// without a cache directive the browser's HEURISTIC caching can pin
// a stale build across a proxy upgrade — the user keeps loading the
// old UI long after the server moved on (seen live: a fresh deploy
// of new web features stayed invisible until a hard refresh).
// Revalidating every load is fine: the shell is stateless HTML.
"cache-control": "no-cache",
};
// #3xxx: the dsh settings pane's #3100 pre-flight fetches this route
// CROSS-ORIGIN (dsh web serves the page on its own port, the proxy on
// another — both loopback names, so isTrustedAdminOrigin above accepts
Expand Down Expand Up @@ -1242,6 +1253,26 @@ async function sendWebSessionDetail(res: http.ServerResponse, url: string): Prom
res.end(JSON.stringify(detail, null, 2));
}

// #4173: minimal edge set for the tree thumbnail — see buildSessionTree.
async function sendWebSessionTree(res: http.ServerResponse, url: string): Promise<void> {
const prefix = "/__bili/sessions/";
const suffix = "/tree";
let id = "";
try {
id = decodeURIComponent(url.slice(prefix.length, -suffix.length));
} catch {
// malformed percent-encoding → unknown session (404 below)
}
const tree = await buildSessionTree(id);
if (!tree) {
res.writeHead(404, { "content-type": "application/json" });
res.end(JSON.stringify({ error: `unknown session: ${id}` }));
return;
}
res.writeHead(200, { "content-type": "application/json", "cache-control": "no-store" });
res.end(JSON.stringify(tree));
}

// #3917: `/__bili/sessions/<id>/block-content?blockId=bN&view=one|full`.
const BLOCK_CONTENT_PATH = "/block-content";

Expand Down
Loading
Loading