Skip to content

chore: better fetching#1563

Merged
ctrlc03 merged 3 commits into
mainfrom
chore/dashboard-improvements
May 29, 2026
Merged

chore: better fetching#1563
ctrlc03 merged 3 commits into
mainfrom
chore/dashboard-improvements

Conversation

@ctrlc03

@ctrlc03 ctrlc03 commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added explicit "No ballots" indicators and idle messaging for polls that close with no submissions
    • Implemented sticky-footer page layout for improved appearance
  • Bug Fixes

    • Improved poll state logic and active vs. past grouping to reflect ballot presence
    • Clarified stage/status displays and notes when no ballots are observed
    • Show a dash for missing request block/timestamp in inspector views
  • Chores

    • Updated example environment values and default network/deploy fallbacks

Review Change Stack

@ctrlc03 ctrlc03 requested a review from 0xjei May 29, 2026 14:23
@vercel

vercel Bot commented May 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
enclave-enclave-dashboard Ready Ready Preview, Comment May 29, 2026 3:01pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
crisp Skipped Skipped May 29, 2026 3:01pm
enclave-docs Skipped Skipped May 29, 2026 3:01pm

Request Review

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f7797811-3c71-40d4-8885-635ed800429b

📥 Commits

Reviewing files that changed from the base of the PR and between b638a57 and 69294d8.

📒 Files selected for processing (8)
  • packages/enclave-dashboard/.env.example
  • packages/enclave-dashboard/src/App.tsx
  • packages/enclave-dashboard/src/Inspector.tsx
  • packages/enclave-dashboard/src/PollCard.tsx
  • packages/enclave-dashboard/src/lib/adapt.ts
  • packages/enclave-dashboard/src/lib/chain.ts
  • packages/enclave-dashboard/src/lib/e3.ts
  • packages/enclave-dashboard/src/styles.css
🚧 Files skipped from review as they are similar to previous changes (7)
  • packages/enclave-dashboard/src/lib/chain.ts
  • packages/enclave-dashboard/.env.example
  • packages/enclave-dashboard/src/styles.css
  • packages/enclave-dashboard/src/PollCard.tsx
  • packages/enclave-dashboard/src/Inspector.tsx
  • packages/enclave-dashboard/src/App.tsx
  • packages/enclave-dashboard/src/lib/adapt.ts

📝 Walkthrough

Walkthrough

This PR adds ballot-aware lifecycle detection for CRISP E3s (marking tally windows with zero ballots as idle/noBallots), threads that flag through data adapters, updates active/past poll filtering and poll-card/inspector UI to surface "No ballots" / "Idle" messaging, and refreshes Sepolia contract addresses and deploy-block defaults; also adds a sticky-footer layout wrapper.

Changes

E3 Poll Ballot-Aware Lifecycle and UI

Layer / File(s) Summary
E3 lifecycle with ballot-aware active detection
packages/enclave-dashboard/src/lib/e3.ts
isE3Active accepts ballot context and treats CRISP E3s with zero ballots as inactive after input window closes. E3FullDetails adds requestEventBlock, fetchE3Details scans from DEPLOY_BLOCK and sets requestedAt/requestEventBlock from event data.
Contract addresses and deploy block configuration
packages/enclave-dashboard/src/lib/chain.ts, packages/enclave-dashboard/.env.example
Sepolia fallback contract addresses and DEPLOY_BLOCK default updated; .env.example placeholders adjusted; env vars still override defaults.
Adapt inspector detail with noBallots flag
packages/enclave-dashboard/src/lib/adapt.ts
Add InspectorDetail.noBallots: boolean, compute it in adaptInspectorDetail, branch compute.status/note to idle when true, widen requestedBlock to `number
Poll list filtering and ballot-aware state calculation
packages/enclave-dashboard/src/App.tsx
pollStateForStage now accepts ballot count and returns idle for closed tally windows with no ballots. activePolls/pastPolls memos depend on nowTick and pass { e3Program, ballotCount } into isE3Active.
Poll card UI for idle state
packages/enclave-dashboard/src/PollCard.tsx
Add StageBadge with optional label override; detect isIdle and show "Closed · no ballots" main time text, idle-specific subtext, and an idle CTA message; pass "No ballots" label when idle.
Inspector UI customization for no ballots
packages/enclave-dashboard/src/Inspector.tsx
InspStatusBadge accepts label override; stageStatus returns "No ballots"/"Skipped" for later stages when e3.noBallots is true; request block displays '—' when missing.
Sticky footer layout
packages/enclave-dashboard/src/styles.css
Add .page full-height flex wrapper, make .main flexible, and set .site-foot to not shrink to enable sticky-footer behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • gnosisguild/enclave#1548: Introduces E3Summary.ballotCount and CRISP ballot counting, which this PR consumes for ballot-aware lifecycle detection.
  • gnosisguild/enclave#1391: Updates Sepolia fallback addresses and deploy block defaults related to dashboard scanning behavior.

Suggested reviewers

  • 0xjei
  • hmzakhalid

"I nibble through code, quick and light,
When ballots are none, I show the sight.
Closed and quiet, the dashboard will say,
'No ballots'—no fuss, no compute to play,
A rabbit’s cheer for clearer day!" 🐇✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'chore: better fetching' is vague and generic, not clearly describing the substantive changes across multiple components like poll state handling, ballot presence detection, inspector status updates, and contract address updates. Use a more specific title that captures the main change, such as 'chore: account for ballot presence in poll state and E3 status determination' or 'refactor: improve E3 activity detection and display based on ballot count'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/dashboard-improvements

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/enclave-dashboard/src/App.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

packages/enclave-dashboard/src/Inspector.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

packages/enclave-dashboard/src/PollCard.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

  • 4 others

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 and usage tips.

0xjei
0xjei previously approved these changes May 29, 2026

@0xjei 0xjei 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.

utACK

@coderabbitai coderabbitai 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/enclave-dashboard/src/App.tsx`:
- Around line 200-207: The current filters treat any poll where isE3Active(...)
is false as past, which hides real "idle" polls (input window closed with zero
ballots); update the activePolls filter to include those idle polls by changing
its predicate to: keep a poll if isE3Active(p.stage, p.inputWindow[1], {
e3Program: p.e3Program, ballotCount: p.ballotCount }) OR if p.ballotCount === 0
and Date.now() > p.inputWindow[1] (i.e., input window closed with zero ballots),
and adjust pastPolls to be the inverse of that same combined condition so idle
polls are not treated as past; reference activePolls, pastPolls, isE3Active,
p.inputWindow, and p.ballotCount.
- Around line 200-207: The active/past partitions (activePolls and pastPolls
using useMemo) rely on isE3Active which uses current time, but the memos only
list polls as a dependency; update these memos to also depend on the clock/tick
value so they recompute as time advances. Locate activePolls and pastPolls in
App.tsx and add the same time-derived dependency used elsewhere (e.g., a now or
tick value from your clock hook or Date.now() state) to the dependency arrays so
isE3Active is recalculated every tick and polls move between buckets in real
time.

