-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix gray placeholder shown for markdown images with invalid URLs #50918
fix gray placeholder shown for markdown images with invalid URLs #50918
Conversation
@dannymcclain , @Expensify/design, Could you please provide me with the correct icon color and background color for the placeholder and modal? Alternatively, could you share the design for that case so I can update it accordingly? Thank you! |
Ok hopefully this will be helpful: I think the placeholder background needs to be |
@dannymcclain , @Expensify/design, I have finished updating the icon and background colors for online and offline modes, following this comment. Could you please review it and let me know if you have any questions? |
@huult looks good from what I'm seeing in the updated screenshots in the original comment 👍 |
Looking good! Do we need the border around the placeholder box? Have we always had that or was that recently introduced? Also, ideally the text underneath But that might need to be changed elsewhere/globally so if that's the case we don't need to worry about it here. |
I'm guessing the border around the placeholder is just the same standard border we use for all image attachments? I could be wrong though. And we might not even need it as you are suggesting, maybe we kill it. No strong feelings from me really. |
@dannymcclain as @shawnborton answered, do we need to make any more changes? |
Ah if it's standard for all images then no I think we can keep it. I don't feel too strongly about it so I think it's fine if it's already part of the "normal" image styles. |
Thanks, @dannymcclain . I will not make any more changes to my pull request, so @suneox , could you please review it? If you have any questions, let me know. Thanks! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-10-20.at.23.42.31.mp4Android: mWeb ChromeScreen.Recording.2024-10-20.at.23.41.06.mp4iOS: NativeScreen.Recording.2024-10-20.at.23.40.15.mp4iOS: mWeb SafariScreen.Recording.2024-10-20.at.23.39.13.mp4MacOS: Chrome / SafariScreen.Recording.2024-10-20.at.23.27.03.mp4MacOS: DesktopScreen.Recording.2024-10-20.at.23.36.20.mp4Warning: Warning: Warning: |
@huult Could you please also handle the case when opening from the attachment list? It still shows infinite loading instead of displaying a broken image. Screen.Recording.2024-10-19.at.14.24.19.mp4 |
@@ -63,7 +65,11 @@ function ImageRenderer({tnode}: ImageRendererProps) { | |||
const imagePreviewModalDisabled = htmlAttribs['data-expensify-preview-modal-disabled'] === 'true'; | |||
|
|||
const fileType = FileUtils.getFileType(attachmentSourceAttribute); | |||
const fallbackIcon = fileType === CONST.ATTACHMENT_FILE_TYPE.FILE ? Expensicons.Document : Expensicons.Gallery; | |||
const fallbackIcon = fileType === CONST.ATTACHMENT_FILE_TYPE.FILE ? Expensicons.Document : Expensicons.GalleryNotFound; | |||
const [hasLoadFailed, setHasLoadFailed] = useState(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any specific reason why we are setting failed
as the default?
const [hasLoadFailed, setHasLoadFailed] = useState(true); | |
const [hasLoadFailed, setHasLoadFailed] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@suneox I set the default value of hasLoadFailed
to true to handle the bug that occurs if the user clicks on the image too quickly.
src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx
Outdated
Show resolved
Hide resolved
…der-displayed-markdown-image-wrong-url
@suneox The issue you mentioned has been addressed in another ticket. Here is the pull request that resolves it. Therefore, I believe we don't need to address this issue here |
Excellent! |
@MarioExpensify looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Reviewer checklist WAS filled in, not sure what happened here @suneox. Dismissing Emergency label. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
I think it’s related to the pipeline rule not being triggered after approve the PR. |
🚀 Deployed to staging by https://github.com/MarioExpensify in version: 9.0.52-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.52-5 🚀
|
Details
Fixed Issues
$ #49992
PROPOSAL: #49992 (comment)
Tests
![test](https://picsum.photedos/id/1067/200/300)
.Offline tests
QA Steps
![test](https://picsum.photedos/id/1067/200/300)
.PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-10-17.at.12.33.19.mp4
Android: mWeb Chrome
Screen.Recording.2024-10-17.at.12.35.39.mp4
iOS: Native
Screen.Recording.2024-10-17.at.12.27.21.mp4
iOS: mWeb Safari
Screen.Recording.2024-10-17.at.12.28.42.mp4
MacOS: Chrome / Safari
Screen.Recording.2024-10-17.at.12.19.37.mp4
MacOS: Desktop
Screen.Recording.2024-10-17.at.12.21.41.mp4