Skip to content
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

fix: pagination theming #114

Merged
merged 1 commit into from
Dec 4, 2024
Merged

Conversation

fmorency
Copy link
Contributor

@fmorency fmorency commented Dec 4, 2024

Fix pagination theming in bank, groups, and factory.

2024-12-04_11-10
2024-12-04_11-10_1
2024-12-04_11-10_2
2024-12-04_11-10_3
2024-12-04_11-10_4
2024-12-04_11-10_5

Summary by CodeRabbit

  • New Features

    • Enhanced pagination controls with theme-aware styling for light and dark modes across multiple components (HistoryBox, MyDenoms, YourGroups).
  • Bug Fixes

    • Improved visual consistency of pagination buttons, ensuring appropriate visibility and responsiveness to theme changes.
  • Style

    • Updated hover and active button styles to reflect the selected theme, enhancing user interface experience.

@fmorency fmorency requested a review from chalabi2 December 4, 2024 16:11
@fmorency fmorency self-assigned this Dec 4, 2024
Copy link
Contributor

coderabbitai bot commented Dec 4, 2024

Walkthrough

The pull request introduces updates to the pagination controls and styling within three components: HistoryBox, MyDenoms, and YourGroups. These changes focus on enhancing the visual consistency of pagination buttons by implementing theme-aware styles for light and dark modes. The hover and active states of the pagination buttons have been modified to ensure appropriate visibility across different themes. The underlying functionality of pagination and state management remains unchanged across all components.

Changes

File Path Change Summary
components/bank/components/historyBox.tsx Updated pagination button styles for dark mode support; modified hover and active button colors.
components/factory/components/MyDenoms.tsx Adjusted pagination button styles with theme-aware colors; hover and active button colors updated.
components/groups/components/myGroups.tsx Altered pagination button styles for dark mode; refined visual representation of pagination.

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • chalabi2

🐰 In the land of code where rabbits play,
Pagination buttons dance and sway.
With colors bright for day and night,
Our UI shines, a joyful sight!
So hop along, let's make it right,
In dark or light, our styles ignite! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 5 lines in your changes missing coverage. Please review.

Project coverage is 60.12%. Comparing base (2f624b1) to head (53b699c).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
components/bank/components/historyBox.tsx 57.14% 3 Missing ⚠️
components/factory/components/MyDenoms.tsx 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
- Coverage   60.13%   60.12%   -0.01%     
==========================================
  Files         146      146              
  Lines       14441    14443       +2     
==========================================
  Hits         8684     8684              
- Misses       5757     5759       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

🧹 Outside diff range and nitpick comments (4)
components/bank/components/historyBox.tsx (3)

175-177: Add ARIA label for better accessibility.

The previous page button should have an aria-label for better screen reader support.

 <button
   onClick={() => setCurrentPage(prev => Math.max(1, prev - 1))}
   disabled={currentPage === 1 || isLoading}
   className="p-2 hover:bg-[#0000001A] dark:hover:bg-[#FFFFFF1A] text-black dark:text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
+  aria-label="Previous page"
 >

203-207: Add aria-hidden for ellipsis.

The ellipsis should be marked as hidden from screen readers since it's decorative.

-return (
-  <span className="text-black dark:text-white" key={pageNum}>
+return (
+  <span className="text-black dark:text-white" key={pageNum} aria-hidden="true">
     ...
   </span>
 );
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 203-204: components/bank/components/historyBox.tsx#L203-L204
Added lines #L203 - L204 were not covered by tests


[warning] 206-206: components/bank/components/historyBox.tsx#L206
Added line #L206 was not covered by tests


215-217: Add ARIA label for better accessibility.

The next page button should have an aria-label for better screen reader support.

 <button
   onClick={() => setCurrentPage(prev => Math.min(totalPages, prev + 1))}
   disabled={currentPage === totalPages || isLoading}
   className="p-2 hover:bg-[#0000001A] dark:hover:bg-[#FFFFFF1A] text-black dark:text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
+  aria-label="Next page"
 >
components/factory/components/MyDenoms.tsx (1)

276-277: Add test coverage for pagination styling.

The pagination button styling logic lacks test coverage. Consider adding tests to verify the correct application of styles in both light and dark modes.

Would you like me to help generate test cases for the pagination styling?

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 276-277: components/factory/components/MyDenoms.tsx#L276-L277
Added lines #L276 - L277 were not covered by tests

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 2f624b1 and 53b699c.

📒 Files selected for processing (3)
  • components/bank/components/historyBox.tsx (2 hunks)
  • components/factory/components/MyDenoms.tsx (3 hunks)
  • components/groups/components/myGroups.tsx (3 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
components/factory/components/MyDenoms.tsx

[warning] 276-277: components/factory/components/MyDenoms.tsx#L276-L277
Added lines #L276 - L277 were not covered by tests

components/bank/components/historyBox.tsx

[warning] 203-204: components/bank/components/historyBox.tsx#L203-L204
Added lines #L203 - L204 were not covered by tests


[warning] 206-206: components/bank/components/historyBox.tsx#L206
Added line #L206 was not covered by tests

🔇 Additional comments (3)
components/bank/components/historyBox.tsx (1)

195-196: LGTM! Consistent theme-aware styling.

The implementation correctly handles both light and dark mode states for active and hover conditions.

components/groups/components/myGroups.tsx (1)

218-218: LGTM! Well-implemented theme-aware pagination.

The pagination styling is consistent with other components and includes proper accessibility attributes. The implementation correctly handles both light and dark mode states.

Also applies to: 238-239, 262-262

components/factory/components/MyDenoms.tsx (1)

256-256: LGTM! Consistent theme-aware pagination implementation.

The pagination styling is well-implemented with proper accessibility attributes and consistent with other components.

Also applies to: 276-277, 300-300

Copy link
Collaborator

@chalabi2 chalabi2 left a comment

Choose a reason for hiding this comment

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

lgtm!

@fmorency fmorency merged commit 935c277 into liftedinit:main Dec 4, 2024
4 checks passed
@fmorency fmorency deleted the fix-pagination-theme branch December 4, 2024 17:43
This was referenced Dec 4, 2024
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