Skip to content

feat: new overview design #2022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2025
Merged

feat: new overview design #2022

merged 3 commits into from
Jun 11, 2025

Conversation

kemuru
Copy link
Contributor

@kemuru kemuru commented Jun 10, 2025

PR-Codex overview

This PR focuses on enhancing the DisputeInfoCard, DisputeContext, and Verdict components by adding new props for better functionality and integrating additional data handling, especially around voting history and dispute details.

Detailed summary

  • Added isList and isOverview props to CardLabel.
  • Updated DisputeContext to accept disputeId and votingHistory.
  • Enhanced Verdict component to include votingHistory.
  • Improved FinalDecision to use votingHistory and adjusted button text.
  • Modified DisputeTimeline to include enforcement details and transaction links.
  • Introduced new SVG icons and styling adjustments in various components.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features
    • Enhanced dispute context display with new indicators for ruling status and juror rewards dispersion.
    • Added contextual labels showing dispute ID and last round index when user is connected.
  • Refactor
    • Streamlined dispute timeline to consolidate enforcement events and simplify visual presentation.
    • Updated components to receive voting history data via props instead of internal queries.
    • Adjusted button text and improved layout consistency in the verdict and final decision sections.
    • Improved card label styling for overview mode with flexible layout adjustments.
    • Modified component props to better integrate voting history and dispute identifiers across dispute-related views.

Copy link
Contributor

coderabbitai bot commented Jun 10, 2025

Walkthrough

The changes update several components to accept votingHistory and, where relevant, dispute as props instead of fetching them internally. Timeline and indicator logic is consolidated and simplified, with enforcement and reward status now handled within timeline items and context. Prop interfaces and usages are updated throughout to reflect these changes.

Changes

File(s) Change Summary
web/src/components/DisputePreview/DisputeContext.tsx Enhanced to accept dispute, disputeId, and votingHistory props; computes juror rewards status; updates layout and conditional indicators; uses useAccount hook.
web/src/components/Verdict/DisputeTimeline.tsx Refactored timeline construction; enforcement event consolidated into timeline items; removed redundant enforcement UI and queries; simplified icon logic.
web/src/components/Verdict/FinalDecision.tsx Now receives votingHistory as a prop; removes internal fetching and reward indicator logic; simplifies button text and layout; consolidates voting link rendering.
web/src/components/Verdict/index.tsx Updated interface and component to accept and pass votingHistory prop; passes votingHistory to FinalDecision; no change to DisputeTimeline props.
web/src/pages/Cases/CaseDetails/Overview/index.tsx Updated component invocations to pass votingHistory, dispute, and disputeId props to DisputeContext; added votingHistory to Verdict.
web/src/components/DisputeView/CardLabels/index.tsx Added optional isOverview prop to CardLabel and styled container; applies conditional styling when isOverview is true.
web/src/components/DisputeView/DisputeInfo/DisputeInfoCard.tsx Added explicit isList={false} prop to CardLabel invocation; no other changes.

Sequence Diagram(s)

sequenceDiagram
    participant OverviewPage
    participant DisputeContext
    participant Verdict
    participant FinalDecision
    participant DisputeTimeline

    OverviewPage->>DisputeContext: Render with {dispute, disputeDetails, votingHistory, disputeId, isRpcError}
    OverviewPage->>Verdict: Render with {arbitrable, votingHistory}
    Verdict->>FinalDecision: Pass {arbitrable, votingHistory}
    Verdict->>DisputeTimeline: Pass {arbitrable}
    DisputeContext->>DisputeContext: Compute jurorRewardsDispersed from votingHistory
    DisputeContext->>DisputeContext: Conditionally render ruling and rewards indicators
    DisputeTimeline->>DisputeTimeline: Build timeline items (including enforcement) from props
Loading

Poem

🐇
In the garden where verdicts grow,
New props arrive, rewards now show.
Timelines pruned and logic neat,
Disputes and votes in one retreat.
The bunnies cheer this tidy view—
More carrots for the clever crew! 🥕
🐰


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78508f5 and f5f2530.

📒 Files selected for processing (3)
  • web/src/components/DisputePreview/DisputeContext.tsx (2 hunks)
  • web/src/components/DisputeView/DisputeInfo/DisputeInfoCard.tsx (1 hunks)
  • web/src/pages/Cases/CaseDetails/Overview/index.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • web/src/components/DisputeView/DisputeInfo/DisputeInfoCard.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • web/src/pages/Cases/CaseDetails/Overview/index.tsx
  • web/src/components/DisputePreview/DisputeContext.tsx
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: SonarCloud
  • GitHub Check: contracts-testing
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Redirect rules - kleros-v2-testnet-devtools
  • GitHub Check: Redirect rules - kleros-v2-neo
  • GitHub Check: Redirect rules - kleros-v2-university
  • GitHub Check: Header rules - kleros-v2-testnet-devtools
  • GitHub Check: Header rules - kleros-v2-neo
  • GitHub Check: Header rules - kleros-v2-university
  • GitHub Check: Pages changed - kleros-v2-testnet-devtools
  • GitHub Check: Pages changed - kleros-v2-neo
  • GitHub Check: Pages changed - kleros-v2-university
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Jun 10, 2025

Deploy Preview for kleros-v2-university failed. Why did it fail? →

Name Link
🔨 Latest commit f5f2530
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-university/deploys/6848cf315fc1450008a1b6d2

Copy link

netlify bot commented Jun 10, 2025

Deploy Preview for kleros-v2-testnet-devtools ready!

Name Link
🔨 Latest commit f5f2530
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet-devtools/deploys/6848cf316784e300082fec38
😎 Deploy Preview https://deploy-preview-2022--kleros-v2-testnet-devtools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Jun 10, 2025

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit f5f2530
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-neo/deploys/6848cf31ce68530008fbec25
😎 Deploy Preview https://deploy-preview-2022--kleros-v2-neo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Jun 10, 2025

