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

ZO Disccard glowup #2680

Merged
merged 4 commits into from
Feb 8, 2025
Merged

ZO Disccard glowup #2680

merged 4 commits into from
Feb 8, 2025

Conversation

frzyc
Copy link
Owner

@frzyc frzyc commented Feb 8, 2025

Describe your changes

  • Update Discard design using design influences from LuniK using their figma design

Issue or discord link

  • Increase radius of elements globally

Testing/validation

image

Checklist before requesting a review (leave this PR as draft if any part of this list is not done.)

  • I have commented my code in hard-to understand areas.
  • I have made corresponding changes to README or wiki.
  • For front-end changes, I have updated the corresponding English translations.
  • I have run yarn run mini-ci locally to validate format and lint.
  • If I have added a new library or app, I have updated the deployment scripts to ignore changes as needed

Summary by CodeRabbit

  • New Features

    • Expanded theme customization with additional color options and a refreshed rounded shape for a modern look.
    • Launched a new card component that supports dynamic background choices to enhance visual styling.
  • Refactor

    • Revamped disc card layout for cleaner presentation and improved information display.
    • Adjusted grid settings in the disc inventory for a more optimal arrangement across various screen sizes.

Copy link
Contributor

coderabbitai bot commented Feb 8, 2025

Warning

Rate limit exceeded

@frzyc has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 0cdfe4a and 526c2b5.

📒 Files selected for processing (1)
  • libs/common/ui/src/components/Card/CardThemed.tsx (2 hunks)

Walkthrough

The pull request extends the Material-UI theme by adding six new color properties (fire, ice, electric, frost, physical, ether) to multiple palette interfaces and component overrides. Additionally, a new shape property with a borderRadius of 20 is introduced. A new styled card component (ZCard) is added with a customizable background type, and related components (DiscCard and DiscInventory) are updated for a cleaner layout and refined grid configuration.

Changes

File(s) Change Summary
libs/zzz/theme/.../Theme.tsx Extended Material-UI theme interfaces (Palette, PaletteOptions, Button/Chip/InputBase/SvgIcon overrides) with new color options (fire, ice, electric, frost, physical, ether) and added a new shape property (borderRadius: 20).
libs/zzz/ui/.../Components/ZCard.tsx, libs/zzz/ui/.../Components/index.ts Introduced the new ZCard component with a bgt prop for determining the card’s background color, using a styled function with prop filtering; index re-exports ZCard.
libs/zzz/ui/.../Disc/DiscCard.tsx Refactored DiscCard: removed SqBadge, DeleteForever, and the onDelete prop; replaced CardThemed with ZCard (bg changed to "dark"); updated layout using CardContent, Stack, and revised typography.
libs/zzz/ui/.../Disc/DiscInventory.tsx Modified grid layout columns configuration to increase the number of columns at various breakpoints.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant DC as DiscCard
  participant ZC as ZCard Component
  participant T as Theme

  U->>DC: Request DiscCard render
  DC->>ZC: Instantiate ZCard with bgt="dark"
  ZC->>T: Retrieve palette and shape settings
  T-->>ZC: Return color values & borderRadius
  ZC-->>DC: Render styled card
  DC-->>U: Display updated DiscCard
Loading

Possibly related PRs

Suggested labels

SRO

Suggested reviewers

  • nguyentvan7
  • tiffanynwyeung

Poem

Oh, the midnight code flows pure and bright,
New hues ignite my screen in the quiet night.
ZCard rises with style, a fresh design in play,
DiscCard refines its form in a modern array.
In caffeine-fueled moments, dreams code and compile—
Another PR, another sleepless, yet joyful mile.


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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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
Contributor

github-actions bot commented Feb 8, 2025

[zzz-frontend] [Sat Feb 8 18:48:32 UTC 2025] - Deployed 0a05ddb to https://genshin-optimizer-prs.github.io/pr/2680/zzz-frontend (Takes 3-5 minutes after this completes to be available)

[zzz-frontend] [Sat Feb 8 19:23:41 UTC 2025] - Deployed 3f470f6 to https://genshin-optimizer-prs.github.io/pr/2680/zzz-frontend (Takes 3-5 minutes after this completes to be available)

[sr-frontend] [Sat Feb 8 19:24:19 UTC 2025] - Deployed 3f470f6 to https://genshin-optimizer-prs.github.io/pr/2680/sr-frontend (Takes 3-5 minutes after this completes to be available)

[frontend] [Sat Feb 8 19:25:44 UTC 2025] - Deployed 3f470f6 to https://genshin-optimizer-prs.github.io/pr/2680/frontend (Takes 3-5 minutes after this completes to be available)

[sr-frontend] [Sat Feb 8 19:31:39 UTC 2025] - Deployed 0dfd559 to https://genshin-optimizer-prs.github.io/pr/2680/sr-frontend (Takes 3-5 minutes after this completes to be available)

[zzz-frontend] [Sat Feb 8 19:31:50 UTC 2025] - Deployed 0dfd559 to https://genshin-optimizer-prs.github.io/pr/2680/zzz-frontend (Takes 3-5 minutes after this completes to be available)

[frontend] [Sat Feb 8 19:32:02 UTC 2025] - Deployed 0dfd559 to https://genshin-optimizer-prs.github.io/pr/2680/frontend (Takes 3-5 minutes after this completes to be available)

