Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.51k stars 2.86k forks source link

[$250] [HOLD for payment 2024-04-09] [CRITICAL] [Groups] Frontend (Part 1): Create Group Chats + Splits. Deprecate Group DM creation. Support viewing both Group DMs and Group Chats. #32317

Closed marcaaron closed 6 months ago

marcaaron commented 11 months ago

Holding on:

Group Chats Design Doc

Changes described in detail here.

Goals

Current UI:

Image

New UI (with differences noted):

Image

API call:

Migration notes:

Image

This will all need to be performed in one App PR. We will hard deprecate older versions after it is deployed to production by updating the minimum app version so there is a hard dependency on this PR getting approved and merged:

Other things to note:

Implementation notes:

Our existing screen for this flow is: NewChatSelectorPage, but the Chat tab section is the NewChatPage. Its Modal stack navigator is here.

We need to: Modify the “Create group” button so that it says “Next”. Add an additional page to the NewChatSelectorPage stack navigator. Create a new page which we will call NewChatConfrmPage Add the appropriate routes for this page at /new/chat/confirm

Switching the button to “Next” here when we have tapped the “Add to group” option. Navigating to the new page

We need to add logic to navigate the user to the confirm page when they have selected “Add to group” here and have some staging participants.

We’ll also need some way for this new page to access those participants. The selectedOptions are currently stored here and house the members being added to the group. We will move them to a new Onyx key called newGroupChat that will be exclusively used to hold the state for a Group chat that is in the process of being created. This will allow the user to refresh the page and pick up where they left off (which is not possible today) and also allow us to share this state between all pages in the flow.

Start group button By this point, the newGroupChat Onyx state should have the following required data for the OpenReport API call: optimisticReportID optimistic accountIDs for any participants groupChatAdminLogins - should only contain the creator reportName - empty string (for now)

onPress we will navigate to the report just like we do already for Group DMs.

To do this, we will modify the navigateAndOpenReport() method here to handle the: memberRoles (if any) reportName

It already handles the logins. So, we need to add arguments for roles and reportName to that method. We must also modify the logic here when we have the group chat case since we won’t ever need to get an existing chat and will always be creating one.

The optimisticReport returned from ReportUtils.buildOptimisticChatReport() must be modified to update the participants field (see refactor plan here) with the corresponding role for each participant. Finally, the optimistic report is passed here to be created in the server. We must also pass the memberRoles as it will contain the link between any optimistic accountID and the login/email.

Group chat avatars will also need to display correctly in the Search function, Report header, details page, etc. We must modify the methods that get the avatars from personal details or workspace and first check for the report.avatarUrl. We can modify the existing ReportUtils.getIcons() method to first check the report.avatarUrl when we have a “Group chat” and fallback to a default avatar based off of the reportID.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0174ced808f29e748c
  • Upwork Job ID: 1777806130629287936
  • Last Price Increase: 2024-04-09
joekaufmanexpensify commented 6 months ago

@s77rt offer for $250 sent via upwork!

s77rt commented 6 months ago

Actually there were many regressions / missed cases: https://github.com/Expensify/App/issues/39247 https://github.com/Expensify/App/issues/39295 https://github.com/Expensify/App/issues/39254 https://github.com/Expensify/App/issues/39323 https://github.com/Expensify/App/issues/39560

joekaufmanexpensify commented 6 months ago

Interesting. Curious if @marcaaron you agree that all of these were regressions?

Reason I ask is each regression typically reduces bounty by 50%. So if there were 6 regressions here, the bounty would be reduced from $500 > $8. So want to be super sure that each of them was in fact a regression.

joekaufmanexpensify commented 6 months ago

Noting that @marcaaron and I discussed this 1:1 and decided that there should be no regression penalties here. Marc flagged that @s77rt has gone above and beyond to do a great job working on this project, and any missed cases are not indicative of mistakes or anything like that.

So we're going to pay out the full $500 to @s77rt for this one via Upwork.

s77rt commented 6 months ago

Thank you! I have accepted the Upwork offer

joekaufmanexpensify commented 6 months ago

@s77rt $500 sent and contract ended!

joekaufmanexpensify commented 6 months ago

Upwork job closed.

joekaufmanexpensify commented 6 months ago

All set. TY!

melvin-bot[bot] commented 2 months ago

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.