Skip to content

fix: refactor and fix notify bell hover logic#1435

Merged
fadi-george merged 34 commits intomainfrom
fg/bell-fix
Mar 4, 2026
Merged

fix: refactor and fix notify bell hover logic#1435
fadi-george merged 34 commits intomainfrom
fg/bell-fix

Conversation

@fadi-george
Copy link
Contributor

@fadi-george fadi-george commented Mar 4, 2026

Description

1 Line Summary

Address: https://app.asana.com/1/780103692902078/project/1208777190614537/task/1213013500097033
Refactor and fix the notify bell component, resolving a tooltip race condition and simplifying CSS/JS.

Details

This overhauls the bell (notify button) prompt. Major areas of change:

  • Replaced SCSS stylesheets with plain CSS, using CSS Anchor Positioning and the Popover API for layout and dialog behavior
  • Removed AnimatedElement base class and simplified all bell sub-components (Launcher, Button, Badge, Message, Dialog)
  • Replaced the internal event system with direct method calls between components
  • Fixed a race condition where the tooltip/message would stay visible indefinitely. The old code had async _Hovering/_Hovered event handlers sharing a _hovering flag. If _show() resolved before the _Hovered (mouse-leave) handler ran, _hovering was already false, so the hide was never scheduled. This refactor removes that pattern entirely in favor of a simple mouseleave listener that blurs the button.
  • Fixed several other UI bugs: dialog image sizing, hover state persistence when button focused, transform origin centering, message display timing, and prenotify on blocked permissions
  • Added test coverage for Bell, Dialog, Launcher, Badge, Button, Message, and Slidedown with minimum coverage thresholds

Screenshots/Videos

Hover / Click

Screen.Recording.2026-03-04.at.12.43.05.AM.mov

With tooltip hover

small_inactive_hover

Regular

small_inactive

Positioned Right

right_position

Custom Colors

bell_custom_settings
bell_custom_colors
Screenshot 2026-03-04 at 12 30 12 AM
Screenshot 2026-03-04 at 12 30 18 AM

Systems Affected

  • WebSDK
  • Backend
  • Dashboard

Validation

Tests

Info

Added and expanded unit tests across all bell sub-components. Coverage thresholds configured in vitest.config.ts.

Checklist

  • All the automated tests pass or I explained why that is not possible
  • I have personally tested this on my machine or explained why that is not possible
  • I have included test coverage for these changes or explained why they are not needed

Programming Checklist
Interfaces:

  • Don't use default export
  • New interfaces are in model files

Functions:

  • Don't use default export
  • All function signatures have return types
  • Helpers should not access any data but rather be given the data to operate on.

Typescript:

  • No Typescript warnings
  • Avoid silencing null/undefined warnings with the exclamation point

Other:

  • Iteration: refrain from using elem of array syntax. Prefer forEach or use map
  • Avoid using global OneSignal accessor for context if possible. Instead, we can pass it to function/constructor so that we don't call OneSignal.context

Screenshots

Info

N/A - visual behavior validated manually via playground.

Checklist

  • I have included screenshots/recordings of the intended results or explained why they are not needed

Related Tickets

https://app.asana.com/1/780103692902078/project/1208777190614537/task/1213013500097033



This change is Reviewable

@fadi-george fadi-george changed the title Refactor and fix notify bell component fix: refactor and fix notify bell hover logic Mar 4, 2026
@fadi-george fadi-george marked this pull request as ready for review March 4, 2026 07:51
Copy link

@abdulraqeeb33 abdulraqeeb33 left a comment

Choose a reason for hiding this comment

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

Its a lot of changes @fadi-george . can we do a small bug bash around this?

@fadi-george fadi-george merged commit 9af7a5e into main Mar 4, 2026
5 checks passed
@fadi-george fadi-george deleted the fg/bell-fix branch March 4, 2026 21:42
@github-actions github-actions bot mentioned this pull request Mar 5, 2026
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