In `@packages/enclave-dashboard/src/lib/adapt.ts`:
- Around line 166-167: The adapter currently coerces a missing requestEventBlock
to 0; change the mapping for the requestedBlock property in the adapter (where
requestedAt and requestedBlock are set) to preserve null (e.g., requestedBlock:
detail.requestEventBlock != null ? Number(detail.requestEventBlock) : null) and
update the emitted type to allow number | null; then update the Inspector
component (Inspector) to render null as "—" so absent blocks are shown as
missing instead of "`#0`".

In `@packages/enclave-dashboard/src/lib/e3.ts`:
- Around line 300-305: After finding the requestLog, stop using the constant
DEPLOY_BLOCK for subsequent scans and set fromBlock to requestLog.blockNumber
(falling back to DEPLOY_BLOCK if requestLog is undefined); update the queries
that fetch committee/input/result logs to start from that fromBlock instead of
DEPLOY_BLOCK to avoid full-history scans (note: e3.requestBlock stores a
timestamp, so do not use its value as a block number). Ensure the code paths
that call requestLog, the fromBlock variable, and the committee/input/result
query calls are adjusted accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 47a2abd9-ad8a-4239-bcf9-431e9ee16f7f

📥 Commits

Reviewing files that changed from the base of the PR and between 21b7bae and b638a57.

📒 Files selected for processing (8)
  • packages/enclave-dashboard/.env.example
  • packages/enclave-dashboard/src/App.tsx
  • packages/enclave-dashboard/src/Inspector.tsx
  • packages/enclave-dashboard/src/PollCard.tsx
  • packages/enclave-dashboard/src/lib/adapt.ts
  • packages/enclave-dashboard/src/lib/chain.ts
  • packages/enclave-dashboard/src/lib/e3.ts
  • packages/enclave-dashboard/src/styles.css

Comment thread packages/enclave-dashboard/src/App.tsx
Comment thread packages/enclave-dashboard/src/lib/adapt.ts Outdated
Comment thread packages/enclave-dashboard/src/lib/e3.ts
@ctrlc03 ctrlc03 force-pushed the chore/dashboard-improvements branch from b638a57 to 69294d8 Compare May 29, 2026 15:00
@vercel vercel Bot temporarily deployed to Preview – enclave-docs May 29, 2026 15:00 Inactive
@vercel vercel Bot temporarily deployed to Preview – crisp May 29, 2026 15:00 Inactive
@ctrlc03 ctrlc03 enabled auto-merge (squash) May 29, 2026 15:01
@ctrlc03 ctrlc03 requested a review from 0xjei May 29, 2026 15:01
@ctrlc03 ctrlc03 merged commit c9faee4 into main May 29, 2026
30 checks passed
@github-actions github-actions Bot deleted the chore/dashboard-improvements branch June 6, 2026 03:23
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