Skip to content

feat(frontend): show item counts in contract page section headers - #181

Merged
thewealthyplace merged 2 commits into
prism-explorer:mainfrom
solaawojobi00-bit:fix/issue-79-section-item-counts
Oct 22, 2026
Merged

thewealthyplace merged 2 commits into
prism-explorer:mainfrom
solaawojobi00-bit:fix/issue-79-section-item-counts

Conversation

@solaawojobi00-bit

Copy link
Copy Markdown
Contributor

Show item counts in contract page section headers

Problem

The contract page's Storage, Recent Invocations and Events sections don't say how many items they hold, so a short list looks the same as a truncated one.

Scenario Before After
Storage with 7 keys no count Storage (7)
12 invocations, not capped no count Recent Invocations (12)
Events list at its limit with more available looks complete Events (50+) and "showing the latest 50, older not shown"

Solution

Each header shows its count. A capped list shows N+ and a note. For invocations and events the count updates with the 15s auto-refresh. With an indexer, capped means the API returned a nextCursor. On the RPC fallback, which never returns a cursor, a list that fills its limit counts as capped. Storage is not capped, so it has no note.

Changes

  • frontend/src/components/SectionCount.tsx (new): count badge and the isCapped helper.
  • frontend/src/components/LiveInvocationHistory.tsx, LiveEventLog.tsx: render their own <h2> with the live count, and track nextCursor from the API response.
  • frontend/src/app/(app)/contract/[id]/page.tsx: use the *Page fetchers to get nextCursor, add the storage count, and pass the limits and the RPC-fallback flag.

Regression Tests

Acceptance criterion Test
Each header shows its count Not added in this PR (see Notes)
A capped list says so Not added in this PR (see Notes)

Testing

  • npx tsc --noEmit: 36 errors, the same 36 as on main at fdf0721. None are in the files changed here.
  • npx vitest run: 8 files and 31 tests fail. This was not compared against main, so some of those failures may not predate this PR.

Notes for Reviewers

  • Upstream main CI is already red (its last 5 runs failed). Examples: shortHash, DetailRow and EmptyState are not imported, and rateLimitRequest is used without an import in the events and invocations routes. I left those alone to stay in scope.
  • No new tests were added. This PR was meant to stay minimal.

Closes #79

@drips-wave

drips-wave Bot commented Oct 22, 2026

Copy link
Copy Markdown

@solaawojobi00-bit Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

@thewealthyplace is attempting to deploy a commit to the thewealthyplace100-8633's projects Team on Vercel.

A member of the Team first needs to authorize it.

@thewealthyplace
thewealthyplace merged commit 7a9da62 into prism-explorer:main Oct 22, 2026
1 check failed
@solaawojobi00-bit
solaawojobi00-bit deleted the fix/issue-79-section-item-counts branch October 22, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show item counts in the section headers

2 participants