Fix newMarker disappearing when deleting the comment that was marked unread. - #14032
Conversation
|
Current state of this is it works, until onyx is updated, which makes the newMarker disappear. Navigating away and then back to the chat draws it again as intended. |
|
I still have to run the android tests. |
|
|
||
| if (this.newMarkerReportActionID !== '') { | ||
| this.setState({newMarkerReportActionID: ReportUtils.getNewMarkerReportActionID(nextProps.report, this.sortedAndFilteredReportActions)}); | ||
| } | ||
|
|
There was a problem hiding this comment.
Updating state in shouldComponentUpdate is actually an anti-pattern, this is more intended to determine if the component should update at all. This should live in componentDidUpdate
There was a problem hiding this comment.
Where should I do it? componentDidUpdate doesn't run until after render happens. We want to update it before/during render.
There was a problem hiding this comment.
Ah I see is that why you were running into the flickering? Another idea would be to check if when the action is deleted, if Report.subscribeToNewActionEvent is called - if so you could put it in there
|
@thienlnam - before I run through my complete test suite here, do you mind taking a look and seeing if you like this approach better? |
thienlnam
left a comment
There was a problem hiding this comment.
We keep newMarkerReportActionID in state because we want it to re-render every time it changes, but this approach just adds another variable to track the same thing.
I still think we should have this in the action event subscriber. Deleting a report comment should trigger that callback, which is where you can update the newMarkerReportActionID in state
|
@thienlnam - deleting a comment doesn't seem to trigger that callback. That doesn't actually seem to be called anywhere except from |
|
@grgia and @thienlnam This is updated and ready to go! |
thienlnam
left a comment
There was a problem hiding this comment.
Code changes look good 👍 just need to run through testing screenshots
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-01-20.at.2.09.58.PM.movMobile Web - ChromeScreen.Recording.2023-01-20.at.2.10.37.PM.movMobile Web - SafariScreen.Recording.2023-01-20.at.2.16.12.PM.movDesktopScreen.Recording.2023-01-20.at.2.18.25.PM.moviOSScreen.Recording.2023-01-20.at.2.14.53.PM.movAndroidandroid emulator broken |
|
✋ 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/thienlnam in version: 1.2.58-0 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.2.58-4 🚀
|
Details
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/251047
PROPOSAL: N/A
Tests
For clarification, please watch one of the videos in the video/screenshot section.
Offline tests
The same as above, except that the deleted comment should show as "greyed out" and stricken instead of disappearing. See the "offline" video in the "web" portion of the screenshots/videos section for an example.
QA Steps
Please repeat the "tests" section steps from above.
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.Screenshots/Videos
Web
web.mov
Offline:
screen_recording_web_offline.mov
Mobile Web - Chrome
andriod-web.mov
Mobile Web - Safari
ios-web.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov