App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Chat - Edit comment of mentions with username is not highlighted

Open jponikarchuk opened this issue 3 months ago • 38 comments

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


Version Number: V9.2.32-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/13176723/test-cases/41237044 Email or phone of affected tester (no customers): Slottwo1 [email protected] Issue reported by: Applause Internal Team Device used: Redminote 10s android 13 phone App Component: Chat Report View

Action Performed:

  1. Launch app
  2. Open 1:1 DM
  3. Send 2 mentions seperately as 2 messages:
  1. Open edit comment

Expected Result:

Edit comment of mentions with username must be highlighted.

Actual Result:

Edit comment of mentions with username is not highlighted but username as email id highlighted.

Workaround:

Unknown

Platforms:

  • [x] Android: App
  • [x] Android: mWeb Chrome
  • [ ] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/ac672227-fc9a-4049-b082-8ec28ee920c7

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021981438143279259297
  • Upwork Job ID: 1981438143279259297
  • Last Price Increase: 2025-12-25
Issue OwnerCurrent Issue Owner: @parasharrajat

jponikarchuk avatar Oct 16 '25 09:10 jponikarchuk

Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] avatar Oct 16 '25 09:10 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

Edit comment of mentions with username is not highlighted but username as email id highlighted.

What is the root cause of that problem?

  1. When mentioning by name, it uses the mention-short format, and if the name isn’t included in availableMentions, it won’t be highlighted.
    https://github.com/Expensify/App/blob/e4aabe2748871ac61eadfc2f5f423494e47080a2/src/libs/ParsingUtils.ts#L19-L39 Mentions using email are of type mention-user, so they are always highlighted.

  2. availableMentions is derived from the availableLoginsList in useShortMentionsList. Currently, useShortMentionsList always disallows highlighting for public domains.
    https://github.com/Expensify/App/blob/e4aabe2748871ac61eadfc2f5f423494e47080a2/src/libs/LoginUtils.ts#L106-L109 Also, availableLoginsList only pulls from personalDetail.login, which may differ from the displayName, so mention-short won’t be highlighted. https://github.com/Expensify/App/blob/e4aabe2748871ac61eadfc2f5f423494e47080a2/src/hooks/useShortMentionsList.ts#L32-L33

What changes do you think we should make in order to solve the problem?

  1. We should allow highlighting for public domains. This condition can be discussed and aligned with the design team. https://github.com/Expensify/App/blob/e4aabe2748871ac61eadfc2f5f423494e47080a2/src/hooks/useShortMentionsList.ts#L28
const isEmailPublicDomainPersonalDetail = isEmailPublicDomain(personalDetail.login);
const isEmailPublicDomainCurrentUser = isEmailPublicDomain(currentUserPersonalDetails.login ?? '');
// If the emails are not in the same private domain, we don't want to highlight them
if (
    isEmailPublicDomainCurrentUser !== isEmailPublicDomainPersonalDetail ||
    (!isEmailPublicDomainCurrentUser && !areEmailsFromSamePrivateDomain(personalDetail.login, currentUserPersonalDetails.login ?? ''))
) {

Note: Alternatively, we could add a shouldAllowPublicDomain parameter to areEmailsFromSamePrivateDomain to achieve a similar result.

  1. In addition to retrieving the email, we should also include the displayName. https://github.com/Expensify/App/blob/e4aabe2748871ac61eadfc2f5f423494e47080a2/src/hooks/useShortMentionsList.ts#L32-L35
    const [username] = personalDetail.login.split('@');
    const result = [username];
    if (personalDetail.displayName && personalDetail.displayName !== personalDetail.login) {
        const [displayName] = personalDetail.displayName.split('@');
        result.push(displayName);
    }
    return result;
})
.flat()
.filter((login): login is string => !!login);

https://github.com/user-attachments/assets/a3fab41a-12de-4b79-8d90-52422c60818c

dmkt9 avatar Oct 16 '25 10:10 dmkt9

Job added to Upwork: https://www.upwork.com/jobs/~021981438143279259297

melvin-bot[bot] avatar Oct 23 '25 19:10 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)

melvin-bot[bot] avatar Oct 23 '25 19:10 melvin-bot[bot]

Proposal looks good, but we need to check why we restricted shortnames highlight for public domains earlier.

parasharrajat avatar Oct 28 '25 22:10 parasharrajat

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Oct 30 '25 16:10 melvin-bot[bot]

@parasharrajat @stephanieelliott this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Oct 30 '25 21:10 melvin-bot[bot]

I have next update tomorrow morning.

parasharrajat avatar Oct 30 '25 21:10 parasharrajat

@parasharrajat Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Nov 04 '25 23:11 melvin-bot[bot]

Hey @parasharrajat what's the latest on this one?

stephanieelliott avatar Nov 06 '25 01:11 stephanieelliott

@stephanieelliott I checked the code and we were intentionally not highlighting emails from public domain. Can you confirm whether we want to change it or not?

parasharrajat avatar Nov 06 '25 15:11 parasharrajat

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Nov 06 '25 16:11 melvin-bot[bot]

@parasharrajat just want to make sure I'm understanding - is the lack of highlight on public domain emails intentional only after editing? The gmail address was highlighted before the edit, but lost the highlight after editing.

So I’m trying to figure out:

  • is it a bug that they lose the highlight after editing?
  • or is it a bug that they were ever highlighted in the first place?

stephanieelliott avatar Nov 07 '25 03:11 stephanieelliott

Triggered auto assignment to @RachCHopkins (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] avatar Nov 10 '25 07:11 melvin-bot[bot]

Adding the Bug label to reassign this as I am going on leave til Dec 1. Status: There seems to be a bug here, unclear if it's that public domain mentions are being highlighted OR that mentions lose their highlight after editing. See https://github.com/Expensify/App/issues/72755#issuecomment-3498017313 and https://github.com/Expensify/App/issues/72755#issuecomment-3500400128

stephanieelliott avatar Nov 10 '25 07:11 stephanieelliott

Good point let me check that.

parasharrajat avatar Nov 10 '25 08:11 parasharrajat

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Nov 13 '25 16:11 melvin-bot[bot]

@parasharrajat @stephanieelliott @RachCHopkins this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

melvin-bot[bot] avatar Nov 13 '25 22:11 melvin-bot[bot]

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Nov 20 '25 16:11 melvin-bot[bot]

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Nov 27 '25 16:11 melvin-bot[bot]

This issue has not been updated in over 14 days. @parasharrajat, @stephanieelliott, @RachCHopkins eroding to Weekly issue.

melvin-bot[bot] avatar Nov 27 '25 23:11 melvin-bot[bot]

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Dec 04 '25 16:12 melvin-bot[bot]

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Dec 11 '25 16:12 melvin-bot[bot]

@parasharrajat how did you get on with this?

RachCHopkins avatar Dec 12 '25 03:12 RachCHopkins

Sorry for the delay on this.

I just checked that issue on staging. Whenever I try to tag a user with a username, I always get their email. @RachCHopkins can you try this?

https://github.com/user-attachments/assets/a71e75b5-ac7c-4771-ba0c-0b4db5c59c64

@dmkt9 Any hints on how to tag a user with username?

parasharrajat avatar Dec 12 '25 08:12 parasharrajat

@dmkt9 Any hints on how to tag a user with username?

I don’t remember any special step. At the moment I’ve tried tagging a user, but I can’t make it display as the username.

dmkt9 avatar Dec 12 '25 13:12 dmkt9

@jponikarchuk Can you confirm whether it is still possible to tag usernames or has that been changed?

parasharrajat avatar Dec 14 '25 08:12 parasharrajat

@parasharrajat The use without username is shown as Hidden now. When editing the comment, mentions (both with and without a username) are not highlighted now.

https://github.com/user-attachments/assets/d9e92b43-355d-4c13-b817-20aaac05f04c

jponikarchuk avatar Dec 16 '25 09:12 jponikarchuk

@jponikarchuk Do you have updated steps to reproduce this issue?

parasharrajat avatar Dec 17 '25 08:12 parasharrajat

@parasharrajat We have no way to check this issue now

jponikarchuk avatar Dec 17 '25 13:12 jponikarchuk