Skip to content

test(ui): cover app.runs.tsx mapping helpers and SavedViews flow - #8748

Closed
hurryup52 wants to merge 1 commit into
JSONbored:mainfrom
hurryup52:test/8701-app-runs-mapping-coverage
Closed

test(ui): cover app.runs.tsx mapping helpers and SavedViews flow#8748
hurryup52 wants to merge 1 commit into
JSONbored:mainfrom
hurryup52:test/8701-app-runs-mapping-coverage

Conversation

@hurryup52

Copy link
Copy Markdown
Contributor

Summary

  • Adds direct unit test coverage for app.runs.tsx's previously-untested pure mapping helpers (mapSignalFidelity, mapAgentRunKind, mapAgentRunBundle) and the SavedViews save/apply/remove flow. No production behavior changes — the only non-test edit is adding the export keyword to four already-existing functions/types so the test file can import them directly.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint — skipped, no .github/workflows/composite-action changes in this diff.
  • npm run typecheck (via npm run ui:typecheck, which builds @loopover/ui-kit then typechecks @loopover/ui + @loopover/ui-miner — clean)
  • npm run test:coverage locally — this repo's own codecov/patch gate only measures src/**; apps/** (this change) is explicitly excluded (confirmed directly against vitest.config.ts/codecov.yml, and issue test(ui): app.runs.tsx's pure mapping helpers and SavedViews flow have zero direct test coverage #8701's own body states the same). Ran the applicable local equivalent instead: npx vitest run src/routes/app.runs.test.tsx (35/35 passed) and the full npm run ui:test (683/683 passed across @loopover/ui + @loopover/ui-miner).
  • npm run test:workers — skipped, no Workers/backend code touched.
  • npm run build:mcp — ran for local diagnostics only (unrelated package, not part of this diff).
  • npm run test:mcp-pack — skipped, no MCP package changes in this diff.
  • npm run ui:openapi:check — skipped, no API/OpenAPI schema changes.
  • npm run ui:lint — 0 errors (89 pre-existing react-refresh/only-export-components warnings across the codebase, 4 of which now also point at app.runs.tsx's newly-exported functions — same pre-existing pattern already present on ~20 other route files in this repo, not something this PR introduces as a new category).
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate — 5 pre-existing high-severity advisories in the eslint/minimatch/brace-expansion dev-dependency chain, unrelated to this change (zero new dependencies added).
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — see Summary; this PR is the test addition.

If any required check was skipped, explain why:

  • test:workers/test:mcp-pack/ui:openapi:check/actionlint all skipped as not applicable — this diff touches exactly two files under apps/loopover-ui/src/routes/, nothing else.
  • Full npm run test:ci was also attempted; it failed at the unsharded test:coverage step, but every one of the 49 failing test files is in packages/loopover-mcp/packages/loopover-miner's CLI test suites (stale/missing dist/ build artifacts for those two unrelated packages in a fresh clone — confirmed zero diff between this branch and upstream/main for every failing file, and confirmed zero failures anywhere under apps/loopover-ui). Ran ui:lint/ui:typecheck/ui:test/ui:build directly instead, all green, per the boxes above.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. — N/A, no such changes.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — N/A, no such changes.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. — N/A, no production UI behavior changed (test-only + additive exports).
  • Visible UI changes include a UI Evidence section below — N/A, this PR has no visible/behavioral UI change (test-only; the four export keyword additions are a no-op at runtime).
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. — N/A.

UI Evidence

N/A — no visible or behavioral UI change. This PR only adds test coverage and makes four already-existing functions/types (mapAgentRunBundle, mapAgentRunKind, mapSignalFidelity, SavedViews, plus their AgentRun/AgentRunBundle types) importable from the test file via the export keyword; nothing about their behavior or rendering changes.

Notes

  • Closes test(ui): app.runs.tsx's pure mapping helpers and SavedViews flow have zero direct test coverage #8701.
  • All four Deliverables from the issue are covered in this single PR: mapSignalFidelity (all 4 branches), mapAgentRunKind (all 4 branches, including both inputs that feed the shared explain-blockers branch), mapAgentRunBundle (the full repo-fallback chain, surface→source/boundary mapping, scoring-snapshot fallback, and counterfactual-pooling/snapshot-replay construction), and SavedViews (save/apply/remove render test, plus the disabled-while-default-filters case and localStorage persistence across remounts).

mapSignalFidelity, mapAgentRunKind, mapAgentRunBundle, and SavedViews had zero
direct test coverage. Export all four (no behavior change) and add branch-level
tests: every mapSignalFidelity/mapAgentRunKind branch, mapAgentRunBundle's
repo-fallback chain and surface/scoring-snapshot mappings and snapshot-replay
construction, and a SavedViews render test covering save/apply/remove.

Closes JSONbored#8701
@hurryup52
hurryup52 requested a review from JSONbored as a code owner July 26, 2026 02:30
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 26, 2026
@loopover-orb

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-26 02:36:32 UTC

2 files · 1 AI reviewer · no blockers · readiness 95/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a pure test-addition PR: it adds `export` to four existing symbols in app.runs.tsx (no behavior change) and adds thorough unit coverage for the mapping helpers and the SavedViews save/apply/remove flow. The tests trace correctly against the visible implementation (fallback chains, surface mappings, snapshot filtering) and the sonner mock update (base/success/error) correctly accounts for both bare `toast(...)` and `toast.success/error` call shapes used in the file. Issue linkage is present (#8701) and validation steps were run appropriately given apps/** is excluded from the coverage gate.

Nits — 4 non-blocking
  • nit: app.runs.tsx:53-575 is a pre-existing 575-line file (flagged by the external size brief) — not introduced by this PR, but worth splitting mapping helpers into a separate module the next time this file is touched.
  • nit: app.runs.test.tsx's buildBundle() defaults `dataQualityStatus` to "complete" and none of the mapAgentRunBundle tests explicitly assert the resulting `signal_fidelity` field, relying entirely on the separate mapSignalFidelity unit tests for that branch coverage.
  • Consider adding a short comment or follow-up note if a future PR wants to split app.runs.tsx's pure helpers out of the route file, since this PR makes them public via `export` anyway.
  • No action needed here — the diff is test-only in intent and matches its description.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8701
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 13 registered-repo PR(s), 4 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor hurryup52; Gittensor profile; 13 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The PR exports the four target symbols and adds direct tests covering all branches of mapSignalFidelity and mapAgentRunKind, each level of mapAgentRunBundle's repo-fallback chain plus other branches, and a full SavedViews render test exercising save/apply/remove.

Review context
  • Author: hurryup52
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, TypeScript, Dart, MDX, Rust
  • Official Gittensor activity: 13 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/app/runs/test desktop before /app/runs/test
before /app/runs/test
after /app/runs/test
after /app/runs/test
/app/runs/test mobile before /app/runs/test (mobile)
before /app/runs/test (mobile)
after /app/runs/test (mobile)
after /app/runs/test (mobile)
/app/runs desktop before /app/runs
before /app/runs
after /app/runs
after /app/runs
/app/runs mobile before /app/runs (mobile)
before /app/runs (mobile)
after /app/runs (mobile)
after /app/runs (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/app/runs/test before /app/runs/test (scroll)
before /app/runs/test (scroll)
after /app/runs/test (scroll)
after /app/runs/test (scroll)
/app/runs before /app/runs (scroll)
before /app/runs (scroll)
after /app/runs (scroll)
after /app/runs (scroll)

A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

This pull request changes UI/visual code but its screenshot evidence is incomplete. Every required viewport × theme combination needs its own before/after image pair in a labeled table row (e.g. "Desktop · Light | before | after"). Still missing: Desktop · Dark, Tablet · Dark, Mobile · Dark.

Please resubmit with the remaining rows filled in.

See https://github.com/JSONbored/loopover/blob/main/.claude/skills/contributing-to-loopover/SKILL.md for the exact format and examples. This is an automated maintenance action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(ui): app.runs.tsx's pure mapping helpers and SavedViews flow have zero direct test coverage

1 participant