Extract dashboard simple route table (#70)

* review: harden readonly git checks and lint verification

* test: satisfy readonly reviewer sandbox typing

* test: fix readonly reviewer sandbox assertions

* test: remove impossible readonly sandbox guards

* test: relax readonly sandbox assertions

* test: cast readonly sandbox expectation shape

* test: cast readonly sandbox expectation through unknown

* Phase 0 — STEP_DONE/TASK_DONE split + owner-follow-up integration smoke

* Add STEP_DONE guards, verdict storage, and stale delivery suppression

* style: format paired stepdone telemetry files

* Route STEP_DONE through reviewer

* Add structured Discord attachments

* style: format structured attachment test

* Fix room thread bot output parity

* Remove duplicate work item attachment migration from owner branch

* Remove legacy dashboard rooms renderer

* Extract dashboard parsed body renderer

* Extract dashboard redaction helpers

* Extract dashboard RoomCardV2 component

* Include RoomCardV2 test in vitest suite

* Extract dashboard RoomBoardV2 component

* Extract dashboard EmptyState component

* Extract dashboard InboxPanel component

* Split dashboard InboxPanel card renderer

* Extract dashboard TaskPanel component

* Extract dashboard UsagePanel component

* Fix dashboard room thread chunk rendering

* Extract dashboard ServicePanel component

* Render dashboard live progress markdown

* Extract dashboard SettingsPanel component

* Fix structured attachment rendering

* Extract dashboard simple route table
This commit is contained in:
Eyejoker
2026-04-28 17:51:15 +09:00
committed by GitHub
parent 6197e90c8c
commit fb79aa307b
3 changed files with 144 additions and 10 deletions

View File

@@ -46,7 +46,7 @@ import {
buildWebDashboardOverview,
sanitizeScheduledTask,
} from './web-dashboard-data.js';
import { serveValidatedAttachment } from './web-dashboard-attachments.js';
import { handleSimpleGetRoute } from './web-dashboard-routes.js';
import {
addClaudeAccountFromToken,
getActiveCodexSettingsIndex,
@@ -1571,15 +1571,14 @@ export function createWebDashboardHandler(
return jsonResponse({ error: 'Method not allowed' }, { status: 405 });
}
const simpleGetRoutes: Record<string, () => Response> = {
'/api/health': () => jsonResponse({ ok: true }),
'/api/status-snapshots': () =>
jsonResponse(readSnapshots(statusMaxAgeMs)),
'/api/tasks': () => jsonResponse(loadTasks().map(sanitizeScheduledTask)),
'/api/attachments': () => serveValidatedAttachment(url),
};
const simpleGetRoute = simpleGetRoutes[url.pathname];
if (simpleGetRoute) return simpleGetRoute();
const simpleGetRoute = handleSimpleGetRoute({
url,
statusMaxAgeMs,
readSnapshots,
loadTasks,
jsonResponse,
});
if (simpleGetRoute) return simpleGetRoute;
if (url.pathname === '/api/overview') {
const snapshots = readSnapshots(statusMaxAgeMs);