Skip to content

refactor(ui): replace toast emojis with lucide icons#188

Merged
mpiton merged 1 commit intomainfrom
codex/issue-176-lucide-icons
Apr 9, 2026
Merged

refactor(ui): replace toast emojis with lucide icons#188
mpiton merged 1 commit intomainfrom
codex/issue-176-lucide-icons

Conversation

@mpiton
Copy link
Copy Markdown
Owner

@mpiton mpiton commented Apr 9, 2026

Summary

  • replace toast notification emoji glyphs with lucide-react SVG icons
  • keep the existing notification labels, navigation targets, and payload summary behavior
  • add targeted test assertions for the rendered icons

Validation

  • npm test -- src/components/Toast/Toast.test.tsx
  • npm run lint -- src/components/Toast/Toast.tsx src/components/Toast/Toast.test.tsx
  • npm run build

Closes #176


Summary by cubic

Replaced toast emojis with lucide-react SVG icons for a more consistent UI. Labels, navigation targets, and payload summaries remain unchanged.

  • Refactors

    • Map Notification types to Lucide components (Eye, CircleX, CircleCheck) using LucideIcon.
    • Render icons with data-testid="toast-icon-{type}" and add tests to assert icon presence.
  • Dependencies

    • Add lucide-react ^1.8.0.

Written for commit 6c0f791. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Enhanced toast notifications with improved icon components for better visual presentation across review requests, CI failures, and approval notifications
  • Tests

    • Updated test cases to verify proper rendering of toast notification icons
  • Chores

    • Added new icon library dependency to support component-based UI elements

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

📝 Walkthrough

Walkthrough

The changes implement a migration from Unicode emoji icons to Lucide React icon components in the Toast notification system. A new lucide-react dependency is added, Toast tests are updated to verify icon elements, and the Toast component refactors icon rendering to use Lucide components (Eye, CircleX, CircleCheck) with proper styling and test identifiers.

Changes

Cohort / File(s) Summary
Dependencies
package.json
Added lucide-react ^1.8.0 as a runtime dependency for icon components.
Toast Component & Tests
src/components/Toast/Toast.tsx, src/components/Toast/Toast.test.tsx
Replaced emoji icons (👀 ❌ ✅) with Lucide icon components (Eye, CircleX, CircleCheck). Updated NOTIFICATION_META to use Icon: LucideIcon references and refactored ToastItem to render Lucide components with fixed sizing, strokeWidth={1.9}, and data-testid attributes for verification. Added corresponding test assertions for icon presence.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Emojis scatter, so varied in sight,
Lucide icons render consistent and bright!
Eye, CircleX, CircleCheck now stand tall,
SVG precision—a joy to us all! 🎨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor(ui): replace toast emojis with lucide icons' accurately and concisely summarizes the main change in the pull request—replacing emoji glyphs with Lucide React icons in the Toast component.
Linked Issues check ✅ Passed The pull request successfully addresses the primary coding objective from #176: migrating Toast.tsx emoji icons (👀, ❌, ✅) to Lucide equivalents (Eye, CircleX, CircleCheck) with proper styling and test assertions.
Out of Scope Changes check ✅ Passed All changes are focused and in-scope: the package.json adds lucide-react dependency, Toast.tsx migrates emojis to Lucide icons with proper styling, and Toast.test.tsx adds targeted icon assertions. No unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-176-lucide-icons

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 9, 2026

Greptile Summary

This PR replaces emoji glyphs in toast notifications with lucide-react SVG icons (Eye, CircleX, CircleCheck), adds lucide-react ^1.8.0 as a production dependency, and extends the test suite with data-testid assertions for each icon type. The changes are contained to Toast.tsx, its test file, and the package manifests.

Confidence Score: 5/5

Safe to merge — clean, well-scoped icon replacement with no logic changes and updated tests.

All changes are purely presentational: emoji strings replaced with typed Lucide SVG components. No logic, state, or API surface is altered. Tests are extended to cover the new icons, and the existing behavioural tests remain intact.

No files require special attention.

Vulnerabilities

No security concerns identified. The change introduces a well-known icon library and does not affect authentication, data handling, or input validation.

Important Files Changed

Filename Overview
src/components/Toast/Toast.tsx Replaces emoji icon: string entries with Icon: LucideIcon in NOTIFICATION_META, renders the icon via <Icon data-testid=… /> inside an aria-hidden span — clean and correct.
src/components/Toast/Toast.test.tsx Adds getByTestId assertions for each notification type's icon; existing behaviour tests (auto-dismiss, navigation, payload summary) are preserved.
package.json Adds lucide-react ^1.8.0 as a production dependency, appropriate given the icon components are rendered at runtime.
package-lock.json Lock file updated to resolve lucide-react@1.8.0 with a valid integrity hash; peer-dep range covers React 16–19.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[useNotifications hook] -->|notifications array| B[Toast component]
    B -->|map each notification| C[ToastItem]
    C --> D{NOTIFICATION_META lookup}
    D -->|review_request| E[Eye icon]
    D -->|ci_failure| F[CircleX icon]
    D -->|pr_approved| G[CircleCheck icon]
    E --> H[aria-hidden span wrapper]
    F --> H
    G --> H
    H --> I[button: label plus summary]
    I -->|click| J[onNavigate + onDismiss]
    I -->|5s timeout| K[auto-dismiss]
Loading

Reviews (1): Last reviewed commit: "refactor(ui): replace toast emojis with ..." | Re-trigger Greptile

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
src/components/Toast/Toast.tsx (1)

80-80: Consider unique icon test IDs per toast instance.

Line 80 uses only notification.type, so same-type toasts can produce duplicate test IDs and brittle selectors.

Proposed tweak
-          data-testid={`toast-icon-${notification.type}`}
+          data-testid={`toast-icon-${notification.type}-${notification.id}`}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Toast/Toast.tsx` at line 80, The test-id for the toast icon
currently uses only notification.type which can collide for multiple toasts of
the same type; update the data-testid in Toast.tsx (the attribute set on the
icon element) to include a unique per-instance identifier such as
notification.id or a generated index (e.g., use notification.id or a passed-in
prop like toastId) so the test selector becomes unique per toast instance (e.g.,
combine type and id); ensure the chosen identifier exists on the notification
object or is passed down from the notification list where notifications are
created.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/Toast/Toast.tsx`:
- Line 80: The test-id for the toast icon currently uses only notification.type
which can collide for multiple toasts of the same type; update the data-testid
in Toast.tsx (the attribute set on the icon element) to include a unique
per-instance identifier such as notification.id or a generated index (e.g., use
notification.id or a passed-in prop like toastId) so the test selector becomes
unique per toast instance (e.g., combine type and id); ensure the chosen
identifier exists on the notification object or is passed down from the
notification list where notifications are created.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 59b1b77b-6655-486e-97e2-d5255e448323

📥 Commits

Reviewing files that changed from the base of the PR and between 1b199a5 and 6c0f791.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json
  • src/components/Toast/Toast.test.tsx
  • src/components/Toast/Toast.tsx

@mpiton mpiton merged commit a567b6b into main Apr 9, 2026
8 of 9 checks passed
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.

refactor(ui): replace emoji icons with lucide-react icon library

1 participant