-
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
Group chat: Use draft only on init and on draft changes #39312
Conversation
useEffect(() => { | ||
setSelectedOptions(getGroupParticipants()); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps -- Overwrite participants only if the draft changes | ||
}, [newGroupDraft?.participants]); |
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.
This may raise the question on why we don't always use the draft participants i.e. selectedOptions = newGroupDraft.participants
. The reason is that the draft participants are set only after the user presses the next 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.
Great point. Makes me wonder why we don't start saving them when you first tap "Add to group". Feels like we should have designed it that way (fixing that seems outside the scope of your current changes). 🤔
I have only added videos for Web. Let me know if I need to include the rest |
@c3024 I don't think this needs a C+ review |
cc @marcaaron |
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.
Code LGTM! I will have to run through testing if we don't add a C+. No problem for me, but have a few things to get to first. Will try to merge this by EOD.
useEffect(() => { | ||
setSelectedOptions(getGroupParticipants()); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps -- Overwrite participants only if the draft changes | ||
}, [newGroupDraft?.participants]); |
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.
Great point. Makes me wonder why we don't start saving them when you first tap "Add to group". Feels like we should have designed it that way (fixing that seems outside the scope of your current changes). 🤔
Reviewer Checklist
Screenshots/Videos |
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.
Tests well and LGTM. Thanks for the change!
✋ 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 production by https://github.com/Julesssss in version: 1.4.60-13 🚀
|
Details
The chat selected participants were being overwritten by the draft values whenever the options changes. This PR makes the draft used only at first render (initialization) and when the draft changes e.g. when a user is removed in the confirmation page.
Fixed Issues
$ #39295
Tests
Test 1
Test 2
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
web.1.mov
web.2.mov
MacOS: Desktop