Skip to content

chore(web): style and button changes #2001

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
May 20, 2025
Merged

Conversation

kemuru
Copy link
Contributor

@kemuru kemuru commented May 19, 2025

PR-Codex overview

This PR focuses on updating components related to jurors and cases, introducing new buttons, modifying layouts, and removing unused components to enhance the user interface.

Detailed summary

  • Removed AllCasesButton from the project.
  • Introduced SeeAllJurorsButton and SeeAllCasesButton components.
  • Updated TopJurors to include SeeAllJurorsButton and adjusted layout.
  • Modified LatestCases to include SeeAllCasesButton and updated layout.
  • Adjusted margin and styling in several components.

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

Summary by CodeRabbit

  • New Features

    • Introduced a "See all" button for viewing all cases, optionally filtered by court.
    • Added a "See all" button for viewing all jurors.
  • Refactor

    • Replaced the previous "All Cases" and "Jurors Leaderboard" buttons with the new "See all" buttons in relevant sections.
    • Updated layouts to align titles and buttons horizontally for improved visual consistency.
    • Simplified props passed to case listing components by removing redundant court name usage.
  • Style

    • Adjusted spacing and alignment in header areas for a cleaner interface.

Copy link

netlify bot commented May 19, 2025

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

Name Link
🔨 Latest commit 7a5466b
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-university/deploys/682c8397631c3e000815de64

Copy link

netlify bot commented May 19, 2025

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit 7a5466b
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-neo/deploys/682c8397f9ac7f000879fe41
😎 Deploy Preview https://deploy-preview-2001--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 May 19, 2025

Deploy Preview for kleros-v2-testnet ready!

Name Link
🔨 Latest commit 7a5466b
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet/deploys/682c8397936bfe000860b73f
😎 Deploy Preview https://deploy-preview-2001--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 bot commented May 19, 2025

Walkthrough

This change removes the AllCasesButton component and introduces two new components: SeeAllCasesButton and SeeAllJurorsButton. The usage of these buttons is updated in the LatestCases and TopJurors components, with layout adjustments to integrate the new buttons inline with section titles.

Changes

Files Change Summary
web/src/components/AllCasesButton.tsx Deleted the AllCasesButton component and its related logic.
web/src/components/SeeAllCasesButton.tsx, web/src/components/SeeAllJurorsButton.tsx Added new components: SeeAllCasesButton (links to filtered cases) and SeeAllJurorsButton (links to jurors list).
web/src/components/LatestCases.tsx, web/src/pages/Home/TopJurors/index.tsx Replaced usage of AllCasesButton and JurorsLeaderboardButton with new "See all" buttons; updated layout to align buttons with titles.
web/src/pages/Courts/CourtDetails/index.tsx Removed spreading courtName prop to LatestCases, passing only title and filters explicitly.
web/web/README.md Removed trailing period from a sentence in the "Pre-Requisites" section.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LatestCases
    participant SeeAllCasesButton
    participant Router

    User->>LatestCases: View LatestCases section
    LatestCases->>SeeAllCasesButton: Render SeeAllCasesButton (with optional courtId)
    User->>SeeAllCasesButton: Click "See all"
    SeeAllCasesButton->>Router: Navigate to /cases/display/1/desc/[filter]
Loading
sequenceDiagram
    participant User
    participant TopJurors
    participant SeeAllJurorsButton
    participant Router

    User->>TopJurors: View TopJurors section
    TopJurors->>SeeAllJurorsButton: Render SeeAllJurorsButton
    User->>SeeAllJurorsButton: Click "See all"
    SeeAllJurorsButton->>Router: Navigate to /jurors/1/desc/all
Loading

Possibly related PRs

Suggested labels

Type: Enhancement :sparkles:, Package: Web

Suggested reviewers

  • alcercu

Poem

A button retired, two new ones appear,
"See all" for cases and jurors, now crystal clear.
Titles and buttons, aligned side by side—
Navigation is simple, with nothing to hide.
The bunny hops forward, with UI renewed,
Cheering for changes, with gratitude imbued!
🐇✨

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between f20c9d4 and 7a5466b.

📒 Files selected for processing (1)
  • web/README.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • web/README.md
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • 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-neo
  • GitHub Check: Redirect rules - kleros-v2-university
  • GitHub Check: Header rules - kleros-v2-neo
  • GitHub Check: Header rules - kleros-v2-university
  • GitHub Check: Analyze (javascript)
  • GitHub Check: SonarCloud
  • GitHub Check: Pages changed - kleros-v2-neo
  • GitHub Check: Pages changed - kleros-v2-university
  • GitHub Check: contracts-testing

🪧 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 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.

@kemuru kemuru changed the title chore: style and button changes chore(web): style and button changes May 19, 2025
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: 0

🧹 Nitpick comments (4)
web/src/components/SeeAllCasesButton.tsx (1)

