Zero icon indicating copy to clipboard operation
Zero copied to clipboard

fix: Category button visibility issue in light mode

Open Pratiyankkumar opened this issue 9 months ago β€’ 2 comments

Description

Fixed an issue with icon visibility in light mode where category icons were using white fill regardless of the theme, making them difficult to see on light backgrounds when not selected. Changed icons to use black in light mode for unselected state while maintaining white for selected state and dark mode.

Type of Change

  • [x] πŸ› Bug fix (non-breaking change which fixes an issue)
  • [x] 🎨 UI/UX improvement

Areas Affected

  • [x] User Interface/Experience

Testing Done

  • [x] Manual testing performed
  • [x] Cross-browser testing (if UI changes)

Checklist

  • [x] I have performed a self-review of my code
  • [x] My changes generate no new warnings

Additional Notes

The fix uses fill-current class to make icons inherit text color from parent elements, creating a more accessible and consistent UI in both light and dark themes.

Here's the video of the representing the changes :

https://github.com/user-attachments/assets/8940f903-c366-4c8b-861c-f47742889ac9

By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.

Summary by CodeRabbit

  • Style
    • Improved icon and button color styling for mail categories to ensure consistent appearance in light and dark themes. Icons now inherit the current text color, and category buttons display appropriate text colors based on theme and selection state.

Pratiyankkumar avatar May 03 '25 06:05 Pratiyankkumar

@Pratiyankkumar is attempting to deploy a commit to the Zero Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar May 03 '25 06:05 vercel[bot]

Walkthrough

The update modifies the icon color styling and button text colors for mail categories within the mail component. Icon components now use fill-current instead of fixed white fills, allowing icon colors to inherit from parent text colors. Additionally, non-selected category buttons now explicitly specify text color for both light and dark modes. No changes were made to logic, control flow, or public API signatures.

Changes

File(s) Change Summary
apps/mail/components/mail/mail.tsx Updated category icon components to use fill-current for color inheritance; adjusted category selection button text colors for light and dark modes.

Possibly related PRs

  • Mail-0/Zero#821: Adds a new "Unread" mail category and icon, directly modifying the same icon and category elements affected by this PR.

Suggested reviewers

  • ahmetskilinc

Poem

In the mailbox where icons reside,
Colors now shift and smoothly glide.
No longer fixed, but current they fill,
Adapting to theme with elegant skill.
Rabbits approve with a gentle thumpβ€”
Hues that hop, and never clump!
πŸ‡βœ¨


πŸ“œ 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 d73ebfa88adfba019a6bc5b2fd8f551947ccdc27 and b08f4e5f3e1fb6c9aeddd5c4014deafd61cd1614.

πŸ“’ Files selected for processing (1)
  • apps/mail/components/mail/mail.tsx (2 hunks)
πŸ”‡ Additional comments (7)
apps/mail/components/mail/mail.tsx (7)

503-507: Icons inherit parent text color with fill-current for Important category
Switching to fill-current ensures the Lightning icon correctly adapts to light/dark themes and selected/unselected text colors. This improves accessibility and maintains consistency.


509-513: Use fill-current on All Mail icon
Updating the Mail icon to use fill-current allows it to dynamically match the parent text color, fixing visibility issues in light mode while preserving dark mode styling.


517-521: Apply fill-current to Personal category icon
Changing the User icon to inherit the current color ensures consistent appearance across both themes and selection states.


523-527: Enable theming for Updates icon via fill-current
The Bell icon now inherits parent text color, addressing the white-on-light background visibility issue.


529-533: Promotions icon now uses fill-current
Switching the Tag icon to fill-current aligns it with the text color, improving contrast in light mode.


535-539: Ensure Unread icon adapts to theme with fill-current
Adding fill-current (alongside explicit sizing) for ScanEye fixes the white-fill visibility problem on light backgrounds.


605-607: Explicit non-selected button text colors for light/dark modes
Adding text-black and dark:text-white to the unselected state guarantees readable labels in both themes and complements the fill-current icon updates.

✨ Finishing Touches
  • [ ] πŸ“ Generate Docstrings

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
πŸͺ§ 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.

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

coderabbitai[bot] avatar May 03 '25 06:05 coderabbitai[bot]

@ahmetskilinc Please review this

Pratiyankkumar avatar May 03 '25 15:05 Pratiyankkumar

Already fixed.

hiheyhello123 avatar May 03 '25 15:05 hiheyhello123