Skip to content

Comments

fix(ui): button as button error fixed, create mail editor fixes#424

Merged
nizzyabi merged 3 commits intoMail-0:stagingfrom
nyzss:fix/minor-ui-fixes
Mar 13, 2025
Merged

fix(ui): button as button error fixed, create mail editor fixes#424
nizzyabi merged 3 commits intoMail-0:stagingfrom
nyzss:fix/minor-ui-fixes

Conversation

@nyzss
Copy link
Contributor

@nyzss nyzss commented Mar 12, 2025

Description

Minor UI fixes, some issues in the settings sidebar and mail editor:

  • Fixed sidebar focus ring overflow on last element
  • Improved mail editor focus and selection (editorRef wasn't set on editor creation)
  • Fixed nested issue in settings, Connections tab

Type of Change

Please delete options that are not relevant.

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

Areas Affected

Please check all that apply:

  • User Interface/Experience

Testing Done

Describe the tests you've done:

  • Manual testing performed

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • My changes generate no new warnings

Additional Notes

Add any other context about the pull request here.

Screenshots/Recordings

Add screenshots or recordings here if applicable.


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

Summary by CodeRabbit

Summary by CodeRabbit

  • Style

    • Adjusted the layout for connection settings with a shift from centered to start alignment.
    • Enhanced bottom spacing in the navigation area.
    • Refined button arrangements in the connection dialog for a more consistent look.
  • Refactor

    • Improved the text editor’s focus behavior for smoother, more intuitive editing interactions and enhanced type safety.

These updates enhance the overall visual consistency and user experience throughout the application.

@vercel
Copy link

vercel bot commented Mar 12, 2025

@nyzss 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 Mar 12, 2025

Walkthrough

This pull request updates several UI components across the mail application. The modifications include adjustments to CSS class names for altered alignment and spacing, a restructuring of JSX elements in the connection dialog, and enhancements to the editor component such as reorganized imports, improved type safety with the introduction of a new container reference, and updated focus behavior. No changes were made to the public API or business logic.

Changes

File(s) Summary
apps/mail/app/(routes)/.../page.tsx
apps/mail/components/ui/.../nav-main.tsx
Adjusted CSS class names: changed div alignment from justify-center to justify-start and added pb-2 for extra bottom padding.
apps/mail/components/connection/add.tsx Restructured JSX in the DialogTrigger and Button components; reordered class names without functional changes.
apps/mail/components/create/editor.tsx Reorganized import statements; updated editorRef type to TiptapEditor; introduced containerRef; and refined the focusEditor function to enhance type safety and focus behavior.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EditorContainer
    participant TiptapEditor
    User->>EditorContainer: Click on editor area
    EditorContainer->>EditorContainer: Verify event target equals containerRef
    EditorContainer->>TiptapEditor: Invoke focus('end')
    TiptapEditor-->>EditorContainer: Confirm focus applied
Loading

Suggested reviewers

  • nizzyabi
  • ahmetskilinc

Poem

I'm a rabbit with a joyful heart,
Hopping through lines of code like art.
CSS tweaks and focus flows abound,
In every change, new magic's found.
Bound by bytes, I dance in delight!

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 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 124524b and 47ed6c7.

📒 Files selected for processing (3)
  • apps/mail/components/connection/add.tsx (3 hunks)
  • apps/mail/components/create/editor.tsx (6 hunks)
  • apps/mail/components/ui/nav-main.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/mail/components/ui/nav-main.tsx
  • apps/mail/components/connection/add.tsx
  • apps/mail/components/create/editor.tsx

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

🧹 Nitpick comments (1)
apps/mail/components/connection/add.tsx (1)

49-49: Consistent class ordering

Moved w-full to the end of the class string for consistency. While this doesn't affect functionality, it maintains a uniform pattern throughout the codebase.

Also applies to: 67-67

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 433c814 and 124524b.

📒 Files selected for processing (4)
  • apps/mail/app/(routes)/settings/connections/page.tsx (1 hunks)
  • apps/mail/components/connection/add.tsx (3 hunks)
  • apps/mail/components/create/editor.tsx (5 hunks)
  • apps/mail/components/ui/nav-main.tsx (1 hunks)
🔇 Additional comments (8)
apps/mail/components/ui/nav-main.tsx (1)

155-155: Added bottom padding to fix focus ring overflow

The additional pb-2 class addresses the overflow issue with the focus ring on the last element of the sidebar as mentioned in the PR description. This ensures the focus ring is fully visible when the last item is selected.

apps/mail/app/(routes)/settings/connections/page.tsx (1)

153-153: Left-aligned connection button for better UX

Changing the alignment from justify-center to justify-start creates a more consistent layout in the settings page, as most UI elements in settings typically follow left alignment.

apps/mail/components/connection/add.tsx (1)

19-24: Fixed nested button issue

This restructuring resolves the nested <button> elements problem mentioned in the PR. HTML specifications don't allow button elements to be nested, and this change ensures proper component hierarchy by conditionally rendering either children or a button, not both nested.

apps/mail/components/create/editor.tsx (5)

3-12: Improved import organization and type safety

The reorganized imports and additional imports from @tiptap/react provide better organization and access to necessary types for improved type safety.

Also applies to: 34-34


275-277: Enhanced type safety with proper references

Replaced the generic any type with the more specific TiptapEditor type and added a new container reference. This improves type safety and provides better editor control.


282-286: Improved focus handling logic

The modified focusEditor function now correctly checks if the click event occurred directly on the container before triggering focus. This prevents unintended focus behavior when clicking on child elements.


304-305: Enhanced editor container accessibility

Added the container reference to the EditorContent component and the cursor-text class to visually indicate that the area is clickable and can receive focus, improving user experience.


319-321: Fixed editor reference timing

The added onCreate handler ensures that the editorRef is properly set during the editor's creation, rather than relying on updates. This addresses the focus and selection functionality issues mentioned in the PR description.

Copy link
Collaborator

@MrgSub MrgSub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vercel
Copy link

vercel bot commented Mar 13, 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 Mar 13, 2025 2:53pm

@nizzyabi
Copy link
Collaborator

@nyzss looks good. can i have a ss

@nyzss
Copy link
Contributor Author

nyzss commented Mar 13, 2025

@nyzss looks good. can i have a ss

sure, i put videos showing the before and after of the three fixes as they are easier to show that way

here is the before: https://www.loom.com/share/74df1db662b542ec89c1611470401670

here is the after: https://www.loom.com/share/57fb88aee0ad4ea68de3885c7d5951d2

the first one is that when you click on the body of the create-email, it is not focusing on the editor which is a bit annoying in UX (there was the code for it but it wasn't working), in the video i showed it in the /create route but the issue was also present in the mail reply component, both are fixed

second and the third one is obvious, second is sidebar last element that was being clunky, third one is a button nesting error

@nizzyabi
Copy link
Collaborator

@nyzss lets fix up the merge conflicts and get this pushed! exciting pr

@nyzss
Copy link
Contributor Author

nyzss commented Mar 13, 2025

@nyzss lets fix up the merge conflicts and get this pushed! exciting pr

done!

@nizzyabi nizzyabi merged commit d255933 into Mail-0:staging Mar 13, 2025
2 of 3 checks passed
@nizzyabi
Copy link
Collaborator

amazing, merged!

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