-
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
#23546 - Wrong Image opens on HT Report in Safari #28441
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
@@ -189,7 +190,7 @@ function AttachmentCarousel({report, reportActions, source, onNavigate, setDownl | |||
bounces={false} | |||
// Scroll only one image at a time no matter how fast the user swipes | |||
disableIntervalMomentum | |||
pagingEnabled | |||
pagingEnabled={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.
can't you just remove it?
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.
@nkuoch done
I have read the CLA Document and I hereby sign the CLA |
You suggested a couple of props to be changed on the proposal #23546 (comment) but I only see a few on the changes. Can you please explain the reason behind this? |
@parasharrajat During testing across all platforms, I discovered that certain properties, such as "bounces" or "maxToRenderPerBatch," slightly altered the current UX. So, I made only the necessary adjustments to maintain the app's existing state. |
recheck |
@nkuoch Sorry, Nathalie, I'm a bit confused. I've already signed the CLA and received confirmation of it. I tried to add a "recheck" comment here. I also verified that this step exists in the workflow (https://github.com/Expensify/App/actions/runs/6348672890/workflow?pr=28441), but it seems the check hasn't been retriggered. |
All good now. @parasharrajat do you mind doing the reviewer checklist? |
Checking it now... |
Screenshots🔲 iOS / native🔲 iOS / Safari🔲 MacOS / DesktopScreen.Recording.2023-10-09.at.7.42.41.PM.mov🔲 MacOS / ChromeScreen.Recording.2023-10-09.at.7.38.08.PM.mov🔲 Android / Chrome🔲 Android / native |
@mikesmnx I found an issue. Notice the image does not snap to the edge. Screen.Recording.2023-10-09.at.8.02.37.PM.mov |
@parasharrajat Checking |
@mikesmnx Any update? |
@parasharrajat I've found another approach to fix the issue and am currently verifying it across all platforms. I believe it will be ready by tomorrow |
Thanks for the update. |
@parasharrajat Updated the code and chose to retain pagingEnabled. Without it, we would have to implement paging manually, which would result in varied behaviors across supported platforms. I've tested this on the iPhone 11, 13 Pro Max, 14 Pro Max (emulator), Mac desktop app, iOS native app, and also on an Android 13 device, it's working as expected. |
Thanks @mikesmnx. Can you please summarize the effect of these changes? |
@parasharrajat I've added contentInset and contentInsetAdjustmentBehavior to achieve more stable behavior (iOS only). Since we don't have any padding, the top, left, bottom, and right are all set to zero (contentInset). The contentInsetAdjustmentBehavior is set to 'automatic' to ensure that content fits within the scroll area. I've switched from snapToInterval to snapToOffsets because the latter is more stable with large lists. I adjusted the windowSize (number of rendered items outside visible area) to 1, which has improved memory usage and the selection of the first item. I also removed maxToRenderPerBatch, as it tends to be unstable with large lists. |
@mikesmnx Can you please merge the main? I will test it afterward. |
@parasharrajat Done |
@nkuoch Can you please run the workflows here? |
done |
Screenshots🔲 iOS / native🔲 iOS / Safari🔲 MacOS / Desktop🔲 MacOS / Chrome🔲 Android / Chrome🔲 Android / native |
I have tried a few times but I couldn't reproduce the issue so I am not able to verify the solution. I will try to get a heavy account and try on that. |
Hope this helps. I just followed the first three steps from the issue with the iPhone (latest iOS/Safari). video5384103322170964912.mp4 |
Sorry for the delay here. I am AFK till weekend. I will get this wrapped up on Monday. |
I still couldn't. @mikesmnx Can you please merge the main? I am asking someone for help. |
@parasharrajat done |
Thanks. |
// Enable scrolling by swiping on mobile (touch) devices only | ||
// disable scroll for desktop/browsers because they add their scrollbars | ||
// Enable scrolling FlatList only when PDF is not in a zoomed state | ||
scrollEnabled={canUseTouchScreen} | ||
ref={scrollRef} | ||
initialScrollIndex={page} | ||
initialNumToRender={3} | ||
windowSize={5} | ||
maxToRenderPerBatch={CONST.MAX_TO_RENDER_PER_BATCH.CAROUSEL} |
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.
why did we remove this?
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.
Recently, the 'maxToRenderPerBatch' was set to use a constant, but we have removed it in this PR
@@ -195,16 +196,17 @@ function AttachmentCarousel({report, reportActions, parentReportActions, source, | |||
disableIntervalMomentum | |||
pagingEnabled | |||
snapToAlignment="start" | |||
snapToInterval={containerWidth} | |||
contentInset={{top: 0, left: 0, bottom: 0, right: 0}} | |||
contentInsetAdjustmentBehavior="automatic" |
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.
Why do we need this? Can you please explain the issue it solves?
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.
Please check my comment here
@@ -195,16 +196,17 @@ function AttachmentCarousel({report, reportActions, parentReportActions, source, | |||
disableIntervalMomentum | |||
pagingEnabled | |||
snapToAlignment="start" | |||
snapToInterval={containerWidth} | |||
contentInset={{top: 0, left: 0, bottom: 0, right: 0}} |
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.
This seems to be default value. Any reason for adding this?
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.
As I recall from my tests on platforms, such as macOS desktop and iOS native, I found that without explicitly setting this value (despite it being the default), the view appeared slightly different (with a 1-2px padding)
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.
Let's add that as a 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.
Done
Bug: This is what happening on iOS Safari for me. Screen.Recording.2023-12-11.at.5.49.32.PM.mov |
There is a warning on Android. tewst.mov |
@mikesmnx bump. |
@parasharrajat I'm not sure I understood correctly. Should I resolve the warning on Android? |
Yes, I noticed that warning on this branch. If this warning is present on main then you don't have to solve it. Also, there is an issue with Safari. |
@mikesmnx Did you get the time to check the warning and issue of Safari? |
@parasharrajat Apologies for the delay—I was on holiday. I will update the pull request by Wednesday or Thursday |
Let's close this PR @mikesmnx |
@parasharrajat done |
Details
Wrong Image opens on HT Report in Safari
Fixed Issues
$ #23546
PROPOSAL: #23546 (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 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
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
chrome.mp4
Mobile Web - Chrome
android-chrome.mp4
Mobile Web - Safari
ios-safari.MP4
Desktop
macos-desk.mp4
iOS
ios-app-emu.mp4
Android
android-native.mp4