fix: clamp round tracker display for overdue rounds#732
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 2 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.
| 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] | ||
| ); |
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
blocksRemainingto ≥ 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🤖 Generated with Claude Code
https://claude.ai/code/session_01JoKwkmU3jMU6DMGoTcCKRe