-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(quantic): make quantic notifications component dismissible #4733
base: master
Are you sure you want to change the base?
Conversation
Pull Request ReportPR Title❌ Title should follow the conventional commit spec: Example: Live demo linksBundle Size
SSR Progress
Detailed logssearch : buildInteractiveResultsearch : buildInteractiveInstantResult search : buildInteractiveRecentResult search : buildInteractiveCitation search : buildGeneratedAnswer recommendation : missing SSR support case-assist : missing SSR support insight : missing SSR support commerce : missing SSR support |
4201787
to
02e1a9f
Compare
1f17b0b
to
3b0e1ef
Compare
Visual review: Nice work 👍 |
Set the height of the icon to 16px which looks nicer! thanks |
packages/quantic/force-app/main/default/lwc/quanticNotifications/quanticNotifications.js
Outdated
Show resolved
Hide resolved
packages/quantic/force-app/main/default/lwc/quanticNotifications/quanticNotifications.html
Outdated
Show resolved
Hide resolved
7ca1479
to
59dbcc3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small improvements that I think can help clarity
if (!this.searchStatus.state.isLoading) { | ||
this.notifications = | ||
this.notifyTrigger?.state?.notifications.map((notification, index) => ({ | ||
value: notification, | ||
id: index.toString(), | ||
visible: true, | ||
})) ?? []; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do that, that way on each "new query" the notifications are actually cleared so for example they don't display while the rest of the UI is in "loading" mode, aka showing placeholders.
if (!this.searchStatus.state.isLoading) { | |
this.notifications = | |
this.notifyTrigger?.state?.notifications.map((notification, index) => ({ | |
value: notification, | |
id: index.toString(), | |
visible: true, | |
})) ?? []; | |
} | |
if (this.searchStatus?.state?.isLoading) { | |
this.notifications = []; | |
} else { | |
this.notifications = | |
this.notifyTrigger?.state?.notifications.map((notification, index) => ({ | |
value: notification, | |
id: index.toString(), | |
visible: true, | |
})) ?? []; | |
} |
Also why did you add the toString()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will test the first point you bring up, seems to make sense
for the second question, it is because in the handleNotificationClose
when we do: if (notification.id === currentNotificationId)
, the currentNotificationId is of type string, so it was so that they could do the comparison, but when I think about it, I could probably just do if (notification.id.toString() === currentNotificationId)
packages/quantic/force-app/main/default/lwc/quanticNotifications/quanticNotifications.html
Outdated
Show resolved
Hide resolved
@@ -1,7 +1,15 @@ | |||
:host { | |||
--slds-c-toast-sizing-min-width: 100%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I documented that in the PR description, it is to fix the width issue of the notifications
} | ||
|
||
.notification-container { | ||
z-index: 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally would put this at like 10?
So at least there can be content in between 0 and the notifications?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modal is 40 so we could do steps of 20 and set it at 20, but I didnt think there would be content between 0 and 1
...antic/force-app/main/default/lwc/quanticNotifications/__tests__/quanticNotifications.test.js
Outdated
Show resolved
Hide resolved
521909a
to
af58932
Compare
SFINT-5767
IN THIS PR:
More about the solution:
The
QuanticNotifications
component was rendering the notifications based on the notifications array it was getting from the notify trigger state from headless. We are therefore adding a button to close the notification in the template, which will call thehandleNotificationClose
handler function.DEMO STYLING:
Before:
After:
DEMO FUNCTIONALITY:
Screen.Recording.2024-11-29.at.2.46.13.PM.mov
BONUS:
Resized the default icon for x close button to 16px instead of 24px which looks nicer:
TESTS: