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.48k stars 2.84k forks source link

mWweb - Chat - From search page, tapping on image doesn't show image #51161

Open IuliiaHerets opened 3 hours ago

IuliiaHerets commented 3 hours 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: V9. 0.51-1 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Tap on a chat
  3. Pate the text in compose box - test demo imagetest
  4. Send the message
  5. Navigate to LHN
  6. Tap bottom search icon
  7. From the dropdown, navigate to the chat
  8. Tap on the image

Expected Result:

From search page, tapping on image must show image.

Actual Result:

From search page, tapping on image doesn't show image.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/4de7338d-6f69-44b9-812f-cc20654af9a2

View all open jobs on GitHub

melvin-bot[bot] commented 3 hours ago

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.

IuliiaHerets commented 3 hours ago

@stephanieelliott 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

mkzie2 commented 3 hours ago

Proposal

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

From search page, tapping on image doesn't show image.

What is the root cause of that problem?

We don't pass reportID to attachmentContextValue

https://github.com/Expensify/App/blob/44f5c5c9ad416bab2914f77e270319b97afaf156/src/components/SelectionList/ChatListItem.tsx#L43

Then we navigate to the attachment page with reportID as -1. As the result, the image doesn't show https://github.com/Expensify/App/blob/44f5c5c9ad416bab2914f77e270319b97afaf156/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx#L80-L93

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

Pass the reportID to attachmentContextValue

const attachmentContextValue = {type: CONST.ATTACHMENT_TYPE.SEARCH, reportID: item?.reportID ?? '-1'};

https://github.com/Expensify/App/blob/44f5c5c9ad416bab2914f77e270319b97afaf156/src/components/SelectionList/ChatListItem.tsx#L43

What alternative solutions did you explore? (Optional)