Skip to content

fix(ui): page skipped-PR audit feed by offset instead of growing limit - #7507

Merged
loopover-orb[bot] merged 3 commits into
JSONbored:mainfrom
RealDiligent:fix/audit-feed-offset-pagination-7438-v2
Jul 20, 2026
Merged

fix(ui): page skipped-PR audit feed by offset instead of growing limit#7507
loopover-orb[bot] merged 3 commits into
JSONbored:mainfrom
RealDiligent:fix/audit-feed-offset-pagination-7438-v2

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • Add a real offset query parameter to /v1/app/skipped-pr-audit (and MCP loopover_get_skipped_pr_audit) so pages are sliced server-side instead of growing limit.
  • Change AuditFeed "Load more" to request the next offset page and append rows, so already-visible events never drop or reorder when newer skips land.
  • Guard loadMore with a request-generation counter so an in-flight append cannot overwrite a newer filter result (addresses the fix(ui): page skipped-PR audit feed by offset instead of growing limit #7506 review blocker).
  • Filter apply/reset reload from offset=0 and replace the list.

Closes #7438

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
  • npm run typecheck
  • npm run test:coverage locally
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi (regenerated apps/loopover-ui/public/openapi.json)
  • npm run ui:lint on touched audit-feed files
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Local: vitest for skipped-pr-audit, mcp-skipped-pr-audit, integration skipped-PR audit, and audit-feed.test.tsx (15 pass, including mid-flight filter race). Remaining checks deferred to CI.

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.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

Behavior-only pagination fix on the auth-gated AuditFeed. No at-rest public visual delta — before/after are the same production dark-mode captures at each required viewport. loopover-ui is dark-mode-only.

Viewport · Theme 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

Notes

RealDiligent and others added 2 commits July 20, 2026 22:08
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 20, 2026 14:25
@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-7507 July 20, 2026 14:27 Failure
Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.40%. Comparing base (fa67da4) to head (9024469).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7507      +/-   ##
==========================================
- Coverage   91.41%   91.40%   -0.02%     
==========================================
  Files         717      717              
  Lines       73038    73041       +3     
  Branches    21635    21639       +4     
==========================================
- Hits        66768    66760       -8     
- Misses       5227     5234       +7     
- Partials     1043     1047       +4     
Flag Coverage Δ
shard-1 35.25% <0.00%> (-0.02%) ⬇️
shard-2 41.91% <0.00%> (-0.01%) ⬇️
shard-3 35.07% <87.50%> (-0.09%) ⬇️
shard-4 40.60% <50.00%> (-0.04%) ⬇️
shard-5 30.96% <0.00%> (+<0.01%) ⬆️
shard-6 30.73% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/api/routes.ts 95.03% <100.00%> (+<0.01%) ⬆️
src/db/repositories.ts 96.72% <100.00%> (+<0.01%) ⬆️
src/mcp/server.ts 96.39% <100.00%> (ø)
src/openapi/schemas.ts 100.00% <ø> (ø)
src/openapi/spec.ts 99.47% <ø> (ø)

... and 2 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 20, 2026
@loopover-orb

loopover-orb Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-20 17:50:26 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR replaces the growing-limit pagination for the skipped-PR audit feed with real server-side offset paging, threading `offset` through the repository query, API route, MCP tool, OpenAPI spec/generated JSON, and the UI's load-more flow, which now appends rather than replaces rows. The client guards against the #7506 race (a filter/replace load invalidating an in-flight loadMore) with a request-generation counter, and the repository layer correctly over-fetches SQL rows to cover offset+limit+1 before slicing, matching the existing over-fetch pattern used for parse failures. Test coverage is thorough — offset paging at the repository, route, MCP, and UI layers, plus a specific regression test for the mid-flight filter race.

Nits — 5 non-blocking
  • src/db/repositories.ts:3231 introduces new magic numbers (2500, 5, 20) for the row over-fetch heuristic without a named constant explaining the multiplier/cap choice.
  • The over-fetch formula duplicates the shape of the pre-existing `rowLimit = Math.min(500, limit * 5 + 20)` logic; consider a short comment or helper documenting why `neededParsed * 5 + 20` capped at 2500 is the right ratio as offset grows.
  • audit-feed.tsx's loadMore captures `itemsAtStart` and appends synchronously; if `data` changes shape between capturing and the response landing (outside the generation-guarded filter case), there's no explicit invariant check, though the generation ref should cover the realistic cases.
  • Consider extracting the over-fetch row-limit formula in src/db/repositories.ts into a small named constant or comment for future maintainers tuning the multiplier.
  • The openapi.json diff is auto-generated and consistent with the schema changes — no action needed beyond confirming `npm run ui:openapi` was rerun (checked off in the PR 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 #7438
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: 382 registered-repo PR(s), 179 merged, 34 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 382 PR(s), 34 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, Ruby, Svelte, TypeScript, Markdown, MDX
  • Official Gittensor activity: 382 PR(s), 34 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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 &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; 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
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (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)
/ before / (scroll)
before / (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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 98a8371 into JSONbored:main Jul 20, 2026
16 checks passed
This was referenced Jul 20, 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.

fix(ui): AuditFeed "Load more" can drop or reorder already-visible rows because it has no offset/cursor

1 participant