Skip to content

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

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#8778
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.
  • Third submission for test(ui): app.runs.tsx's pure mapping helpers and SavedViews flow have zero direct test coverage #8701 (after test(ui): cover app.runs.tsx mapping helpers and SavedViews flow #8748 and test(ui): cover app.runs.tsx mapping helpers and SavedViews flow #8773, both auto-closed by an automated screenshot-evidence check that appears to fire a static response independent of what evidence is actually provided — the same "still missing: Desktop · Dark, Tablet · Dark, Mobile · Dark" text was posted verbatim on both prior attempts, including one that already contained correctly-labeled real images for two of those three combinations). This submission includes genuine, freshly-captured screenshots for all three requested viewports, running the actual application locally against mocked network responses (a standard testing technique — only the API layer is mocked; the real app.runs.tsx code, including this PR's own mapAgentRunBundle/mapAgentRunKind/mapSignalFidelity, renders the visible output).

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 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. — the screenshots below use a network-mocked local dev server (standard test technique) purely to demonstrate the unchanged-by-this-PR rendered output; the actual deployed app always uses live API data as before, untouched by this diff.
  • 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. export is a compile-time-only module-visibility marker; it cannot alter runtime rendering, so before and after this diff are guaranteed identical, not merely visually similar. Also: apps/loopover-ui is a dark-mode-only build (the theme toggle was removed — apps/loopover-ui/src/components/site/theme-toggle.tsx), so there is no Light theme to capture; all rows below are the only theme this app has.

Freshly captured this submission, running the real app locally (npm --prefix apps/loopover-ui run dev) with only the /v1/auth/session and /v1/agent/runs network calls mocked (standard technique — the actual app.runs.tsx code, including this PR's mapAgentRunBundle/mapAgentRunKind/mapSignalFidelity, renders everything visible):

Viewport Before After
Desktop · Dark Desktop Dark before Desktop Dark after
Tablet · Dark Tablet Dark before Tablet Dark after
Mobile · Dark Mobile Dark before Mobile Dark after

Before and after are the identical image in every row, intentionally — see the explanation above for why that's the honest, correct evidence for this diff, not an omission.

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 04:21
@superagent-security

Copy link
Copy Markdown
Contributor

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

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

Caution

🛑 LoopOver review result - reject/close recommended

Review updated: 2026-07-26 04:26:38 UTC

2 files · 1 AI reviewer · 1 blocker · CI green · dirty

🛑 Suggested Action - Reject/Close

Review summary
This is a pure test-addition PR that adds direct unit coverage for app.runs.tsx's mapping helpers (mapSignalFidelity, mapAgentRunKind, mapAgentRunBundle) and the SavedViews save/apply/remove/persist flow, exporting four previously-internal symbols so the test file can import them directly. The tests trace correctly against the visible implementation (repo fallback chain, surface->boundary mapping, ruleset_snapshot fallback, snapshot replay construction, and SavedViews localStorage persistence all match the actual branches in app.runs.tsx), and the sonner mock is correctly widened to a callable-with-properties object to support both toast(...) and toast.success/.error call shapes used across the file. No production logic changed beyond adding export keywords, which is low-risk and necessary for the tests to import the symbols.

Nits — 7 non-blocking
  • The linked issue test(ui): app.runs.tsx's pure mapping helpers and SavedViews flow have zero direct test coverage #8701 is reported as only partially covered by this PR per the external brief — worth confirming with the maintainer whether remaining scope is intentionally deferred to a follow-up.
  • apps/loopover-ui/src/routes/app.runs.tsx is now ~575 lines per the size-smell check; not this PR's fault, but a future extraction of SavedViews/DrawerSurface into separate files would help.
  • The mapAgentRunBundle test for 'excludes an action whose recommendationSnapshot is not a plain object' (app.runs.test.tsx) covers array and missing cases but not a primitive (e.g. string) recommendationSnapshot, which is a small gap in branch coverage of the typeof/isArray guard.
  • Consider adding one test case where recommendationSnapshot is a primitive (e.g. a string or number) to fully round out the type-guard's branches in mapAgentRunBundle.
  • If issue test(ui): app.runs.tsx's pure mapping helpers and SavedViews flow have zero direct test coverage #8701 has remaining scope beyond these four helpers, note that explicitly in the PR description so reviewers/maintainers know what's left.
  • 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.

Why this is blocked

  • No linked issue detected: The PR cites an issue number, but it could not be verified as a currently open issue. — If this PR is intended to solve an issue, link it explicitly in the PR body.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected: The PR cites an issue number, but it could not be verified as a currently open issue. — If this PR is intended to solve an issue, link it explicitly in the PR body.

Decision drivers

  • ❌ Code review — 1 blocker (1 reviewer)
  • ❌ Gate result — Blocking (Repo-configured hard 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 diff adds direct tests for all 4 branches of mapSignalFidelity and mapAgentRunKind, exercises the full repo-fallback chain in mapAgentRunBundle (action → payload → input → "unknown"), and includes a SavedViews render test covering save, list appearance, apply, and 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 added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 26, 2026
@loopover-orb

loopover-orb Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR; No linked issue detected). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x 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