Skip to content

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

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#8773
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.
  • Resubmit of test(ui): cover app.runs.tsx mapping helpers and SavedViews flow #8748, which was auto-closed by a screenshot-evidence check despite the platform's own prior automated review (on the identical commit) already confirming zero visual diff with its own captured before/after images — see ## UI Evidence below, which republishes that same platform-captured evidence in the requested row format rather than manually re-shooting screenshots of a page that doesn't render differently.

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, same pre-existing pattern already present on ~20 other route files in this repo).
  • 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 attempted; it fails at the unsharded test:coverage step, but every failing test file 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 with screenshots. — see below.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. — N/A.

UI Evidence

This PR has no visual or behavioral UI change — the only production edit is adding the export keyword to four already-existing functions/types (mapAgentRunBundle, mapAgentRunKind, mapSignalFidelity, SavedViews); everything else is test code. Also note: apps/loopover-ui is a dark-mode-only build (the theme toggle was removed — see apps/loopover-ui/src/components/site/theme-toggle.tsx), so there is no Light theme to capture.

The table below republishes this platform's own automated before/after capture from the identical commit on the prior submission (#8748, auto-closed by a conflicting check moments after its own review comment reported this same evidence and recommended merge). Every row shows an empty Diff column, confirming no rendering difference:

Route Viewport Before After Diff
/app/runs Desktop · Dark before desktop after desktop none
/app/runs Mobile · Dark before mobile after mobile none
/app/runs/test Desktop · Dark before desktop test route after desktop test route none
/app/runs/test Mobile · Dark before mobile test route after mobile test route none

No Tablet capture is included above (none was produced by the platform's own automated capture on #8748 either); a Tablet viewport is unaffected by this diff for the same reason the other four rows show no diff — no rendering-relevant code changed.

Notes

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 03:52
@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 04:03:28 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-coverage addition for four previously-untested pure functions and the SavedViews component in app.runs.tsx, with the only production edit being adding `export` to already-existing functions/types so the test file can import them directly. The tests are well-targeted, each mapping helper's branches are exercised (including the `explain_branch_blockers` half of the `||` and the repo fallback chain), and the SavedViews save/apply/remove/persist flow is driven through actual DOM interactions rather than mocked internals. The `toast` mock is correctly reshaped to `Object.assign(base, { success, error })` to cover both the bare-call and `.success`/`.error` call shapes used across the file, which is a real fix over the prior mock that only covered `.success`/`.error`.

Nits — 5 non-blocking
  • nit: apps/loopover-ui/src/routes/app.runs.test.tsx — `mapAgentRunKind` tests don't cover the case where `kind` is an empty string or other falsy-but-defined value distinct from `null`, though this is a minor gap given the exhaustive branch coverage already present.
  • nit: the long-file smell on app.runs.tsx (575 lines) predates this diff (the only production change is 4 `export` keyword additions) and isn't something this PR should be asked to fix.
  • Consider adding a direct assertion that `mapAgentRunBundle`'s `recommendations` field filters out non-string/empty values via `isString`, since that branch isn't explicitly exercised in the new `mapAgentRunBundle` describe block.
  • Possible screenshot-table issue: identical images (row 1) — Advisory only — verify the screenshot-table images against the stated change before deciding.
  • Possible screenshot-table issue: identical images (row 2) — Advisory only — verify the screenshot-table images against the stated change before deciding.

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 · LLM: moderate
Linked issue satisfaction

Addressed
The diff adds direct unit tests for all four branches of mapSignalFidelity and mapAgentRunKind, exercises the full repo-fallback chain in mapAgentRunBundle (action-level, payload, input, and unknown fallback), and adds a render-level SavedViews test covering save/apply/remove plus persistence, matching all four listed deliverables.

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.

@loopover-orb loopover-orb Bot closed this Jul 26, 2026
@github-actions
github-actions Bot had a problem deploying to preview/pr-8778 July 26, 2026 04:23 Failure
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