App icon indicating copy to clipboard operation
App copied to clipboard

Only display First Name in the LHN chat row for Group DMs [Pay June 1st]

Open puneetlath opened this issue 5 years ago • 12 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Expected Result:

Let's only show first names in the LHN for group DMs so that that more names show and they are easier to see.

Mockup: image

Actual Result:

When there are many members of a DM, it's hard to see all their names in the LHN, and especially hard to tell multiple group DMs apart when most of the names are not shown.

image

Action Performed:

  1. Click the "+" button
  2. Click "new group"
  3. Start a group with multiple people
  4. Notice the way the group names are listed in the LHN

Platform:

This should be the same on all platforms: Web iOS Android Desktop App Mobile Web

View all open jobs on Upwork

Upwork job: https://www.upwork.com/jobs/~01a6fe166a7e485c1e

puneetlath avatar May 03 '21 02:05 puneetlath

Triggered auto assignment to @SofiedeVreese (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar May 03 '21 02:05 MelvinBot

Triggered auto assignment to @Julesssss (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

MelvinBot avatar May 03 '21 02:05 MelvinBot

Proposal: /src/pages/home/HeaderView.js

I use firstName instead of displayName:

57:   const displayNamesWithTooltips = _.map(
         getPersonalDetailsForLogins(participants, props.personalDetails),
-        ({displayName, login}) => ({displayName, tooltip: login}),
+        ({firstName, login}) => ({displayName: firstName, tooltip: login}),

for native, I will create a string constant: const fullTitle = displayNamesWithTooltips.map(({displayName})=> displayName).join(', '); and past it instead of getReportParticipantsTitle(participants)

96:    <DisplayNames
-            fullTitle={getReportParticipantsTitle(participants)}
+            fullTitle={fullTitle}

Viacheslav80 avatar May 03 '21 13:05 Viacheslav80

Proposal: First i adjust the function that creates the title to receive personalDetails from chat and get the first name if the account has... ` /**

  • Returns the concatenated title for the PrimaryLogins of a report on chat *
  • @param {Array} logins
  • @param {Object} personalDetails
  • @returns {string} */ function getReportParticipantsTitleInChat(logins, personalDetails) { logins.map((login) => { const {firstName} = personalDetails[login]; if (firstName) { return firstName; } return login; }); return _.map(logins, login => Str.removeSMSDomain(login)).join(', '); }`

Then i pass the participants array and the object of personalDetails

<DisplayNames fullTitle={getReportParticipantsTitleInChat(participants, personalDetails)} displayNamesWithTooltips={displayNamesWithTooltips} tooltipEnabled numberOfLines={1} textStyles={[styles.headerText]} />

ViniSchonardie avatar May 03 '21 16:05 ViniSchonardie

image We should fix them only on the HeaderView.js file. More important thing in this problem, we have to consider how to solve the case when 1 : 1 chatting. For the problem, I've used the condition statement as shown above. It was fine on all devices. Thanks.

johndev0711 avatar May 04 '21 02:05 johndev0711

Screenshot_1620095503 Screenshot_1620095519 Screenshot_1620095531

johndev0711 avatar May 04 '21 02:05 johndev0711

Thanks everyone. @Viacheslav80 as you made the first proposal with a straightforward solution, would you like to work on the task?

Julesssss avatar May 04 '21 11:05 Julesssss

@Julesssss Ok, I'll take it to work... I mistakenly deleted myself from Assignees))

Viacheslav80 avatar May 04 '21 13:05 Viacheslav80

@puneetlath I can see the UpWork issue was created. Could we hire Viacheslav80, now that they have started the work?

Julesssss avatar May 05 '21 13:05 Julesssss

Done!

puneetlath avatar May 05 '21 17:05 puneetlath

@puneetlath hold off on paying this job since there's a regression

iwiznia avatar May 19 '21 18:05 iwiznia

Regression fix. Job paid.

puneetlath avatar Jun 01 '21 14:06 puneetlath