Deploy Preview for kleros-v2-testnet ready!

Name Link
🔨 Latest commit f5f2530
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet/deploys/6848cf31bec6ad000825b069
😎 Deploy Preview https://deploy-preview-2022--kleros-v2-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4adedb5 and 47aaca4.

⛔ Files ignored due to path filters (1)
  • web/src/assets/svgs/icons/gavel-executed.svg is excluded by !**/*.svg
📒 Files selected for processing (5)
  • web/src/components/DisputePreview/DisputeContext.tsx (3 hunks)
  • web/src/components/Verdict/DisputeTimeline.tsx (3 hunks)
  • web/src/components/Verdict/FinalDecision.tsx (5 hunks)
  • web/src/components/Verdict/index.tsx (2 hunks)
  • web/src/pages/Cases/CaseDetails/Overview/index.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
web/src/components/DisputePreview/DisputeContext.tsx (4)
web/src/hooks/queries/useDisputeDetailsQuery.ts (1)
  • DisputeDetailsQuery (8-8)
web/src/hooks/queries/useVotingHistory.ts (1)
  • VotingHistoryQuery (8-8)
web/src/components/StyledSkeleton.tsx (1)
  • StyledSkeleton (8-10)
web/src/components/Divider.tsx (1)
  • Divider (3-10)
web/src/components/Verdict/DisputeTimeline.tsx (5)
web/src/utils/index.ts (1)
  • getTxnExplorerLink (13-14)
web/src/components/ExternalLink.tsx (1)
  • ExternalLink (5-9)
web/src/utils/date.ts (1)
  • formatDate (23-37)
web/src/utils/getVoteChoice.ts (1)
  • getVoteChoice (5-14)
web/src/components/StyledIcons/ClosedCircleIcon.tsx (1)
  • StyledClosedCircle (5-9)
web/src/components/Verdict/FinalDecision.tsx (1)
web/src/hooks/queries/useVotingHistory.ts (1)
  • VotingHistoryQuery (8-8)
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: Redirect rules - kleros-v2-neo
  • GitHub Check: Header rules - kleros-v2-neo
  • GitHub Check: Pages changed - kleros-v2-neo
  • GitHub Check: Redirect rules - kleros-v2-testnet-devtools
  • GitHub Check: Header rules - kleros-v2-testnet-devtools
  • GitHub Check: Pages changed - kleros-v2-testnet-devtools
  • GitHub Check: Redirect rules - kleros-v2-university
  • GitHub Check: Header rules - kleros-v2-university
  • GitHub Check: Pages changed - kleros-v2-university
  • GitHub Check: contracts-testing
  • GitHub Check: SonarCloud
🔇 Additional comments (9)
web/src/pages/Cases/CaseDetails/Overview/index.tsx (1)

59-59: LGTM! Clean prop passing implementation.

The changes correctly pass votingHistory and dispute data to child components, following the pattern of lifting data fetching up and passing it down as props.

Also applies to: 62-62

web/src/components/Verdict/index.tsx (1)

6-7: LGTM! Proper type-safe prop drilling.

The component correctly accepts and passes down votingHistory to FinalDecision while maintaining type safety with the imported VotingHistoryQuery type.

Also applies to: 19-19, 22-22, 25-26

web/src/components/Verdict/FinalDecision.tsx (2)

15-15: LGTM! Clean refactor to prop-based data flow.

The component correctly receives votingHistory as a prop instead of fetching it internally, which improves data flow consistency across the application.

Also applies to: 82-82, 85-85


103-108: Good UI consolidation.

The button text logic has been simplified and the voting link rendering is now consolidated within the VerdictContainer, making the component structure cleaner.

Also applies to: 133-139

web/src/components/DisputePreview/DisputeContext.tsx (2)

92-93: Good use of useMemo for derived state.

The jurorRewardsDispersed computation is properly memoized to avoid unnecessary recalculations.


98-109: Clean UI restructuring with conditional rendering.

The new TitleSection wrapper and conditional rendering of RulingAndRewardsIndicators properly consolidates the UI logic that was previously spread across components.

web/src/components/Verdict/DisputeTimeline.tsx (3)

66-71: Good separation of concerns for transaction links.

Splitting the explorer links into txnDisputeCreatedLink and txnEnforcementLink improves clarity and maintainability.


75-75: Clean timeline structure with early return pattern.

The early return for missing dispute data and the separation of base timeline items improve code readability and maintainability.

Also applies to: 80-92


131-142: Well-implemented enforcement timeline item.

The conditional addition of the enforcement item with appropriate icon and transaction link properly completes the dispute timeline visualization.

@kemuru kemuru marked this pull request as ready for review June 11, 2025 00:02
@kemuru kemuru requested a review from a team as a code owner June 11, 2025 00:02
@kemuru kemuru requested review from alcercu and tractorss June 11, 2025 00:02
coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 11, 2025
Copy link

codeclimate bot commented Jun 11, 2025

Code Climate has analyzed commit f5f2530 and detected 8 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 8

View more on Code Climate.

Copy link

@jaybuidl
Copy link
Member

Before/After
image

@jaybuidl jaybuidl added Type: Enhancement ✨ Package: Web Court web frontend Type: UX User Experience labels Jun 11, 2025
Copy link
Contributor

@alcercu alcercu left a comment

Choose a reason for hiding this comment

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

lgtm

@alcercu alcercu merged commit 0b75799 into dev Jun 11, 2025
21 of 26 checks passed
@kemuru kemuru deleted the feat/new-overview-design branch June 11, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: Web Court web frontend Type: Enhancement ✨ Type: UX User Experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants