Skip to content

Comments

Add tooltips and i18n for editor MenuBar#604

Merged
nizzyabi merged 3 commits intoMail-0:stagingfrom
yklmk:staging
Apr 6, 2025
Merged

Add tooltips and i18n for editor MenuBar#604
nizzyabi merged 3 commits intoMail-0:stagingfrom
yklmk:staging

Conversation

@yklmk
Copy link
Contributor

@yklmk yklmk commented Apr 6, 2025

Description

Added tooltips and i18n for editor menu bar. Replaced custom buttons with shadcn/ui buttons for support consistency.

Type of Change

  • 🎨 UI/UX improvement

Areas Affected

  • User Interface/Experience

Testing Done

  • Cross-browser testing (if UI changes)
  • Mobile responsiveness verified (if UI changes)

Checklist

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

Screenshots/Recordings

image

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

Summary by CodeRabbit

  • New Features
    • Enhanced the email editor by adding contextual tooltips to formatting buttons, providing users with on-hover guidance.
    • Updated interface labels and messages to support improved localization, including dynamic attachment counts and clearer action prompts.

@vercel
Copy link

vercel bot commented Apr 6, 2025

@yaraslau-klimuk is attempting to deploy a commit to the Zero Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 6, 2025

Walkthrough

This pull request enhances the email editor by integrating tooltip functionality into the MenuBar component. Button elements for formatting now display tooltips containing localized text via the useTranslations hook. Additionally, the localization file has been updated with new and modified string entries to support this functionality, including dynamic dialog content and user interface labels.

Changes

Files Change Summary
apps/mail/components/create/editor.tsx Added tooltip components (Tooltip, TooltipContent, TooltipProvider, TooltipTrigger) to wrap formatting buttons, integrated useTranslations for dynamic tooltips, and updated dialog text with localized strings.
apps/mail/locales/en.json Added new entries (cancel, save, units.mb, addMore, addLink, addUrlToCreateALink) and updated existing ones (attachments now includes a count placeholder), plus added a nested editor object with formatting options.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MenuBar
    participant TooltipProvider
    participant useTranslations

    User->>MenuBar: Hover over a formatting button
    MenuBar->>TooltipProvider: Trigger tooltip display
    TooltipProvider->>useTranslations: Request localized text
    useTranslations-->>TooltipProvider: Return translation
    TooltipProvider-->>User: Display tooltip with localized content
Loading

Possibly related PRs

  • New Crowdin updates #538: The changes in the main PR are related to the localization updates in the retrieved PR, as both involve modifications to localization files, specifically enhancing user interface strings for tooltips and actions.
  • i18n #437: The changes in the main PR, which enhance the MenuBar component with tooltips and localization updates, are related to the retrieved PR as both utilize the useTranslations hook for localization, affecting the same functionality of providing translated text in the user interface.
  • Feature/thread badge tooltips #410: The changes in the main PR, which enhance the MenuBar component with tooltips for buttons, are related to the retrieved PR that also implements tooltips, specifically for mail thread badges, indicating a shared focus on improving user interaction through tooltip functionality.

Suggested reviewers

  • needleXO

Poem

Hopping through the code with glee,
I add tooltips where buttons should be.
Translations whisper in each line,
Making the editor simply divine.
A bunny cheers for updates so neat,
Coding magic with every beat!
🐇💻

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d64cb95 and 185bb1c.

📒 Files selected for processing (2)
  • apps/mail/components/create/editor.tsx (5 hunks)
  • apps/mail/locales/en.json (3 hunks)
🔇 Additional comments (4)
apps/mail/components/create/editor.tsx (2)

36-36: Good job adding needed imports and translation hook.

The addition of tooltip components and the useTranslations hook properly sets up the internationalization foundation for the email editor.

Also applies to: 52-52, 123-123


436-458: Dialog content properly internationalized.

The link dialog components now properly use translation strings instead of hardcoded text, which aligns with good internationalization practices.

apps/mail/locales/en.json (2)

33-35: Common action strings added correctly.

The addition of common action strings for "cancel" and "save" allows for consistent translation across the application.


257-259: Added units section for file size display.

Good addition of a units section with MB formatting, which will be useful for displaying attachment sizes consistently.

@hiheyhello123
Copy link
Contributor

Screenshot please.

@yklmk
Copy link
Contributor Author

yklmk commented Apr 6, 2025

Screenshot please.

Added

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

🧹 Nitpick comments (1)
apps/mail/components/create/editor.tsx (1)

195-195: Consider adding a small delay to tooltips.

Setting delayDuration={0} means tooltips appear immediately. While this provides instant feedback, a small delay (e.g., 100-200ms) might prevent tooltip flickering when users move their cursor across multiple buttons quickly.

-<TooltipProvider delayDuration={0}>
+<TooltipProvider delayDuration={150}>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 185bb1c and 39f1d5c.

📒 Files selected for processing (1)
  • apps/mail/components/create/editor.tsx (5 hunks)
