-
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
Create Group Chats + Splits. #37458
Create Group Chats + Splits. #37458
Conversation
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.
Looking super good so far! Left some thoughts and a few tips. Overall moving in a great direction. Thanks very much! 🙇
@@ -1142,6 +1142,9 @@ export default { | |||
roomDescriptionOptional: 'Descripción de la sala de chat (opcional)', | |||
explainerText: 'Establece una descripción personalizada para la sala de chat.', | |||
}, | |||
groupConfirmPage: { | |||
groupName: 'Nombre del grupo', | |||
}, |
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.
note: If we didn't yet - we should get these final approved by someone in the español channel (can wait for later)
@marcaaron I have a question reagarding this part: Should I just add all those params like this? Because as I can see we already have reportName and chatType in OptimisticData in this request and Im confused a bit :D |
Yes good question. The optimisticAccountIDList: string,
chatType: string,
groupChatAdminLogins: string,
optimisticAccountIDList: string, Later we can add something to handle the avatar - but those should be enough for this PR. And you will basically want some check like: if (chatType == 'group') {
paramters.chatType = 'group';
parameters.groupChatAdminLogins = logins.join();
paramters.optimisticAccountIDList = accountIDList.join();
parameters.reportName ? reportName : '' // pass the empty string here
} |
If there is some fancy way to do that with typescript and make it clear that only a "group chat" should have these additional params that would also be acceptable (but no need to prioritize this). |
@marcaaron Updated the code, seems to work fine. (I know that tests are failing, thats ES translations) |
Yes, this is a little bit of a tricky part because we want:
Basically, we are going to:
I suspect this migration will take a bit longer than the Group Chats feature itself and we are targeting end of May for release so that's why it's happening in this order 🙃 But open to any thoughts on it too. Let me know if you run into any issues or confusing things. |
@marcaaron Okay, get it, I can do a conditional call for group chats for now with "participants" field. |
@marcaaron Was able to create with such a response: Looks like Im not an admin of this group chat, but send participants correctly and GroupChatAdminLogins too |
Nice!
👍 We want that "Join" button to not exist if you are a participant. It is showing because the App/src/pages/home/HeaderView.js Lines 172 to 174 in ffa731a
Easiest would be to add a check like: const canJoinOrLeave = !isSelfDM && !isGroupChat && (isChatThread || isUserCreatedPolicyRoom || canLeaveRoom); Nobody can "Join" a Group Chat like this. Have to be invited by someone for now.
I think you are the admin, we just don't show it anywhere on the members page yet. So, it's a new thing to add. But, let me know if I didn't understand your question! Thanks! |
@marcaaron Looks like added everything, but needs to be checked carefully, because could miss something, doc is not really detailed, but hopefully everything is here :) |
Ah, okay, OptionsSelector was deprecated, rewriting to SelectionList |
Updated and resolved conflicts |
src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js
Outdated
Show resolved
Hide resolved
Ok, thanks for the investigation there (did not have a chance as I discovered the bug later in my day). I will try to find the answer to this. We have @aldo-expensify working on a PR related to |
Ah ha actually - the problem is that everyone is "hidden" until we leave a comment on the chat. Of course, apologies for not catching that sooner. My head was on backwards yesterday. This is expected as the Optimistic chat report should have:
Real chat report returned should have:
When someone leaves a comment it will end up as
I think there is nothing we need to do here for now. We will update this to use Thanks everyone! |
@marcaaron looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Not emergency. Looks like tests have passed. |
🚀 Deployed to staging by https://github.com/marcaaron in version: 1.4.58-0 🚀
|
👋 I think that this deploy blocker is probably a result of this PR. Would you mind taking a look please? |
@stitesExpensify It was not a scope of this issue, should not be a blocker |
Also seems this issue is coming from this PR, but I don't think it should be a deploy blocker. |
🚀 Deployed to production by https://github.com/Beamanator in version: 1.4.58-8 🚀
|
let newSelectedOptions; | ||
if (newGroupDraft?.participants) { | ||
const selectedParticipants = newGroupDraft.participants.filter((participant) => participant.accountID !== personalData.accountID); | ||
newSelectedOptions = selectedParticipants.map((participant): OptionData => { | ||
const baseOption = OptionsListUtils.getParticipantsOption({accountID: participant.accountID, login: participant.login, reportID: ''}, personalDetails); | ||
return {...baseOption, reportID: baseOption.reportID ?? ''}; | ||
}); | ||
setSelectedOptions(newSelectedOptions); | ||
} |
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.
onSelectRow={unselectOption} | ||
showConfirmButton={selectedOptions.length > 1} | ||
confirmButtonText={translate('newChatPage.startGroup')} | ||
onConfirm={createGroup} |
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.
We missed adding a condition here to check if anything is selected before calling onConfirm
- this caused an issue where CMD+enter can still proceed past the step.
@@ -3649,6 +3693,15 @@ function buildOptimisticChatReport( | |||
parentReportID = '', | |||
description = '', | |||
): OptimisticChatReport { | |||
const participants = participantList.reduce((reportParticipants: Participants, accountID: number) => { | |||
const participant: ReportParticipant = { | |||
hidden: false, |
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 is causing issue #41832, for the transaction threads this needs to be true to be consistent with BE.
@@ -1343,7 +1347,7 @@ export default { | |||
}, | |||
newChatPage: { | |||
createChat: 'Crear chat', | |||
createGroup: 'Crear grupo', | |||
startGroup: 'Grupo de inicio', |
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 translation is wrong. I search in slack and I could not find any mention of this particular string, so I think it was not reviewed by anyone and if that's correct it means that @waterim you checked this checklist item without actually doing it:
If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
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.
BTW changed this here #45342
confirmButtonText={selectedOptions.length > 1 ? translate('common.next') : translate('newChatPage.createChat')} | ||
textInputAlert={isOffline ? [`${translate('common.youAppearToBeOffline')} ${translate('search.resultsAreLimited')}`, {isTranslated: true}] : ''} | ||
onConfirmSelection={createGroup} | ||
onConfirmSelection={selectedOptions.length > 1 ? navigateToConfirmPage : createChat} |
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.
We should have removed the requirement that a group chat needs more than 1 other participant to be created because this requirement was only applicable in the NewChatPage
and could be skipped in NewChatConfirmPage
causing inconsistency. Also because this was not really a requirement after all.
return options; | ||
}, [allPersonalDetails, newGroupDraft?.participants]); | ||
|
||
const groupName = ReportUtils.getGroupChatName(participantAccountIDs ?? []); |
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.
Coming from this issue #46502, this is a case that we might miss when testing/implementing this issue. For the details, we check here #46502 (comment)
Details
Create Group Chats + Splits. Deprecate Group DM creation. Support viewing both Group DMs and Group Chats.
Fixed Issues
$ #32317
Tests
Test creating single user chat
Test creating single user chat with new account
Test existing Group DM looks and behaves normal in staging
Test creating new Group Chat
Create new group from existing DM members
Verify that users only see Group Chats when a comment appears
Verify Global Create split creates new Group Chat
Offline tests
Same as tests
QA Steps
None
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
Web