-
Notifications
You must be signed in to change notification settings - Fork 3k
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 freezes when previewing a large PDF file #22760
Fix freezes when previewing a large PDF file #22760
Conversation
…/19918-preview-large-pdf
…/19918-preview-large-pdf
…/19918-preview-large-pdf
Tested locally and works well! |
@0xmiroslav 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] |
…/19918-preview-large-pdf
@0xmiroslav, just a friendly reminder to review the PR 🙂 |
reviewing today |
@0xmiroslav any feedback? |
Tests step is missing |
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.
Scroll position is not correct
Screen.Recording.2023-07-25.at.6.28.32.AM.mov
@0xmiroslav, just to clarify: do you mean the scroll bar position itself or cursor inside? |
@rezkiy37 my video shows diff between this branch and staging |
Ideally, our fix shouldn't affect design (scrollbar position, pdf container position, etc) |
Definitely, let me try to fix it. |
…/19918-preview-large-pdf
There's minor difference but I think this is not blocker Screen.Recording.2023-08-04.at.12.30.00.PM.mov |
Page refreshes when switch to another tab and come back. This doesn't happen on staging. I think this can be bug and should be fixed here. Screen.Recording.2023-08-04.at.12.28.47.PM.mov |
@rezkiy37 can you please add Tests step with sample large PDF? Sure, my bad. I will add it asap. |
Such kind of small diffs could be. The current PDF previewer does not take into accounts page borders. So, this PR calculates everything properly. |
@rezkiy37 can you please add Tests step with sample large PDF? Done! |
…/19918-preview-large-pdf
@situchan, I've tried to reproduce it. Yes, it is reproducible, but not always. Moreover, it happens on the staging as well (an example starts from the 32nd second of the video). Also, this re-fresh happens on other websites where no pdf at all. I would say that IOS Safari tries to save memory this way and "unmounts" websites. IOS.Safari.shifts.mp4 |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSios.movAndroidandroid.mov |
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.
Looks good, tests well.
Just minor feedback
Also, the branch conflicts |
…/19918-preview-large-pdf
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.
@situchan, just to clarify: who is going to merge this PR? Since, it is approved, we can move forward. |
@puneetlath will do final review & merge |
Congrats, that’s your 5th PR merged! 🎉 Do you know about the ContributorPlus role? It’s an opportunity to earn more in the Expensify Open Source community. Keep up the great work - thanks! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.3.52-0 🚀
|
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.3.52-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.52-5 🚀
|
Details
Improved pdf files previewing for the Web and Desktop applications. It allows to render properly any size of pdf files. The next changes do not affect on IOS or Android.
Fixed Issues
$ #19918
PROPOSAL: #19918 (comment)
Tests
Offline tests
N/A
QA Steps
Same as "Tests"
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
MacOS.Safari.mp4
MacOS.Chrome.mp4
Mobile Web - Chrome
Android.Chrome.mp4
IOS.Chrome.mp4
Mobile Web - Safari
IOS.Safari.mp4
Desktop
Desktop.mp4
iOS
IOS.mp4
Android
Android.mp4