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.36k stars 2.79k forks source link

[$250] Search - Room mention in the message is not highlighted or linked when opened from Search #49494

Open IuliiaHerets opened 1 week ago

IuliiaHerets commented 1 week ago

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: 9.0.38-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to a room.
  3. Send a message containing #room mention.
  4. Go to Search.
  5. Go to Chat.
  6. Click on the message sent in Step 3.

Expected Result:

The room mention in the message will be highlighted and linked when opened from Search.

Actual Result:

The room mention in the message is not highlighted or linked when opened from Search.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/3ecc3011-db2d-4952-8058-9b7671a84c39

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021838252249332966020
  • Upwork Job ID: 1838252249332966020
  • Last Price Increase: 2024-09-23
  • Automatic offers:
    • situchan | Reviewer | 104118455
    • nkdengineer | Contributor | 104118456
Issue OwnerCurrent Issue Owner: @mjasikowski
melvin-bot[bot] commented 1 week ago

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

IuliiaHerets commented 1 week ago

We think that this bug might be related to #wave-control

IuliiaHerets commented 1 week ago

@slafortune FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

nkdengineer commented 1 week ago

Proposal

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

The room mention in the message is not highlighted or linked when opened from Search.

What is the root cause of that problem?

Currently, here the values of currentReportIDContext and currentReportID?.currentReportID are both -1 because we are not adding enough Provider and passing the correct reportID in the Search Page, which is why the value of isGroupPolicyReport is false, and we will not show the highlight for that message.

https://github.com/Expensify/App/blob/b0ce2068ee57c252ec47aa1f09319eee8b4f673c/src/components/HTMLEngineProvider/HTMLRenderers/MentionReportRenderer/index.tsx#L63

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

We should add MentionReportContext.Provider for items and pass in the value mentionReportContextValue like we did here with

    const mentionReportContextValue = useMemo(() => ({currentReportID: report.reportID}), [report.reportID]);
  1. We can add this provider to ChatListItem here to highlight text in list all chats

https://github.com/Expensify/App/blob/b0ce2068ee57c252ec47aa1f09319eee8b4f673c/src/components/SelectionList/ChatListItem.tsx#L82

  1. Also add this provider to ReportActionItem here

https://github.com/Expensify/App/blob/b0ce2068ee57c252ec47aa1f09319eee8b4f673c/src/pages/home/report/ReportActionItem.tsx#L905

What alternative solutions did you explore? (Optional)

NA

https://github.com/user-attachments/assets/0c9006bb-6de2-4e27-bdbe-5bc642e6bcfa

melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

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

situchan commented 6 days ago

@nkdengineer's proposal looks good to me. πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

melvin-bot[bot] commented 6 days ago

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

mjasikowski commented 6 days ago

@nkdengineer's proposal looks good, green light to go forward with the PR

nkdengineer commented 5 days ago

@mjasikowski please assign me to this issue so i can open the PR

melvin-bot[bot] commented 5 days ago

πŸ“£ @situchan πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 5 days ago

πŸ“£ @nkdengineer πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–