Zero icon indicating copy to clipboard operation
Zero copied to clipboard

Fix/category icons light mode

Open devabdultech opened this issue 9 months ago • 2 comments

Description

Fixed an issue where category icons were not visible in light mode. The icons were previously white in both light and dark mode, making them invisible against the white background in light mode.

Changed the icons to use fill-current to inherit color from parent elements, and updated the parent container to use appropriate text colors based on selection state and theme mode.

Type of Change

Please delete options that are not relevant.

  • [X] 🐛 Bug fix (non-breaking change which fixes an issue)
  • [X] 🎨 UI/UX improvement

Areas Affected

Please check all that apply:

  • [X] User Interface/Experience

Testing Done

Describe the tests you've done:

  • [X] Manual testing performed

Security Considerations

For changes involving data or authentication:

  • [X] No sensitive data is exposed
  • [ ] Authentication checks are in place
  • [ ] Input validation is implemented
  • [ ] Rate limiting is considered (if applicable)

Checklist

  • [X] I have read the CONTRIBUTING document
  • [X] My code follows the project's style guidelines
  • [X] I have performed a self-review of my code
  • [X] I have commented my code, particularly in complex areas
  • [X] I have updated the documentation
  • [X] My changes generate no new warnings
  • [X] I have added tests that prove my fix/feature works
  • [X] All tests pass locally
  • [X] Any dependent changes are merged and published

Additional Notes

This fixes issue #848 by making category icons use text color inheritance instead of hardcoded colors, ensuring proper visibility in all theme modes.

Screenshots/Recordings

Screenshot 2025-05-03 123303


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

Summary by CodeRabbit

  • Style
    • Updated category icon colors to inherit the current text color, improving consistency with selected and unselected states.
    • Enhanced user email display in the sidebar with better width handling, truncation for long emails, and a tooltip showing the full email on hover.

devabdultech avatar May 03 '25 11:05 devabdultech

@devabdultech 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 11:05 vercel[bot]

Walkthrough

This update modifies the styling of icons and user email display in the mail application's UI components. In the mail categories section, icon fill handling is changed to use the current text color via class names, with conditional coloring based on selection state. The user navigation component is adjusted to ensure the email display truncates overflow text and shows the full email on hover, improving layout and readability. No logic or control flow changes are introduced.

Changes

File(s) Change Summary
apps/mail/components/mail/mail.tsx Replaces cn utility with explicit class names for icon fill; uses fill-current and conditional text color for icons based on selection state.
apps/mail/components/ui/nav-user.tsx Adds w-full to user info container, constrains email width, adds truncation and a title attribute for email overflow handling.

Possibly related PRs

  • Mail-0/Zero#821: Adds a new ScanEye icon and integrates it into mail categories, which directly relates to the icon styling changes in this PR.
  • Mail-0/Zero#845: Refactors JSX formatting and rendering logic for icons and category buttons in the same components affected by this PR, focusing on structure rather than styling.

Poem

In the warren where emails hop and play,
Icons now shimmer in the color of the day.
User emails snuggle, neat and tight,
Truncated softly, but hover for full sight.
With a whisk of CSS and a twitch of code,
The UI’s a garden where new styles explode!
🐇✨


📜 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 99a3056d942d09ae8c3acbb429211899f2bae78b.

📒 Files selected for processing (2)
  • apps/mail/components/mail/mail.tsx (2 hunks)
  • apps/mail/components/ui/nav-user.tsx (1 hunks)
🔇 Additional comments (9)
apps/mail/components/mail/mail.tsx (7)

496-507: Icon visibility fixed for the "Important" category

The change from hardcoded fill color to fill-current ensures the icon inherits its parent's text color, fixing visibility issues in light mode when white icons were appearing on white backgrounds.


508-515: Icon visibility fixed for the "All Mail" category

The fill-current class makes the Mail icon properly inherit its parent's text color, ensuring consistent visibility across themes.


516-521: Icon visibility fixed for the "Personal" category

The User icon now correctly inherits text color from its parent element using fill-current.


522-527: Icon visibility fixed for the "Updates" category

The Bell icon now correctly uses fill-current to inherit its parent's text color.


528-533: Icon visibility fixed for the "Promotions" category

The Tag icon now properly inherits parent text color with fill-current.


534-539: Icon visibility fixed for the "Unread" category

The ScanEye icon now uses fill-current along with appropriate sizing classes.


610-613: Dynamic icon color container based on selection state

Excellent implementation of conditional text coloring. This ensures appropriate contrast in both themes by using:

  • text-white when selected (on colored background)
  • text-black dark:text-white when not selected (on light/dark background)

This change works together with the fill-current icons to ensure proper visibility in all theme modes.

apps/mail/components/ui/nav-user.tsx (2)

421-421: Improved sidebar layout with full-width container

Adding w-full to the container ensures the user information takes the full available width when the sidebar is expanded, improving the layout.


425-425: Enhanced email display with truncation and tooltip

Great improvement to the user email display with:

  • max-w-[180px] to constrain width
  • truncate class to gracefully handle text overflow with ellipsis
  • title attribute to show the full email on hover

This ensures long email addresses don't break the layout while remaining accessible.

✨ 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 11:05 coderabbitai[bot]

Already fixed.

hiheyhello123 avatar May 03 '25 15:05 hiheyhello123