Skip to content

SDK-2923 Fix Bell Inactive / Active State#1373

Closed
fadi-george wants to merge 2 commits intomainfrom
fadi/sdk-2923-subscription-bell-and-popup-are-transparent-in-opened-state-2
Closed

SDK-2923 Fix Bell Inactive / Active State#1373
fadi-george wants to merge 2 commits intomainfrom
fadi/sdk-2923-subscription-bell-and-popup-are-transparent-in-opened-state-2

Conversation

@fadi-george
Copy link
Copy Markdown
Contributor

@fadi-george fadi-george commented Sep 3, 2025

Description

1 Line Summary

Before:

Screen.Recording.2025-09-03.at.1.27.02.PM.mov

After:

Screen.Recording.2025-09-03.at.1.27.14.PM.mov

Details

  • Combine active animated element and animated element into one class
  • Uses modern element getAnimations api instead of timeout
  • Removes internal animated element trigger events.
  • Renames internal Bell events to be shorter.

Systems Affected

  • WebSDK
  • Backend
  • Dashboard

Validation

Tests

Info

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

Checklist

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

Related Tickets



This change is Reviewable

@fadi-george fadi-george changed the title Simplify bell elements SDK-2923 Fix Bell Inactive / Active State Sep 3, 2025
@fadi-george fadi-george requested review from jkasten2 and sherwinski and removed request for sherwinski September 3, 2025 20:28
@fadi-george fadi-george force-pushed the fadi/sdk-2923-subscription-bell-and-popup-are-transparent-in-opened-state-2 branch 3 times, most recently from 9a43bc9 to 637ef7e Compare September 3, 2025 21:34
@fadi-george fadi-george force-pushed the fadi/sdk-2923-subscription-bell-and-popup-are-transparent-in-opened-state-2 branch from 637ef7e to 4a5f87f Compare September 3, 2025 21:38
Comment thread src/page/bell/Button.ts
Comment on lines +67 to +90
_onHovering() {
if (
LimitStore.isEmpty(this.events.mouse) ||
LimitStore.getLast(this.events.mouse) === 'out'
LimitStore.isEmpty(this._events.mouse) ||
LimitStore.getLast(this._events.mouse) === 'out'
) {
OneSignalEvent.trigger(Bell.EVENTS.HOVERING);
OneSignalEvent.trigger('notifyButtonHovering');
}
LimitStore.put(this.events.mouse, 'over');
LimitStore.put(this._events.mouse, 'over');
}

onHovered() {
LimitStore.put(this.events.mouse, 'out');
OneSignalEvent.trigger(Bell.EVENTS.HOVERED);
_onHovered() {
LimitStore.put(this._events.mouse, 'out');
OneSignalEvent.trigger('notifyButtonHover');
}

onTap() {
this.pulse();
this.activate();
this.bell.badge.activate();
_onTap() {
this._pulse();
this._activate();
this._bell._badge._activate();
}

onEndTap() {
this.inactivate();
this.bell.badge.inactivate();
_onEndTap() {
this._inactivate();
this._bell._badge._inactivate();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Including changes like these in the same commit make it difficult to parse out the parts that actually affect Bell behavior. I generally recommend keeping any refactoring changes to their own separate commits.

Comment on lines +14 to +20
StateChanged: 'notify0',
LauncherClick: 'notify1',
BellClick: 'notify2',
SubscribeClick: 'notify3',
UnsubscribeClick: 'notify4',
Hovering: 'notify5',
Hovered: 'notify6',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand the purpose of this change? Is it meant to help with bundle size by shortening the values?

@fadi-george
Copy link
Copy Markdown
Contributor Author

Ill remake the pr with simpler changes

@fadi-george fadi-george closed this Sep 8, 2025
@fadi-george fadi-george deleted the fadi/sdk-2923-subscription-bell-and-popup-are-transparent-in-opened-state-2 branch September 9, 2025 23:03
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