-
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 zoom and slide on native for PDFView #17647
Conversation
@luacmartins @0xmiroslav One of you needs to 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] |
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.
Left a small 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.
It's a good idea to move onPress event from renderCell
to renderItem
but unfortunately it causes regression of prev/next arrow buttons visibility not changing when tap in these cases:
- while loading pdf
- on password protected pdf
- on image
Co-authored-by: Miroslav Stevanovic <[email protected]>
@alexxxwork let's add one more step: |
Co-authored-by: Miroslav Stevanovic <[email protected]>
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.mp4Mobile Web - Safarimsafari.movDesktopdesktop.moviOSios.movAndroidandroid.mp4 |
@alexxxwork just one last change requested - #17647 (comment) |
@luacmartins Changes pushed. |
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.
@alexxxwork Please apply my suggested changes. We don't need hand cursor at all on non-touchable devices.
Co-authored-by: Miroslav Stevanovic <[email protected]>
Co-authored-by: Miroslav Stevanovic <[email protected]>
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.
Latest version looks good.
Tested all possible cases.
There's dedicated issue #17720 for image zoomed case.
There are some known bugs below but they already happen on main
so out of scope. I will report them in slack soon.
- weird behavior on clicking left/right arrow on mChrome, similar to [HOLD for payment 2023-06-29] [$1000] mWeb - Attachment - Modify the carousel component to improve swiping navigation between attachments #17723 (comment)
- resizing window on web hides Send button on attachment preview
- scroll bar not fully covers image when zoomed
- app freezes when click android device back button on mChrome
All yours @luacmartins
@luacmartins job2 seems running forever. can you please stop and re-trigger it? |
✋ 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/luacmartins in version: 1.3.5-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.5-6 🚀
|
/> | ||
); | ||
return ( | ||
props.onPress ? ( | ||
<Pressable onPress={props.onPress} disabled={loadComplete} style={containerStyles}> |
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.
@alexxxwork do you mind to explain why do we need Pressable
here? In another the words, can we remove the Pressable
here? Thanks.
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.
Sorry, completely missed this mention. If I remember this right, there was a specific case when arrows wouldn't hide/show if you press attachment before PDF loaded. So we use Pressable and disable it on PDF load complete.
cc: @0xmiroslav
Details
The carousel component doesn't swipe with single tap when displaying a PDF. User should be able to switch attachments with swipe and to zoom and pan pdf attachments.
This PR adds a callback to get scale from PDFView component to know if we are in a zoomed state.
Fixed Issues
$ #15988
PROPOSAL: #15988 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
Rec.2023-04-19.13.56.41.mov
Mobile Web - Chrome
Screen_Recording_20230419_141833_Chrome.mp4
Mobile Web - Safari
Screen.Rec.2023-04-19.mp4
Desktop
Rec.2023-04-19.13.49.51.mov
iOS
Rec.2023-04-19.12.58.44.mov
Android
Screen_Recording_20230419_123557_New.Expensify.mp4