-
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
[HOLD for Payment 5/30][$250] Allow creating a Group Chat with a single member #40258
Comments
Triggered auto assignment to @Christinadobrzyn ( |
|
Job added to Upwork: https://www.upwork.com/jobs/~016c3003963dd24c78 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Allow creating a Group Chat with a single member What is the root cause of that problem?new feature: enable creating a group chat with a single member What changes do you think we should make in order to solve the problem?to achieve that we need to enable the confirm button to show up whenever we have one or members, we need to change this: App/src/pages/NewChatConfirmPage.tsx Line 135 in 4ea37b6
to showConfirmButton={selectedOptions.length > 0} also, we need to change the App/src/pages/NewChatConfirmPage.tsx Line 157 in 76ca781
onConfirm={selectedOptions.length > 0 ? createGroup : undefined} finally we need to modify the App/src/libs/actions/Report.ts Line 780 in d2795ae
const isGroupChat = participantAccountIDs.includes(currentUserAccountID); because when creating a group chat the current user id will be passed in the participants lists whereas in the direct dm we pass only the other party accountid alternatively:Given that the user cannot deselect themselves from the options, it is guaranteed that at least one option will always be selected. Consequently, we can eliminate the length check above. showConfirmButton
onConfirm={createGroup} |
ProposalPlease re-state the problem that we are trying to solve in this issue.Update code to Allow 1 person group feature What is the root cause of that problem?Feature request What changes do you think we should make in order to solve the problem?First we need to allow the user to show the create group button and press confirm for even when participant length is 1, that can be done by changing the below to App/src/pages/NewChatConfirmPage.tsx Line 155 in 76ca781
App/src/pages/NewChatConfirmPage.tsx Line 157 in 76ca781
Then finally we need to update the App/src/libs/actions/Report.ts Line 836 in 76ca781
This is enough to create the group of 1 person What alternative solutions did you explore? (Optional) |
@marcaaron No backend changes would be required for this, my proposal covers all the places where we need to make the changes no additional changes required, also we need to update the `navigateToAndOpenReport, Screen.Recording.2024-04-16.at.4.06.06.AM.mov |
Hello @abzokhattab , can you please post in a comment stating that you updated some part of your proposal after my proposal, the contribution guideliens also state this too, thanks 😃
c.c. @sobitneupane |
Proposal UpdatedUpdated the Note: the third solution proposed here would also apply as another solution for this problem |
@GandalfGwaihir thank you for your comment. Sorry, I forgot to add the proposal updated alert. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Enable create group chat with only one user. What is the root cause of that problem?This is a new feature request. What changes do you think we should make in order to solve the problem?
App/src/pages/NewChatConfirmPage.tsx Line 157 in 90412ec
App/src/pages/NewChatConfirmPage.tsx Line 155 in 90412ec
And then pass
App/src/pages/NewChatConfirmPage.tsx Line 104 in 90412ec
I've tested and we don't need backend changes here.
Line 247 in 90412ec
What alternative solutions did you explore? (Optional)NA |
ProposalPlease re-state the problem that we are trying to solve in this issue.Allow creating a Group Chat with a single member. What is the root cause of that problem?new feature What changes do you think we should make in order to solve the problem?For that we need 3 steps (important step 3).
// showConfirmButton={selectedOptions.length > 1}
showConfirmButton={selectedOptions.length > 0}
// onConfirm={selectedOptions.length > 1 ? createGroup : undefined}
onConfirm={selectedOptions.length > 0 ? createGroup : undefined}
The only different now between DM 1:1 and group is // remove old isGroupChat
// const isGroupChat = participantAccountIDs.length > 1;
// we need to handle `isSignalMemberGroupChat` in (exist/not exist)
// for not exist group >>> participants === 1 and isDraftGroup called by cretae group(explained below).
// for exist group >>> participants === 1 and chatType is group.
// isDraftGroup definition
// as we pass `optimisticReportID` only when we create a new group, so if it not undeifined that mean this is draft group.
// we can also create new param isDraftGroup and pass it true when creating the group (only in this place)
const isDraftGroup = !!optimisticReportID;
const isSignalMemberGroupChat = participantAccountIDs.length === 1 &&
(isDraftGroup || ReportUtils.getChatByParticipants(participantAccountIDs)?.chatType === CONST.REPORT.CHAT_TYPE.GROUP);
// the new `isGroupChat` will be
const isGroupChat = isSignalMemberGroupChat || participantAccountIDs.length > 1; For backend, I don't think we need any changes. Also, there is another issue when display group chat in search page, it displays with empty title, we need to open new issue if not exist or fix it by following this way in search page What alternative solutions did you explore? (Optional) |
Thanks for the proposal everyone. Proposal from @nkdengineer and proposal from @ahmedGaber93 both solves the issue. In @ahmedGaber93's proposal As @marcaaron Should we include two buttons—one for group chat and one for normal chat—allowing users to create group chats either alone or with just one other user, as suggested in 3rd step of proposal? |
|
No, we should make the change described in the issue. That would be a decision for the Design team to consider, not us. |
@sobitneupane @marcaaron Kindly consider my proposal for the same here: #39317 (comment) |
Thanks for the proposal everyone. Update Proposal from @abzokhattab looks good. 🎀 👀 🎀 C+ reviewed |
Current assignee @marcaaron is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
@marcaaron I think we should discuss about this because if we want to create a group chat with only one user, we need to select another to allow go to next and then de-select this one. I have another ideal for this action that we can do the dropdown button that will have two option one is create a group chat one is create a single chat. Screen.Recording.2024-04-17.at.17.11.38.movWhat do you think about it? And should we discuss with design team about this here? |
@marcaaron @shawnborton What do you think about the below? This would show the option to start a chat with only the user themselves when no one else is selected. It will also handle the case when a selected user is unselected on the confirmation page. Screen.Recording.2024-04-04.at.1.12.50.PM.mov |
@sobitneupane, @marcaaron, @Christinadobrzyn, @abzokhattab Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@abzokhattab Any update? When can we expect PR? |
@abzokhattab Can we get please get an update on this one? |
Apologies for the delay.. was pretty busy the last few days. |
the PR is ready here |
monitoring #41315 |
PR deployed to production 5 days ago so payment is coming up. Payouts due:
Upwork job is here. @sobitneupane are you paid in NewDot? @sobitneupane or @abzokhattab I know this is a new feature but do we need a regression test for this? |
@Christinadobrzyn Yup. I will request payment in NewDot. |
Regression Test Proposal
DO we agree 👍 or 👎 |
LGTM |
Regression test - https://github.com/Expensify/Expensify/issues/400167 Payment planned for tomorrow |
Ready for payment - no regression tests reported. payment summary here - #40258 (comment) Closing this out as complete but let me know if we need to reopen for anything! |
$250 approved for @sobitneupane |
Coming from this thread we have decided that there is no real reason why a user should not be able to start a Group Chat with only themselves (h/t @shawnborton who noticed that we cannot do this).
Deliverable:
Current behavior we need to improve:
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: