Skip to content

Comments

Feat: Note Tooltip On Hover + Note Text Overflow fixes#1553

Closed
Pheewww wants to merge 3 commits intoMail-0:stagingfrom
Pheewww:feat/note-tooltip-on-hover
Closed

Feat: Note Tooltip On Hover + Note Text Overflow fixes#1553
Pheewww wants to merge 3 commits intoMail-0:stagingfrom
Pheewww:feat/note-tooltip-on-hover

Conversation

@Pheewww
Copy link
Contributor

@Pheewww Pheewww commented Jun 29, 2025

Added feature to view last added note without opening notes panel + bugs fixes

Other bugs are fixed in #1484


BEFORE

  1. Text and Add notes button overflows if text is very long.
image
  1. Tooltip occurs even when note-panel is open in bg
image

AFTER

  1. View last note added on icon hover
image

For Large Texts
image

  1. Text overflow fixed and very long text will have scroll to prevent taking large space.
image
  1. Bg Tooltip fixed

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added a tooltip to the notes icon in the mail list, displaying the content of the most recent note on hover.
  • Improvements

    • Note content in the note panel is now scrollable within a fixed-height area for better readability.
    • The notes list panel now has a maximum width for improved layout.
    • The note count tooltip is only shown when the notes panel is closed.
  • Style

    • Improved import organization and JSX formatting for better code clarity.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 29, 2025

Walkthrough

This update enhances the mail list and note panel components by adding a tooltip to the notes icon that displays the last note's content, reorganizes imports, and applies UI improvements such as scrollable note content and width constraints. No public API or exported entity signatures are changed.

Changes

File(s) Summary
apps/mail/components/mail/mail-list.tsx Added tooltip to notes icon showing last note content, reorganized imports, and improved JSX formatting.
apps/mail/components/mail/note-panel.tsx Made note content scrollable, conditionally rendered tooltip content, and added max width to notes list container.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MailList
    participant NotesPanel

    User->>MailList: Hover over notes icon in thread
    MailList->>MailList: Retrieve last note content (if any)
    MailList-->>User: Show tooltip with last note content

    User->>NotesPanel: View notes panel
    NotesPanel->>NotesPanel: Display notes with scrollable content and width constraint
Loading

Possibly related PRs

Suggested reviewers

  • MrgSub

Poem

In the inbox where the notes reside,
A tooltip now floats by your side.
Hover the icon, see what's new—
The last note's words appear for you!
Scroll and peek, the panel's neat,
With tidy code and UI sweet.
🐇✨


📜 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 2039c42 and 721013a.

📒 Files selected for processing (1)
  • apps/mail/components/mail/mail-list.tsx (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/mail/components/mail/mail-list.tsx
✨ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

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

🧹 Nitpick comments (1)
apps/mail/components/mail/mail-list.tsx (1)

549-558: Standardize tooltip styling for consistency.

The tooltip implementation works correctly, but the styling classes border-yellow-300 border-solid are inconsistent with other tooltips in the codebase which use the default styling.

Consider using consistent tooltip styling:

-          <TooltipContent side="bottom" className="p-1 text-xs md:max-w-52 max-w-60 border-yellow-300 border-solid">
+          <TooltipContent side="bottom" className="p-1 text-xs md:max-w-52 max-w-60">

The yellow border may not provide sufficient contrast in all theme modes and differs from the standard tooltip appearance used elsewhere.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 59c18be and 2039c42.

📒 Files selected for processing (2)
  • apps/mail/components/mail/mail-list.tsx (5 hunks)
  • apps/mail/components/mail/note-panel.tsx (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
apps/mail/components/mail/note-panel.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
apps/mail/components/mail/mail-list.tsx (1)
Learnt from: retrogtx
PR: Mail-0/Zero#1328
File: apps/mail/lib/hotkeys/mail-list-hotkeys.tsx:202-209
Timestamp: 2025-06-18T17:26:50.918Z
Learning: In apps/mail/lib/hotkeys/mail-list-hotkeys.tsx, the switchCategoryByIndex function using hardcoded indices for category hotkeys does not break when users reorder categories, contrary to the theoretical index-shifting issue. The actual implementation has constraints or mechanisms that prevent hotkey targeting issues.
🧬 Code Graph Analysis (1)
apps/mail/components/mail/mail-list.tsx (2)
apps/mail/components/ui/tooltip.tsx (3)
  • Tooltip (72-72)
  • TooltipTrigger (72-72)
  • TooltipContent (72-72)
apps/mail/lib/utils.ts (1)
  • formatDate (121-180)
🔇 Additional comments (5)
apps/mail/components/mail/note-panel.tsx (3)

135-135: Good addition for handling long note content.

The scrollable container with max-h-60 overflow-y-auto effectively addresses the text overflow issue mentioned in the PR objectives.


537-539: Correct conditional tooltip behavior.

Properly prevents the tooltip from appearing when the notes panel is open, addressing the background tooltip issue mentioned in the PR objectives.


590-590: Width constraint improves layout consistency.

The max-w-[350px] constraint prevents the notes list from becoming too wide, complementing the scrollable content fix.

apps/mail/components/mail/mail-list.tsx (2)

45-45: Import additions are appropriate.

The new imports for useThreadNotes and StickyNote are necessary for the tooltip feature implementation.

Also applies to: 54-54


716-724: Minor formatting improvement.

The JSX formatting changes in the Draft component improve code readability.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@MrgSub
Copy link
Collaborator

MrgSub commented Jun 30, 2025

There could be many notes, we need a better design for this @nizzyabi

@MrgSub MrgSub closed this Jul 4, 2025
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