🔇 Additional comments (11)
apps/mail/components/create/editor.tsx (11)

36-36: Good addition of tooltip components.

Adding the tooltip components from shadcn/ui is a great choice for enhancing the accessibility and usability of the editor.


52-52: Well done adding internationalization support.

Adding the useTranslations hook is essential for the i18n implementation, which aligns perfectly with the PR objectives.


123-123: Good use of the translation hook.

Properly setting up the translation hook to use throughout the component.


199-211: Excellent implementation of heading1 button with tooltip.

The tooltip implementation for the heading1 button follows best practices by using asChild to preserve button accessibility properties and providing meaningful translated content.


212-237: Good consistency in implementation for heading2 and heading3.

The tooltip implementation for heading2 and heading3 follows the same pattern as heading1, maintaining a consistent UI/UX.


242-299: Well structured text formatting buttons with tooltips.

The implementation of tooltips for bold, italic, strikethrough, and underline buttons follows a consistent pattern, improving accessibility by providing clear explanations of each button's function.


300-312: Good tooltip implementation for link button.

The link button properly uses the tooltip component with translated content, maintaining consistency with other buttons.


318-343: Correctly implemented list button tooltips.

Both bullet list and ordered list buttons have appropriate tooltips with distinct translation keys, which was a previously identified issue that has been fixed.


345-427: Well-executed attachment buttons with context-aware tooltips.

The implementation cleverly shows different tooltips based on whether attachments exist, enhancing usability. The popover for attachment management is also well-integrated with the tooltip system.


436-437: Good internationalization for dialog elements.

Dialog title and description now properly use translation keys instead of hardcoded text.


454-458: Proper internationalization for dialog buttons.

Cancel and save buttons now use appropriate translation keys from the common actions namespace.

@nizzyabi
Copy link
Collaborator

nizzyabi commented Apr 6, 2025

amazing! LGTM

@vercel
Copy link

vercel bot commented Apr 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
0 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 6, 2025 8:50pm

@nizzyabi nizzyabi merged commit 243f88d into Mail-0:staging Apr 6, 2025
3 checks passed
nizzyabi added a commit that referenced this pull request Apr 6, 2025
* fix: show primary emails

* (review) add "All Mail" section to inbox switcher

* ph provider

* perf: switch from open ai to groq api

* chore: remove openai package

* chore: remove duplicated function

* chore: remove duplicated function

* feat: use system prompt from env

* perf: use base js fetch instead of better-fetch

* homepage open fix

* context

* cleanup

* cleanup

* feat: update categories logic

* cleanup

* cleanup

* feat: use nuqs

* action buttons

* feat: added mark as read functionality for mails

* added try and catch for better error handling

* better error than codeRabbit lmao

* hold to scroll down emails

* fix spacing on reply composer
;

* spacing

* tooltip to thread display bar for ux

* fix to reply composer

* forward emails button

* cleanup

* cleanup

* reply ring

* overflow

* cleanup

* un animate x

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Arabic)

* New translations en.json (Catalan)

* New translations en.json (Czech)

* New translations en.json (German)

* New translations en.json (Japanese)

* New translations en.json (Korean)

* New translations en.json (Polish)

* New translations en.json (Portuguese)

* New translations en.json (Russian)

* New translations en.json (Turkish)

* New translations en.json (Latvian)

* New translations en.json (Hindi)

* New translations en.json (Russian)

* New translations en.json (Latvian)

* cleanup

* loading state and padding to mail list to not overflow when scrolling

* onMouseDown

* fix: remove html from AI prompt (#598)

* fix: remove html from AI prompt

* refact: use cheerio util to remove html from email

* feat: add regex to ai-search

* chore: remove debug logs

* refactor: migrate from groq embeddings to openai for and improve email formatting

* fix: join waitlist button contrast (#603)

* fix: join waitlist button contrast

The old contrast was terrible in light mode, so now I just made it black so it is always readable.

* Revert "regenerating bun file"

This reverts parts of commit cef74f3.

* Add tooltips and i18n for editor MenuBar (#604)

* feat: add tooltips and i18n to editor MenuBar

* fix: incorrect translation key

---------

Co-authored-by: Sergio Vazquez <sergiovazag@gmail.com>
Co-authored-by: plyght <plyght@peril.lol>
Co-authored-by: Sergio <60497216+sergio-jva@users.noreply.github.com>
Co-authored-by: Nizzy <nizabizaher@gmail.com>
Co-authored-by: Vicentesan <vikom.sanchez@gmail.com>
Co-authored-by: user12224 <122770437+user12224@users.noreply.github.com>
Co-authored-by: Rajmeet <rajmeetchandok@gmail.com>
Co-authored-by: [bot] <zero@ibra.rip>
Co-authored-by: needle <122770437+needleXO@users.noreply.github.com>
Co-authored-by: Dominik Koch <dominik@koch-bautechnik.de>
Co-authored-by: YK <70700647+yaraslau-klimuk@users.noreply.github.com>
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.

3 participants