fix: web does not show not show notifications for not active window#18065
Conversation
|
@cristipaval @Santhosh-Sellavel One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@cristipaval @Santhosh-Sellavel This is basically a refactor where we separate |
| function hasFocus() { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Assuming it has focus is weird?
There was a problem hiding this comment.
I think it's fine since checking isVisible should be enough on the native case.
There was a problem hiding this comment.
I see your point @Santhosh-Sellavel. In the future, we might want this function to behave as onResume-onPause lifecycle on Android. I mean, for instance, sometimes the App might be foregrounded and partially visible but not focused because there is a system alert on top of it. But I also do agree with @luacmartins that this might be out of scope for now.
|
Can you update the issue title to something meaning full |
cristipaval
left a comment
There was a problem hiding this comment.
Minor comments, nothing else to add.
Reviewer Checklist
Screenshots/VideosWeb & Desktop#### NotificationsScreen.Recording.2023-05-02.at.12.27.24.AM.movTFAScreen.Recording.2023-05-02.at.12.36.23.AM.mov |
Santhosh-Sellavel
left a comment
There was a problem hiding this comment.
LGTM, tests well!
|
cc: @luacmartins or @cristipaval |
|
Gonna merge since @cristipaval's comment are addressed as well. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.3.9-12 🚀
|
|
@Santhosh-Sellavel @cristipaval Could you confirm the QA worked fine on this one? |
|
QA noted this does not work in mWeb, is it supposed to work there? |
|
No it won't on mWeb. We don't support notifications on mWeb. |
|
Nice thats what I suspected, thanks |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.12-0 🚀
|
Details
Adding window.hasFocus() into isVisible can cause the regression because this function is using in many places. In this case, we just want to fix the notification problem, so I suggest to add a new function named hasFocus and use it in Report.js.
Fixed Issues
$ #17242
$ #17969
Tests
Offline tests
Same as above
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Screencast from 17-04-2023 15:59:02.webm
Screencast from 27-04-2023 14:04:28.webm
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android