feat(miner-ui): read-only run-history table over the local run-state store - #4597
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-10 07:15:35 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|



Closes #4305
What
A read-only run-history table view in
apps/gittensory-miner-ui/— one row per repo from the localminer_run_statestore (repository, state badge, last-updated) — plus the minimal local data-access layer the issue calls for so the browser app can read anode:sqlitefile on disk.Design, per the issue's guidance
vite-run-state-api.tsservesGET /api/run-stateby calling intopackages/gittensory-miner/lib/run-state.js's EXISTING exports (resolveRunStateDbPath/listRunStates) — no SQL duplicated in the UI layer, wired into bothconfigureServerandconfigurePreviewServer.listRunStates()lazily initializes the default store, which would CREATE the SQLite file on a fresh install — a write a read-only dashboard must not perform. The handler therefore checks the resolved DB path for existence first and serves{ rows: [] }without ever touching the store when no DB exists yet (asserted in tests: nolistRunStatescall happens on that path).src/routes/run-history.tsx, mounted in the shell's nav) renders four states: loading, error (API unreachable/500 — an inline alert, never a crash), the fresh-install empty state, and the populated table. The fetch client (src/lib/run-history.ts) validates the payload shape field-by-field before it reaches the view.routeTree.gen.tsregenerated and committed via the router plugin (same as the scaffold).Testing
14 cases across two suites: component tests for all four view states against fixture run-state rows plus the page-level injected-loader flow, fetch-client tests (happy path, non-2xx, three malformed-payload shapes, thrown fetch), and middleware-handler tests (rows served through the existing exports, the no-write fresh-install path, non-GET/other-path fall-through, store-failure → 500). Workspace
test/typecheck/lint/buildall green locally; the diff is confined toapps/gittensory-miner-ui/**.