Skip to content

[Due for payment 2026-03-24] [$250] Workspace - Mentions are not highlighted in workspace description #54941

Closed

Description

@IuliiaHerets

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: V9. 0.82-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
Issue reported by: Applause Internal Team
Device used: Redmi note 10s android 13
App Component: Workspace Settings

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Tap settings -- workspace settings
  3. Tap workspace profile - description
  4. Clear the description and enter #765
  5. Save the description
  6. Open the description

Expected Result:

Mentions must be highlighted in workspace description.

Actual Result:

Mentions are not highlighted in workspace description but highlighted in preview.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6708769_1736311952951.Screenrecorder-2025-01-08-10-16-51-773.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021877698306462649748
  • Upwork Job ID: 1877698306462649748
  • Last Price Increase: 2025-01-24
  • Automatic offers:
    • truph01 | Contributor | 105879695
Issue OwnerCurrent Issue Owner: @mallenexpensify
Issue OwnerCurrent Issue Owner: @getusha

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 8, 2025
  2. melvin-bot commented on Jan 8, 2025

    @melvin-bot

    Triggered auto assignment to @zanyrenney (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.

  3. truph01 commented on Jan 8, 2025

    @truph01
    Contributor

    Edited by proposal-police: This proposal was edited at 2025-01-08 09:29:11 UTC.

    Proposal

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

    • Mentions are not highlighted in workspace description but highlighted in preview.

    What is the root cause of that problem?

    • In here:

    <MenuItemWithTopDescription

    we didn't wrap the MenuItemWithTopDescription inside the <MentionReportContext.Provider value={mentionReportContextValue}> so the mention room are not highlighted.

    • Also, when user saves the room description as #room-1, BE does not return the correct description like <mention-report reportID={...}>#room-1</mention-report>.

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

    • In context, introduce a new variable policyID?: string.

    • In here, update the isGroupPolicyReport:

        const isGroupPolicyReport = useMemo(
            () => policyID ?? (currentReport && !isEmptyObject(currentReport) && !!currentReport.policyID && currentReport.policyID !== CONST.POLICY.ID_FAKE),
            [currentReport, policyID],
        );
    
    • Then, introduce an additional param policyID in:

    const getMentionDetails = (htmlAttributeReportID: string, currentReport: OnyxEntry<Report>, reports: OnyxCollection<Report>, tnode: TText | TPhrasing) => {

    and use it in:

    if (report?.policyID === currentReport?.policyID && removeLeadingLTRAndHash(report?.reportName ?? '') === mentionDisplayText) {

                if (report?.policyID === (currentReport?.policyID ?? policyID) && removeLeadingLTRAndHash(report?.reportName ?? '') === mentionDisplayText) {
                    reportID = report?.reportID;
                }
    
    • Then we pass a policyID when calling function in:

    const mentionDetails = getMentionDetails(htmlAttributeReportID, currentReport, reports, tnode);

    • Then, we need to wrap the MenuItemWithTopDescription inside the <MentionReportContext.Provider value={mentionReportContextValue}> with const mentionReportContextValue = useMemo(() => ({policyID: policy.id, exactlyMatch: true}), [policy]); so the room will be highlighted if it exists. The exactlyMatch: true is optional.

    • Then, update:

    const parsedDescription = ReportUtils.getParsedComment(description);

    to:

        const parsedDescription = ReportUtils.getParsedComment(description, {policyID});
    
    • Finally, BE need to return the correct mention-report message with the proper reportID.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    What alternative solutions did you explore? (Optional)

    • We can add excludedMarkdownRules={['reportMentions']} to this place so the the text will never been highlighted.
  4. zanyrenney commented on Jan 10, 2025

    @zanyrenney
    Contributor

    adding external

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 10, 2025
  6. melvin-bot commented on Jan 10, 2025

    @melvin-bot
  7. changed the title [-]Workspace - Mentions are not highlighted in workspace description[/-] [+][$250] Workspace - Mentions are not highlighted in workspace description[/+] on Jan 10, 2025
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 10, 2025
  9. melvin-bot commented on Jan 10, 2025

    @melvin-bot

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

  10. 122 remaining items

  11. melvin-bot commented on Mar 17, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  12. mallenexpensify commented on Mar 24, 2026

    @mallenexpensify
    Contributor

    @eh2077 @truph01 👀 and feedback please.

    Deploy Blocker #85363 was identified to be related to this PR.

  13. eh2077 commented on Mar 27, 2026

    @eh2077
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: NA. I believe this is a new feature.

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: NA

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue: https://github.com/Expensify/Expensify/issues/617280

    Regression Test Proposal

    Precondition:

    Test:

    Test 1:

    1. Go to ND.
    2. Tap settings -- workspace settings.
    3. Tap workspace profile - description.
    4. Clear the description and enter #test-new-room.
    5. Save the description.
    6. Verify the #test-new-room is highlighted in workspace description.

    Test 2:

    1. WS A has a room, #room-ws-a
    2. Add #room-ws-a to the description of WS A
    3. The room mention is highlighted and clickable
    4. Add #room-ws-a to the description of WS B
    5. Verify: The room mention is neither highlighted nor clickable.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-a112-a3de-3310-63125ce86824
  14. eh2077 commented on Mar 27, 2026

    @eh2077
    Contributor

    @eh2077 @truph01 👀 and feedback please.

    Deploy Blocker #85363 was identified to be related to this PR.

    @mallenexpensify yes, there was a regression, it was fixed and hit production on May 18, so this is ready for payment, thanks 🙇

  15. mallenexpensify commented on Mar 27, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @truph01 due $125 via NewDot
    Contributor+: @eh2077 due $125 via NewDot

    ^ Test case created

    Thx!

  16. m-natarajan commented on Mar 27, 2026

    @m-natarajan

    @eh2077 This regarding the Regression test proposal
    Room mention is not highlighted description, Is this a potential issue?

    Recording.2602.mp4
  17. eh2077 commented on Mar 31, 2026

    @eh2077
    Contributor

    @m-natarajan We only highlight room mentions that exist in the same workspace. see tests #54941 (comment)

  18. laurenreidexpensify commented on Apr 27, 2026

    @laurenreidexpensify
    Contributor

    $125 approved for @eh2077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions