-
Notifications
You must be signed in to change notification settings - Fork 3k
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
If a deleted parent doesn't have a thread anymore, hide it #22690
If a deleted parent doesn't have a thread anymore, hide it #22690
Conversation
@mananjadhav Please 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] |
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.
Change looks fine, testing this out.
@yuwenmemon Please 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] |
@dangrous I can see an issue related to Steps:
Here's the video with the applied steps. deleted-thread-message.movAlso after refreshing/logging out and logging in I can see these |
Hmmm @mananjadhav yeah that first issue seems like something we can tackle here as well. I think we just need to update the optimistic data to match, let me see what I can do. As for the second you called out, I'm not seeing that, is there a specific circumstance that made that happen (e.g. slow connection, something like that?). If you inspect those with react dev tools, what are the values of |
I added a change that seems to fix that other issue, using hasCommentThread. Seems to work on my end, let me know how it tests!
@mananjadhav I managed to see the behavior you're talking about - but it only happens when I revert the code in this PR... Is it possible you didn't have the branch loaded when you were testing out that other issue? |
You're right. I think I had switched my branch by then. I'll retest the feature in your branch. |
@dangrous one more scenario, assume before we delete the last message, we copy the thread chat URL, and after deleting the last message we paste and visit the thread URL. At the moment, it loads |
Hmmm yeah I think that's probably fine. That way, if there was an old URL somewhere, you'd know what happened (oh, the thread has been deleted) vs. just being redirected without a note. Technically then you could reopen a thread on a deleted message that you otherwise can't see, but I don't see how that would be used, for good or for bad. |
@srikarparsi Please 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] |
Reviewer Checklist
Screenshots/VideosWebweb-deleted-message.movMobile Web - Chromemweb-chrome-deleted-message.movMobile Web - Safarimweb-safari-deleted-message.movDesktopdesktop-deleted-message.moviOSios-deleted-message.movAndroidandroid-deleted-message.movThanks for the answers @dangrous. Can you rerun the lint action? It looks failed. @yuwenmemon All yours. |
Yeah lint is not happy - seems like it's not just this PR, discussing here |
woo lint is good to go |
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.
lgtm!
So I think Melvin double-assigned an internal reviewer here, I don't think we need you @yuwenmemon but if you'd like to join in, have at it! |
Cool! I'll just go ahead and merge this since it seems pretty straightforward |
✋ 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/srikarparsi in version: 1.3.41-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.41-3 🚀
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 1.3.42-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.41-3 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.42-26 🚀
|
@@ -90,7 +90,7 @@ function isReportPreviewAction(reportAction) { | |||
* @returns {Boolean} | |||
*/ | |||
function hasCommentThread(reportAction) { | |||
return lodashGet(reportAction, 'childType', '') === CONST.REPORT.TYPE.CHAT; | |||
return lodashGet(reportAction, 'childType', '') === CONST.REPORT.TYPE.CHAT && lodashGet(reportAction, 'childVisibleActionCount', 0) > 0; |
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.
@dangrous I think this change is one level depth, It doesn’t check for nested threads, and that may lead to detached threads. For example :
- Create
Root Thread
inside the parent report - Open
Root Thread
and create another thread inside itThread 1
- Open
Thread 1
and create another thread inside itThread 2
- Go back to
Root Thread
and delete it and deleteThread 1
- The thread is removed from the parent report even when we have nested thread
- Now you can open
Thread 2
and if you try to navigate the root thread it will navigate through all the deleted threads until you reach the parent thread.
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.
Hm, that's interesting. Can you bring this up in Slack? It's probably not ideal behavior but I honestly can't think of what would be better. Like we'd still want to be able to access that content, so maybe it's fine? Do you think we should keep [Deleted message]
all the way down until there's a real thread? It seems a bit confusing.
This PR caused a little regression in #23139 , more context in #23139 (comment) |
Details
Hides the
[Deleted message]
of a parent of a thread if the thread no longer exists. Actually applies in a broader set of circumstances than listed in the linked issue (unless I'm missing something).It introduces one slight UI weirdness that I'd love your thoughts on, reviewers! Namely, if you delete the last child message of a thread, you are still in that thread, with only the [Deleted message] there, but as soon as you leave that thread disappears. I think that that's fine? At least I'm not sure what else to do that would be better.
Additionally, there is some weirdness with how these tests behave offline, but I checked and it seems to be the same on dev (the thread still is shown in the parent report even if it's deleted) so I'm not worrying about that.
Fixed Issues
$ #21508
$ #22674
Tests
Same as QA
Offline tests
QA Steps
[Deleted message]
and that the thread still exists and is accessible[Deleted message]
in the parent chat anymore[Deleted message]
and the chat is fully deleted immediately.PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Still having trouble with mWeb Chrome overall, unable to load (on main too)
Web
desktopweb.mp4
Mobile Web - Chrome
Mobile Web - Safari
Safari.mp4
Desktop
desktop.mp4
iOS
IOS.mp4
Android
android.mp4