Skip to content

Comments

toast design#1314

Merged
ahmetskilinc merged 2 commits intostagingfrom
06-16-toast_design
Jun 17, 2025
Merged

toast design#1314
ahmetskilinc merged 2 commits intostagingfrom
06-16-toast_design

Conversation

@ahmetskilinc
Copy link
Contributor

@ahmetskilinc ahmetskilinc commented Jun 16, 2025

Enhanced Toast Component UI and Functionality

Description

This PR enhances the toast component's UI and functionality by:

  1. Renaming CustomToaster to Toaster for better semantic clarity
  2. Adding a loading icon using Lucide's Loader2 component with animation
  3. Improving toast styling with better padding, rounded corners, and proper dark mode support
  4. Refining the action button styling with proper flex layout and gap spacing

Type of Change

  • 🎨 UI/UX improvement

Areas Affected

  • User Interface/Experience

Summary by CodeRabbit

  • New Features

    • Added a loading icon to the loading toast notification for improved user feedback.
    • Updated the "Undo" action in persistent toast notifications to include an icon for better visual clarity.
  • Style

    • Refreshed toast notification styles, including updated colors, padding, and button layouts for a more polished appearance and improved dark mode support.
  • Refactor

    • Renamed the toast component for consistency across the app.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 16, 2025

Walkthrough

The updates rename the custom toast notification component from CustomToaster to Toaster, update its import and usage across the application, and enhance its styling and iconography. The persistent toast action label is now a JSX element featuring an icon and styled text instead of plain text. No changes were made to exported APIs or control flow.

Changes

File(s) Change Summary
apps/mail/components/ui/toast.tsx Renamed CustomToaster to Toaster, updated imports, added loading icon, and restyled toasts.
apps/mail/providers/client-providers.tsx Updated import and usage from CustomToaster to Toaster.
apps/mail/app/(routes)/toast-test.tsx Changed toast action label from string to JSX with icon and styled text.

Poem

In the meadow where toasts appear,
A rabbit hops with style and cheer.
"Undo" now shines with icon bright,
And toasts are dressed in colors light.
With every nibble, code refines—
A toast to changes, by design!
🥕✨

✨ 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 Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ahmetskilinc ahmetskilinc marked this pull request as ready for review June 16, 2025 16:17
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

🔭 Outside diff range comments (1)
apps/mail/providers/client-providers.tsx (1)

1-8: Missing "use client" directive

ClientProviders calls hooks (useSettings) and renders <Toaster />, both of which rely on client-side execution in Next.js’ App Router.
Without the "use client" directive the file is treated as a server component and will break at runtime.

+/* eslint-disable @next/next/no-async-client-component */
+"use client";
 import { NuqsAdapter } from 'nuqs/adapters/react-router/v7';
🧹 Nitpick comments (1)
apps/mail/components/ui/toast.tsx (1)

10-13: Consider forward-ing props for extensibility

Toaster currently discards all incoming props.
Forwarding ...props to <SonnerToaster> keeps the wrapper flexible and saves a future breaking change when new config flags are required.

-const Toaster = () => {
-  return (
-    <SonnerToaster
+import type { ComponentProps } from 'react';
+
+const Toaster = (props: ComponentProps<typeof SonnerToaster>) => (
+  <SonnerToaster
+    {...props}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 99ba8d4 and e6215a1.

📒 Files selected for processing (3)
  • apps/mail/app/(routes)/toast-test.tsx (2 hunks)
  • apps/mail/components/ui/toast.tsx (1 hunks)
  • apps/mail/providers/client-providers.tsx (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
apps/mail/app/(routes)/toast-test.tsx (1)
apps/mail/components/icons/icons.tsx (1)
  • Reply (852-867)
apps/mail/components/ui/toast.tsx (1)
apps/mail/components/icons/icons.tsx (4)
  • CircleCheck (258-273)
  • ExclamationCircle2 (1431-1446)
  • ExclamationTriangle (630-645)
  • InfoCircle (1281-1301)
🔇 Additional comments (2)
apps/mail/components/ui/toast.tsx (1)

22-38: Verify classNames keys against the current Sonner API

toastOptions.classNames contains keys such as actionButton, cancelButton, closeButton, loading, and loader.
In the latest Sonner versions the documented keys are action, cancel, close, loader, icon, etc. A mismatch silently re-verts to Sonner defaults, undoing all the styling work.

Please cross-check the package version actually consumed at runtime and adapt the keys if necessary.

Run:

#!/bin/bash
# Show sonner version and look for 'classNames' keys in its type definitions
grep -R --line-number "classNames" "$(npm root)/sonner" | head
apps/mail/app/(routes)/toast-test.tsx (1)

83-91: action.label may not accept JSX – double-check Sonner API

Sonner’s action.label parameter is typed as string in current releases. Passing a React node could crash the toast or render [object Object].

If JSX is not supported, keep the label a string and move the icon into the toastOptions.classNames.action styling instead.

-  action: {
-    label: (
-      <span className="flex items-center gap-1">
-        <Reply className="fill-muted-foreground dark:fill-[#9B9B9B]" />
-        Undo
-      </span>
-    ),
+  action: {
+    label: "Undo",

Also, the comment “// 10 seconds” is misleading: 99999999999999 ms ≈ 3 years.

@ahmetskilinc ahmetskilinc merged commit eacc495 into staging Jun 17, 2025
3 checks passed
Copy link
Contributor Author

Merge activity

@ahmetskilinc ahmetskilinc deleted the 06-16-toast_design branch June 17, 2025 01:54
@coderabbitai coderabbitai bot mentioned this pull request Jun 26, 2025
@coderabbitai coderabbitai bot mentioned this pull request Aug 3, 2025
15 tasks
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