Repository navigation
ui: give /admin/search one toolbar and readable audit rows - #782
Conversation
|
Written-by: Fledge Platform Lead Not a merge candidate: Read from the API in this turn:
That is the same shape as The path forward is ordinary and short: |
HugoXK-bot
left a comment
There was a problem hiding this comment.
Verdict: PASS at 28d6a77
Written-by: HugoXK-bot
Posted-by: HugoXK-bot
Read the tip 28d6a77cf1a3f8fea1b2cb7c7d81867bf4e83fad (7 files, +178/−28; src/views/pages.ts blob a8d6d3cf matches the contents API).
Findings, none blocking:
src/views/pages.ts:2135-2160—auditLinkifyrebuilds every href from ajob_/repo_/usr_prefix and escapes both href and text, so text that only looks like a URL cannot become one;auditDetailHtmlescapes every chip key and value. The three targets exist:/admin/jobs/:jobId(src/app.ts:4275),/admin/users/:id(:4241),/repos/:id(:2013), andauditRowsis rendered only on the admin page (:2495), the support view (:3716) and/admin/search(:3806), so every reader who sees a link can follow it.src/views/pages.ts:2149-2155— a long tail keeps the full detail in the celltitleand in thedetailsbody and truncates only the visible 120 chars; nothing is dropped.src/views/pages.ts:3811—hasFiltercounts the inactive tab's keys, so a URL carrying onlyaction=shows "Clear filters" on the Jobs tab, and that link drops a filter the user cannot see there. Cosmetic.src/views/pages.ts:3812— switching tabs keepsqand drops the other tab's keys, which is the rule the body states;src/app.ts:4308maps any unknownviewback tojobsrather than echoing it.test/admin.test.ts:572-607— onename="q", anaria-currenttab, date inputs on the audit tab, chips, one human action label, a collapsed long error and a filtered export link: the behaviours the body claims, pinned in the app rather than only in the view.
Ran:
npm run check— lint 11 baseline warnings, typecheck clean, 1985/1985 tests, build oknode scripts/pr-lint.mjs --pr 782— ok (#782, T2, 7 files)node scripts/changelog.mjs check— 41 fragments oknode scripts/version.mjs check— 0.3.6 oknode scripts/secret-scan.mjs— no suspected value in the tracked files
Not run: browser click-through, Docker, the visual matrix locally.
Checks at the tip: ci-ok success 07:06:40Z, test (24) 07:05:40Z, pr-lint success 10:03:08Z; review-gate failure 07:04:17Z is the pre-verdict state. The head is now dirty against main (mergeable: false), so a forward merge changes the tip and voids this PASS — name the new sha.
HugoXK-bot
left a comment
There was a problem hiding this comment.
Verdict: PASS at ce0562b
Written-by: HugoXK-bot
Posted-by: HugoXK-bot
Read the tip ce0562be028aeb4f5122aae390e2f4e9e7696bd2 (merge of 28d6a77c + live main 9f2ef3aa; 7 files, +178/−28, T2). This supersedes my PASS at 28d6a77cf1a3f8fea1b2cb7c7d81867bf4e83fad only because the forward merge moved the tip.
The rebase is faithful: I hashed all 714 blobs of tree f76aea3880a7d198e5da00c1db78477cbced76ba against the API tree object (714/714 match), and the added/deleted line sets of all 7 files are identical to the tip I passed. Nothing new entered the diff.
The body's 2193/2193 matches the tree: my first parallel run hit one EADDRINUSE on port 37281 in test/bridgeContract.test.ts:120 (three suites on one box), that file passes 7/7 alone, and a serial npm run check gives 2193/2193. lint is at the same 11-warning baseline, and pr-lint is green (ok (#782, T2, 7 files), run 12:54:19Z). The body's "41 fragments ok" is its own earlier run; the tip now carries 66 — the base moved, not the PR.
Two non-blocking notes, both in behaviour I checked against the diff:
src/views/pages.ts:4270—hasFiltertests keys from both tabs, so an audit URL that still carries a stalestatus=shows "Clear filters" with nothing on screen to clear. Harmless (the form only submits the active tab's keys) but a one-line fix if the page is touched again.src/views/pages.ts:2374—auditDetailHtmlconvertskey=valuepairs to chips and linkifies only the free text around them, so an id that arrives asjob=job_…stays unlinked while the body promised ids are linked. Cosmetic; the test'srepo_abc: Error: …case is linkified.
Ran (exact tip tree; every blob hash-checked against the API):
npm run check— lint 11 baseline warnings, typecheck clean, 2193/2193 tests, build oknode scripts/pr-lint.mjs --pr 782— ok (#782, T2, 7 files)node scripts/changelog.mjs check— 66 fragments oknode scripts/version.mjs check— 0.3.6 oknode scripts/secret-scan.mjs— no suspected value in the tracked filesnpx tsx --test test/bridgeContract.test.ts— 7/7 (the one failed row in my parallel run was a port collision, not this PR)
Not run: browser click-through, Docker, the visual matrix locally.
Written-by: HugoXK
Fixes #779
risk-tier: T2; basis: src/app.ts
What changed
src/app.ts:/admin/searchreadsview=jobs|audit(defaultjobs) and passes it to the page. The search SQL, visibility, CSV schema and export caps are unchanged.src/views/pages.tsJobs/Audittabs; the active tab owns the only filter form, so there is one Query field.type="search", From/To aretype="date", labels are associated, and the form carriesrole="search".viewplus the active tab's filters; the other tab's unrelated keys are not appended.P0 — …console labels.auditRowsnow shows a known action label once (no raw action line), formatskey=valuedetails as chips, linksjob_*/repo_*/usr_*ids, and collapses long free text behind a details control. Missingflybot.instance.auto_restarted/flybot.instance.recovered/session.revoked/admin.support_view/job.cancelledlabels were added.public/app.css: toolbar/tab/filter grid, tablet/phone layout, audit chips and the details control; radii use--radius-pill.test/admin.test.ts,test/pages.test.ts: tabs, one Query, search/date input types, active-tab pager keys, priority labels, structured audit detail, link ids, collapsed long text, and one human action label.docs/architecture.md,changelog.d/779-admin-search-ui.changed.md.Why
Two independent forms duplicated Query and each dropped the other tab's filters on paging/export. The controls sat in one
.rowwith equal visual weight, and the Audit table printed one raw, truncated detail line per row. The page is an operator surface; it now reads as one toolbar and a structured table.Ran:
npm cinpx tsx --test test/admin.test.ts test/pages.test.ts— 64/64 passnpm run checkat this tip — lint at the 11-warning baseline (no new warnings), typecheck clean, 2193/2193 tests, build cleannode scripts/version.mjs check— 0.3.6 oknode scripts/changelog.mjs check— 41 fragments oknode scripts/risk-gate.mjs --base origin/main—risk-tier: T2; basis: src/app.tsNot run:
Risk and rollback
Risk: existing bookmarks to
/admin/search?status=…still render the Jobs tab; a link with only audit keys but noview=auditrenders Jobs. That is the default-tab rule, not data loss. The audit table keepstable-cardsand column labels for mobile. Rollback: revert the commit; the route ignoresviewand the previous two forms return.Docs
docs/architecture.mdnow describes the one-toolbar tabs, the active-tab pager/export keys, and the structured audit detail cell. The changelog fragment ischangelog.d/779-admin-search-ui.changed.md.