19-19: Style inconsistency with SeeAllJurorsButton.

Unlike SeeAllJurorsButton which wraps its text in a <label> tag, this component renders the text directly. Consider using the same approach in both components for consistency.

-      <BlueIconTextButtonContainer>{labelText}</BlueIconTextButtonContainer>
+      <BlueIconTextButtonContainer>
+        <label>{labelText}</label>
+      </BlueIconTextButtonContainer>
web/src/components/LatestCases.tsx (1)

57-57: Unused prop being spread.

The courtName prop is being spread to SeeAllCasesButton, but that component doesn't use this prop in its interface or implementation.

-        <SeeAllCasesButton {...{ courtId, courtName }} />
+        <SeeAllCasesButton courtId={courtId} />
web/src/components/SeeAllJurorsButton.tsx (1)

10-10: Style consistency with SeeAllCasesButton.

You're using a <label> tag here, but SeeAllCasesButton renders text directly. Consider harmonizing the approach for better maintenance.

Either wrap text in labels in both components or use direct text in both.

web/src/pages/Home/TopJurors/index.tsx (1)

21-27: Gap inconsistency with LatestCases.

In LatestCases.tsx, the TitleAndButtonContainer uses gap: 4px 12px; while here it uses gap: 12px;. Consider using the same gap values for consistent spacing.

-  gap: 12px;
+  gap: 4px 12px;
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1ff55f8 and 036e897.

📒 Files selected for processing (5)
  • web/src/components/AllCasesButton.tsx (0 hunks)
  • web/src/components/LatestCases.tsx (2 hunks)
  • web/src/components/SeeAllCasesButton.tsx (1 hunks)
  • web/src/components/SeeAllJurorsButton.tsx (1 hunks)
  • web/src/pages/Home/TopJurors/index.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • web/src/components/AllCasesButton.tsx
🧰 Additional context used
🧬 Code Graph Analysis (2)
web/src/components/SeeAllJurorsButton.tsx (2)
web/src/components/InternalLink.tsx (1)
  • InternalLink (4-8)
web/src/components/BlueIconTextButtonContainer.tsx (1)
  • BlueIconTextButtonContainer (4-32)
web/src/components/SeeAllCasesButton.tsx (2)
web/src/components/InternalLink.tsx (1)
  • InternalLink (4-8)
web/src/components/BlueIconTextButtonContainer.tsx (1)
  • BlueIconTextButtonContainer (4-32)
⏰ Context from checks skipped due to timeout of 90000ms (16)
  • GitHub Check: SonarCloud
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-university
  • GitHub Check: Redirect rules - kleros-v2-neo
  • GitHub Check: contracts-testing
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-neo
  • GitHub Check: Header rules - kleros-v2-university
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-neo
  • GitHub Check: Pages changed - kleros-v2-university
  • GitHub Check: Mend Security Check
🔇 Additional comments (4)
web/src/components/SeeAllCasesButton.tsx (1)

12-22: Implementation looks clean and functional.

The SeeAllCasesButton component is well-constructed with good use of the encodeURIFilter utility to handle possible court filtering.

web/src/components/LatestCases.tsx (1)

20-27: Layout implementation looks good.

The new flex container for aligning the title and button is well-implemented with appropriate spacing.

web/src/components/SeeAllJurorsButton.tsx (1)

6-14: Implementation is simpler than SeeAllCasesButton.

This component uses a hardcoded URL unlike SeeAllCasesButton which supports filtering. This pattern difference is fine if no filtering is needed for jurors.

web/src/pages/Home/TopJurors/index.tsx (1)

61-64: Clean implementation of the new layout.

The title and button are now nicely aligned in a flex container, matching the pattern used in LatestCases for consistency.

coderabbitai[bot]
coderabbitai bot previously approved these changes May 19, 2025
Copy link

netlify bot commented May 19, 2025

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

Name Link
🔨 Latest commit 7a5466b
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet-devtools/deploys/682c8397bfb7960008602ab7
😎 Deploy Preview https://deploy-preview-2001--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.

@kemuru kemuru requested a review from alcercu May 19, 2025 14:55
@kemuru kemuru marked this pull request as ready for review May 19, 2025 14:55
@kemuru kemuru requested a review from a team as a code owner May 19, 2025 14:55
coderabbitai[bot]
coderabbitai bot previously approved these changes May 19, 2025
alcercu
alcercu previously approved these changes May 19, 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 enabled auto-merge May 19, 2025 16:40
@kemuru kemuru dismissed stale reviews from alcercu and coderabbitai[bot] via 7a5466b May 20, 2025 13:28
@kemuru kemuru requested a review from alcercu May 20, 2025 13:29
Copy link

codeclimate bot commented May 20, 2025

Code Climate has analyzed commit 7a5466b and detected 0 issues on this pull request.

View more on Code Climate.

Copy link

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 1ca9066 into dev May 20, 2025
22 of 26 checks passed
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