Fix/category icons light mode
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
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 is attempting to deploy a commit to the Zero Team on Vercel.
A member of the Team first needs to authorize it.
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
ScanEyeicon 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" categoryThe change from hardcoded fill color to
fill-currentensures 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" categoryThe
fill-currentclass makes the Mail icon properly inherit its parent's text color, ensuring consistent visibility across themes.
516-521: Icon visibility fixed for the "Personal" categoryThe User icon now correctly inherits text color from its parent element using
fill-current.
522-527: Icon visibility fixed for the "Updates" categoryThe Bell icon now correctly uses
fill-currentto inherit its parent's text color.
528-533: Icon visibility fixed for the "Promotions" categoryThe Tag icon now properly inherits parent text color with
fill-current.
534-539: Icon visibility fixed for the "Unread" categoryThe ScanEye icon now uses
fill-currentalong with appropriate sizing classes.
610-613: Dynamic icon color container based on selection stateExcellent implementation of conditional text coloring. This ensures appropriate contrast in both themes by using:
text-whitewhen selected (on colored background)text-black dark:text-whitewhen not selected (on light/dark background)This change works together with the
fill-currenticons to ensure proper visibility in all theme modes.apps/mail/components/ui/nav-user.tsx (2)
421-421: Improved sidebar layout with full-width containerAdding
w-fullto 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 tooltipGreat improvement to the user email display with:
max-w-[180px]to constrain widthtruncateclass to gracefully handle text overflow with ellipsistitleattribute to show the full email on hoverThis 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.
🪧 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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. -
@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
Already fixed.