[Sat Feb 8 20:13:41 UTC 2025] - Deleted deployment

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

🔭 Outside diff range comments (1)
libs/zzz/ui/src/Disc/DiscCard.tsx (1)

247-264: Remove commented out code.

sleepily Let's not keep commented out code. If it's needed later, we can find it in git history.

-            {/* {!!onDelete && (
-              <BootstrapTooltip
-                title={lock ? t('cantDeleteLock') : ''}
-                placement="top"
-              >
-                <span>
-                  <Button
-                    color="error"
-                    size="small"
-                    onClick={onDelete}
-                    disabled={lock}
-                    sx={{ top: '1px' }}
-                  >
-                    <DeleteForever />
-                  </Button>
-                </span>
-              </BootstrapTooltip>
-            )} */}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fc79349 and 9106ba9.

📒 Files selected for processing (5)
  • libs/zzz/theme/src/Theme.tsx (1 hunks)
  • libs/zzz/ui/src/Components/ZCard.tsx (1 hunks)
  • libs/zzz/ui/src/Components/index.ts (1 hunks)
  • libs/zzz/ui/src/Disc/DiscCard.tsx (6 hunks)
  • libs/zzz/ui/src/Disc/DiscInventory.tsx (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
libs/zzz/ui/src/Components/ZCard.tsx

[error] 24-24: Useless case clause.

because the default clause is present:

Unsafe fix: Remove the useless case.

(lint/complexity/noUselessSwitchCase)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: lint
🔇 Additional comments (3)
libs/zzz/theme/src/Theme.tsx (1)

73-96: 🌐 Web query:

What are the WCAG 2.1 contrast requirements for text colors?

💡 Result:

WCAG 2.1 defines specific color contrast requirements to ensure text remains readable for users with visual impairments or color deficiencies[1][2][5]. Here are the key standards:

## Summary of Requirements
- **Normal text** (smaller than 18pt/24px or non-bold 14pt/18.66px):  
  4.5:1 minimum contrast ratio (Level AA)[1][2][5].
- **Large text** (18pt/24px+ or bold 14pt/18.66px+):  
  3:1 minimum contrast ratio (Level AA)[1][2][5].
- **Graphics/UI components**:  
  3:1 contrast ratio for non-text elements like icons or form borders (WCAG 2.1 addition)[4][5].

---

## Exceptions and Edge Cases
- **Logos/brand names**: No contrast requirement[2][8].
- **Incidental/decorative text**: Exempt if purely ornamental or part of inactive UI elements[2][8].
- **Text over images**: Requires solid backgrounds to meet ratios[1].
- **Transparency**: Foreground alpha values must maintain required ratios after blending[4].

For example:
- Pure red (#FF0000) on white fails at 4:1[3].
- Gray (#777777) on white fails at 4.47:1[3].
- Blue (#000063) on gray (#808080) passes at exactly 4.5:1[3].

---

## Tools for Compliance Check
| Tool | Key Features |
|------|--------------|
| WebAIM Contrast Checker | Validates hex codes & suggests adjustments[2][4] |  
| ColorPick Eyedropper | Extracts colors from live webpages[2] |  
| axe DevTools | Automated testing integrated into development workflows[9] |

The WCAG standards aim to compensate for common vision limitations – a 4.5:1 ratio accommodates users with ~20/40 vision (typical in elders), while stricter AAA ratios (7:1) support those with ~20/80 vision[8].

Citations:

- 1: https://www.uada.edu/employees/division-accessibility/documents/color-accessibility.aspx
- 2: https://altitudemarketing.com/blog/color-contrast-web-design/
- 3: https://webaim.org/articles/contrast/
- 4: https://webaim.org/resources/contrastchecker/
- 5: https://www.washington.edu/accesstech/checklist/contrast/
- 6: https://accessibleweb.com/color-contrast-checker/
- 7: https://www.a11y-collective.com/glossary/colour-contrast/
- 8: https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html
- 9: https://dequeuniversity.com/rules/axe/4.8/color-contrast
- 10: https://www.w3.org/TR/WCAG21/
libs/zzz/ui/src/Disc/DiscInventory.tsx (1)

26-26: 🏁 Script executed:

#!/bin/bash
# Check for large dataset handling
rg -A 5 "database.discs.values"

Length of output: 1724

libs/zzz/ui/src/Components/index.ts (1)

1-1: Simple and Effective Export!
This single-line export re-exports everything from the ZCard module, streamlining imports for users. The implementation is straightforward and adheres to good modular practices.

libs/zzz/theme/src/Theme.tsx Show resolved Hide resolved
libs/zzz/ui/src/Components/ZCard.tsx Outdated Show resolved Hide resolved
libs/zzz/ui/src/Components/ZCard.tsx Outdated Show resolved Hide resolved
libs/zzz/ui/src/Disc/DiscCard.tsx Show resolved Hide resolved
libs/zzz/ui/src/Disc/DiscCard.tsx Outdated Show resolved Hide resolved
@frzyc frzyc merged commit d8f5dac into master Feb 8, 2025
10 checks passed
@frzyc frzyc deleted the disccard_glowup branch February 8, 2025 20:12
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.

1 participant