Skip to content

fix: clamp round tracker display for overdue rounds#732

Open
rickstaa wants to merge 1 commit into
mainfrom
fix/round-tracker-display-clamp
Open

fix: clamp round tracker display for overdue rounds#732
rickstaa wants to merge 1 commit into
mainfrom
fix/round-tracker-display-clamp

Conversation

@rickstaa

Copy link
Copy Markdown
Member

Problem

When a round is overdue — its nominal end block has passed but no orchestrator has called initializeRound() yet — the Round tracker rendered overflow values: negative "blocks remaining", a >100% progress ring, and a donut count exceeding the round length (e.g. "6451 of 6377").

Fix

  • Detect the overdue state and swap to "Round #N ended approximately X ago. Awaiting an orchestrator to start round #N+1."
  • Clamp blocksRemaining to ≥ 0 and the ring / donut block count to the round length.

This restores #656, which was silently reverted by the #654 stale-branch clobber. It is independent of where round timing comes from, so it guards the UI regardless of the separate on-chain data-source change (#731).

Testing

  • tsc/eslint clean
  • Active round: "There are X blocks … remaining", ring fills proportionally
  • Overdue round: "Round #N ended … awaiting an orchestrator", ring stays at 100%, no negative numbers

🤖 Generated with Claude Code
https://claude.ai/code/session_01JoKwkmU3jMU6DMGoTcCKRe

Detect overdue rounds (nominal end passed, initializeRound() not yet
called) and swap the copy to "Round #N ended approximately X ago.
Awaiting an orchestrator to start round #N+1" instead of showing nonsense
like "-74 blocks remaining". Clamp blocksRemaining to >= 0 and the
progress ring / donut block count to the round length so they never
overflow (e.g. "6451 of 6377" or a >100% ring).

Restores the fix from #656, which was silently reverted by the #654
stale-branch clobber. Independent of the data source, so it protects the
UI whether round timing comes from the subgraph or on-chain.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01JoKwkmU3jMU6DMGoTcCKRe
Copilot AI review requested due to automatic review settings July 19, 2026 19:11
@rickstaa
rickstaa requested a review from ECWireless as a code owner July 19, 2026 19:11
@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
explorer-arbitrum-one Ready Ready Preview, Comment Jul 19, 2026 7:14pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@rickstaa, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: dfcfaf91-7e66-49f2-8178-8d6a526b3775

📥 Commits

Reviewing files that changed from the base of the PR and between 019650c and 3ffe159.

📒 Files selected for processing (1)
  • components/RoundStatus/index.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/round-tracker-display-clamp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI 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.

Pull request overview

Updates the Round tracker UI to handle “overdue” rounds (where the nominal end has passed but the next round hasn’t been initialized yet) by clamping displayed progress values and swapping the explanatory copy to avoid negative/overflowed numbers.

Changes:

  • Add overdue-round detection and render alternate messaging (“ended approximately X ago… awaiting an orchestrator…”).
  • Clamp blocksRemaining, the progress-ring percentage, and the displayed “blocks completed” count to valid ranges.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 54 to 60
const blocksRemaining = useMemo(
() =>
currentRoundInfo?.initialized && protocol
? +protocol.roundLength -
(+Number(currentRoundInfo.currentL1Block) -
+Number(currentRoundInfo.startBlock))
protocol
? Math.max(+protocol.roundLength - blocksSinceCurrentRoundStart, 0)
: 0,
[protocol, currentRoundInfo]
[protocol, blocksSinceCurrentRoundStart]
);
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.

2 participants