Skip to content

✨ Redesign Tooltip as Notification With Open-on-Click and Line Clamp#105

Merged
cristiantela merged 4 commits intov3-mainfrom
feat/notification-component
May 7, 2026
Merged

✨ Redesign Tooltip as Notification With Open-on-Click and Line Clamp#105
cristiantela merged 4 commits intov3-mainfrom
feat/notification-component

Conversation

@cristiantela
Copy link
Copy Markdown
Collaborator

Description

Type of Change

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Tests
  • Other

Motivation and Context

The launcher's Tooltip component was being squeezed by long message content, causing the close button to disappear. Additionally, users had no way to open the webchat by interacting with the notification bubble itself. This PR renames the component to Notification (better reflecting its purpose), fixes the close button layout, clamps message text to three lines, and wires a click/keyboard handler to open the webchat directly from the notification.

As a separate concern, the Badge component was simplified into a minimal dot indicator, removing the count display and centralising its absolute positioning within the component itself.

Summary of Changes

Notification component (renamed from Tooltip):

  • Renamed src/components/Tooltip/ to src/components/Notification/ and updated all CSS class names from weni-tooltip to weni-notification.
  • Added flex-shrink: 0 and width: fit-content to the close button so it always renders at its natural size regardless of message width.
  • Wrapped message content in .weni-notification__content with -webkit-line-clamp: 3 to cap text at three lines.
  • Added onClick and onKeyDown (Enter) handlers to the content area so clicking or pressing Enter opens the webchat via a new onOpen prop passed from Launcher.
  • Updated Launcher.jsx to pass toggleChat as onOpen to Notification.
  • Added full unit test suite (Notification.test.jsx) covering rendering, close button, and content-area open/keyboard behaviour.

Badge refactor:

  • Removed count/max display logic from Badge, turning it into a plain dot indicator.
  • Moved absolute positioning from Launcher.scss into Badge.scss so placement is self-contained.

Design Files

Shopping assistant - Notifications

Demonstration

image

cristiantela and others added 3 commits May 6, 2026 17:37
…onent

Remove the count/max display logic from Badge, turning it into a
minimal dot indicator. Move absolute positioning from Launcher into
Badge itself so placement is self-contained.

Co-authored-by: Cursor <cursoragent@cursor.com>
Rename the Tooltip component to Notification and move it to
src/components/Notification/. Clicking the notification content now
opens the webchat via onOpen, and long messages are clamped to three
lines. The close button is prevented from shrinking on wide content.
Adds full unit test coverage for all new behaviour.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 61.94%. Comparing base (cd02cd3) to head (19b810f).

Files with missing lines Patch % Lines
src/components/Launcher/Launcher.jsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           v3-main     #105      +/-   ##
===========================================
+ Coverage    61.90%   61.94%   +0.03%     
===========================================
  Files           81       81              
  Lines         3749     3747       -2     
  Branches      1025     1000      -25     
===========================================
  Hits          2321     2321              
+ Misses        1380     1379       -1     
+ Partials        48       47       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cristiantela cristiantela merged commit 2b28c50 into v3-main May 7, 2026
2 checks passed
@cristiantela cristiantela deleted the feat/notification-component branch May 7, 2026 12:58
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