-
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 49974 attachment infinite loading #50511
Fix 49974 attachment infinite loading #50511
Conversation
All contributors have signed the CLA ✍️ ✅ |
@chiragsalian Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@hoangzinh Hi, i'm pinging you about the translation process. We need to translate the wording "Attachment not found" in spanish (alone ?). Thx |
Sure, asked for confirmation here https://expensify.slack.com/archives/C01GTK53T8Q/p1729070840273779 |
@Kalydosos I got translation confirmation. They said that we should use "Archivo adjunto no encontrado" instead of "Adjunto no encontrado" |
src/languages/es.ts
Outdated
@@ -1959,6 +1959,7 @@ const translations = { | |||
afterLinkText: 'para verlo.', | |||
formLabel: 'Ver PDF', | |||
}, | |||
attachmentNotFound: 'Adjunto no encontrado' |
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.
attachmentNotFound: 'Adjunto no encontrado' | |
attachmentNotFound: 'Archivo adjunto no encontrado' |
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.
ok, got it. Thx a lot
@Expensify/design will be needed for review |
I have read the CLA Document and I hereby sign the CLA |
recheck |
I have read the CLA Document and I hereby sign the CLA |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-11-05.at.06.42.10.android.movAndroid: mWeb ChromeScreen.Recording.2024-11-05.at.06.39.31.android.chrome.moviOS: NativeScreen.Recording.2024-11-05.at.06.47.48.ios.moviOS: mWeb SafariScreen.Recording.2024-11-05.at.06.49.36.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-11-05.at.06.35.53.web.movMacOS: DesktopScreen.Recording.2024-11-05.at.06.40.22.desktop.mov |
src={fallbackSource} | ||
width={variables.iconSizeSuperLarge} | ||
height={variables.iconSizeSuperLarge} | ||
fill={theme.border} |
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.
Consider making this theme.icons instead
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.
Ok, thx for the feedback
I tried theme.icon but it"s still light as you can see in the pic below
but a theme that seems to match better the "Attachment not found" text in both light and dark modes is theme.iconHovered as you can see in the pic below
What do you think ? also @dannymcclain
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.
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.
Ok @dannymcclain thx for the feedback 👍 , @shawnborton i will update the code if it's ok with you
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.
Yup, Danny is correct!
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.
@shawnborton yes, i have updated the code already. thx for the feedback 👍
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.
Thanks!
Yes that's correct! |
@Kalydosos can you add test steps for "Offline tests" and "QA tests"? Thank you |
Bug 1: App shows "Attachment not found" error instead of an "Offline" message when view images in Offline mode. Screen.Recording.2024-10-21.at.17.57.19.movClick here to view before changesScreen.Recording.2024-10-21.at.17.58.14.mov |
@@ -67,7 +67,7 @@ function ImageRenderer({tnode}: ImageRendererProps) { | |||
|
|||
const fileType = FileUtils.getFileType(attachmentSourceAttribute); | |||
const fallbackIcon = fileType === CONST.ATTACHMENT_FILE_TYPE.FILE ? Expensicons.Document : Expensicons.GalleryNotFound; | |||
const [hasLoadFailed, setHasLoadFailed] = useState(true); | |||
const [, 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.
If hasLoadFailed
won't be used, we can completely remove setHasLoadFailed
too.
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.
@hoangzinh no we cant, it's used in the code, here per example
onLoadFailure={() => setHasLoadFailed(true)} |
We just dont access the variable hasLoadFailed but it used by useState
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.
Just remove them @Kalydosos
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.
@hoangzinh ok i checked, it's done, thx 👍
src/components/ImageView/index.tsx
Outdated
// isLocalToUserDeviceFile means the file is located on the user device, | ||
// not loaded on the server yet (the user is offline when loading this file in fact) | ||
let isLocalToUserDeviceFile = FileUtils.isLocalFile(url); | ||
if (isLocalToUserDeviceFile && typeof url === 'string' && url.startsWith('/chat-attachments')){ |
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.
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.
Done and commited, thx 👍
Found a unrelated console error during testing with video, reported here https://expensify.slack.com/archives/C049HHMV9SM/p1730765319227739 |
@Kalydosos we are nearly done here. Just in case you missed this comment #50511 (comment) |
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.
LGTM. @Kalydosos congrats on your first PR
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.
LGTM! We can get this merged once we have a final review from design
Ooops, @Kalydosos two issues:
|
@MariaHCD issue 2 is fixed, i have commited the change. I'm working on fixing issue 1. Thx for the feedback, 👍 |
Not sure exactly where the latest screenshots/videos are—but I think the styles are all looking good to me. If these two videos are the latest, I think it's looking good. 👍 |
@dannymcclain yes these videos are the lastest, thx for the feedback 👍 |
@MariaHCD i will resign all the commits, which will sign the first one in question but the commits ids will change. I hope this will not break any of the automation of the process as i will have to force push the branch. Any thoughts on that ? |
@hoangzinh any advice also ? I'm about the rebase and force push the branch |
I'm unsure too. @MariaHCD can we just ignore that unsigned commit or we have to fix it |
It seems PR can't be allowed to merge if there is an unverified commit. @MariaHCD what do you think if we:
|
Yes, we can't merge a PR that has an unverified commit.
This seems like the best option because force pushing might change the review history. Let's go with this option 👍🏼 |
@MariaHCD @hoangzinh ok, i will set it up right away. thx for your advices 👍 |
@Kalydosos we can close this PR |
@hoangzinh it's done, thx 👍 |
thank you @hoangzinh for your help |
Note : this PR is completed by PR #52195 to avoid force pushing the branch. This PR keeps the timeline and history for all discussions
Details
Fixed Issues
$ #49974
PROPOSAL: #49974 (comment)
Tests
Offline tests
QA Steps
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
android_native.2.mp4
Android: mWeb Chrome
android_mweb.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
macos_web_safari.mp4
MacOS: Desktop