[$500] Private notes - Hmm its not here page displayed when clicking on thumbnail
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: 1.4.56-0 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause - Internal Team
Issue found when executing PR https://github.com/Expensify/App/pull/37566
Action Performed:
- Navigate to any report
- Click on header > Private notes
- Add markdown image to private notes: holla
- Click on 'Private notes'
- Click on the image
Expected Result:
- Image should be opened in the carousel
- Or, image shouldn’t be rendered in private notes
Actual Result:
- Hmm its not here page is displayed.
- And markdown images are rendered in Private notes
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- [ ] Android: Native
- [ ] Android: mWeb Chrome
- [ ] iOS: Native
- [ ] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/babb6b39-c2f7-4739-a88c-dd90e35844e2
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01c6ef0c33505c63ef
- Upwork Job ID: 1771446597185703936
- Last Price Increase: 2024-03-23
- Automatic offers:
- shubham1206agra | Reviewer | 0
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
Triggered auto assignment to @chiragsalian (Engineering), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
@chiragsalian 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
Don't think this is blocker since markdown image is new feature and still WIP of polish
cc: @kidroca
Yup, I agree too. This does not feel blocker-worthy since it's a new feature. A simple resolution would be to revert the feature here - https://github.com/Expensify/App/pull/37566 but I would prefer if move forward and tidy up this bug.
edge case that I wouldn't consider much of a blocker, but what I would recommend is that it opens an attachment carousel that only includes attachments in the private notes message.
in my opinion the value of inline images way outweighs the downside of this bug, so I wouldn't want to see us revert that because of this
Proposal
Please re-state the problem that we are trying to solve in this issue.
- Private notes - Hmm its not here page displayed when clicking on thumbnail
What is the root cause of that problem?
- We use ImageRenderer to display image
- When clicking on an image to open the attachment modal, onPress is called, it works well with report attachments. But in case of private note, the not here page is displayed because we do not have route for this attachment
What changes do you think we should make in order to solve the problem?
- We need to create a new attachment page to display image for other images that do not belong to report.
- Create a CommonAttachments page:
function CommonAttachments({route}: ReportAttachmentsProps) {
const source = Number(route.params.source) || route.params.source;
const imageSource = tryResolveUrlFromApiRoot(source);
return (
<AttachmentModal
allowDownload
defaultOpen
originalFileName='test-image.jpg'
source={imageSource}
onModalClose={() => {
Navigation.goBack();
}}
/>
);
}
- In here, add:
ATTACHMENTS: 'attachments',
- In here, add:
ATTACHMENTS: {
route: '/attachment',
getRoute: (source: string) => `attachment?source=${encodeURIComponent(source)}` as const
}
- In here, add:
<RootStack.Screen
name={SCREENS.ATTACHMENTS}
options={{
headerShown: false,
presentation: 'transparentModal',
}}
getComponent={loadCommonAttachments}
listeners={modalScreenListeners}
/>
- In here, add:
[SCREENS.ATTACHMENTS]: ROUTES.ATTACHMENTS.route,
- Update this to:
onPress={() => {
if(report?.reportID){
const route = ROUTES.REPORT_ATTACHMENTS.getRoute(report?.reportID ?? '', source);
Navigation.navigate(route);
}
else {
const route = ROUTES.ATTACHMENTS.getRoute(source)
Navigation.navigate(route)
}
}}
What alternative solutions did you explore? (Optional)
- NA
Result
https://github.com/Expensify/App/assets/161821005/cafc5bf4-ee35-4fb8-9d76-135581dabfda
Job added to Upwork: https://www.upwork.com/jobs/~01c6ef0c33505c63ef
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (External)
Triggered auto assignment to @MitchExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
📣 @nkdengineer You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing 📖
Switching to daily as not deemed a blocker
When viewing attachments in a chat, we can easily navigate between them through the attachment modal. However, for notes with multiple images, it seems we have to close and reopen the modal for each image. The presence of both attachments and chat-attachments could lead to confusion. A generic component like the ImageRenderer would require additional logic to differentiate between them, increasing the dependency on specific details. Wouldn't it be more efficient to consolidate them into a single route, either attachments or chat-attachments, and use parameters (source, reportID, noteID) to:
- Display a single image if only
sourceis provided. - Show report attachments and begin from the source when
reportIDis available. - Display note attachments if
noteIDis specified.
This approach could simplify the process and reduce complexity.
@chiragsalian What do you think about this comment?
I agree with @kidroca - it sounds like a good way to DRY things up and simplify.
Just catching up here too and I like @kidroca's suggestion as well.
What I am concerned is that, with other inputs such as task title, task description, ... we can also use image markdown. So what does the route look like?
I am unsure who if anyone uses private notes especially for images which is causing me pause with regards to which wave or VIP this fits under. This seems super low priority to me - Maybe we should we close, what do you think @chiragsalian ?
I think its VIP-vsb right, same as the issue that created this bug - this one. Even if its rare since our product support inline images i feel like we should solve this bug. Because now a user can add an image to notes and if we don't fix this then whenever they click on the image they'll get an error screen. I feel like we should solve this.
I feel like we should build a solution to support clicking markdown images besides for just notes. Like maybe even for an expense description and other spots if needed.
We could discuss in #product if we would prefer to disable clicking images or image markdown anywhere besides on chats. But if we have them then i think allowing them to be clickable might be the better user experience.
@chiragsalian With this suggestion, what will the route look like? Currently, the report attachment has route: r/:reportID/attachment?source={source}
From kidroca suggestion i think the idea is to modify REPORT_ATTACHMENTS (code) into something more generic like ATTACHMENTS.
As for how the route will look. I'm unsure, maybe something like this,
ATTACHMENTS: {
route: 'a/:ID/attachment',
getRoute: (ID: string, source: string, sourceURL: string) => `r/${ID}/attachment?source=${source}&sourceURL=${encodeURIComponent(sourceURL)}` as const,
},
ID could be reportID, noteID, reportActionID (for expense description) source could be 'report', 'note', 'reportActionID' etc so that the attachment component would know what logic to fall into. sourceURL is the image URL
@kidroca, since you are more aware of this can you double-check and lend us your thoughts.
I think its VIP-vsb right, same as the issue that created this bug - https://github.com/Expensify/App/issues/37246.
Good shout! Thanks for the buddy check
We could discuss in #product if we would prefer to disable clicking images or image markdown anywhere besides on chats. But if we have them then i think allowing them to be clickable might be the better user experience.
That sounds like a great next step to me! Are you planning to post or should I grab?
Can you post and ask @MitchExpensify
I am still waiting for final decision before creating PR
Brought to Slack here, will report back https://expensify.slack.com/archives/C066HJM2CAZ/p1711833001511819
Would expense comments with markdown images break exports @chiragsalian ?
So hold on this is what you are thinking @chiragsalian ? HIGH: [Polish] Add support for image-only (no alt text) inline image Markdown