Only display First Name in the LHN chat row for Group DMs [Pay June 1st]
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:

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.

Action Performed:
- Click the "+" button
- Click "new group"
- Start a group with multiple people
- 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
Upwork job: https://www.upwork.com/jobs/~01a6fe166a7e485c1e
Triggered auto assignment to @SofiedeVreese (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Triggered auto assignment to @Julesssss (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
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}
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]}
/>
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.

Thanks everyone. @Viacheslav80 as you made the first proposal with a straightforward solution, would you like to work on the task?
@Julesssss Ok, I'll take it to work... I mistakenly deleted myself from Assignees))
@puneetlath I can see the UpWork issue was created. Could we hire Viacheslav80, now that they have started the work?
Done!
@puneetlath hold off on paying this job since there's a regression
Regression fix. Job paid.