-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[$500] Background image crop after resize #29237
Comments
Triggered auto assignment to @trjExpensify ( |
Job added to Upwork: https://www.upwork.com/jobs/~015433ddd90da9816b |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
Proposal by @namhihi237Please re-state the problem that we are trying to solve in this issue.The background image is not partially cropped after resizing the screen What is the root cause of that problem?When opening RHN and resizing the screen background image, the part that RHN occupies will be lost here What changes do you think we should make in order to solve the problem?we use a state variable forceRender to trigger a re-render of the component when the screen is focused. const [forceRender, setForceRender] = useState(0);
const isFocused = useIsFocused();
useEffect(() => {
if (!isFocused) {
return;
}
setForceRender((prev) => prev + 1);
}, [isFocused]); We add key <Animated.Image
key={forceRender} What alternative solutions did you explore? (Optional) |
@namhihi237 Can you elaborate more on the root cause? |
ProposalPlease re-state the problem that we are trying to solve in this issue.The background image is partially cropped after resizing the screen at the point when What is the root cause of that problem? App/src/pages/home/report/AnimatedEmptyStateBackground.js Lines 20 to 35 in 1998fa3
What changes do you think we should make in order to solve the problem?
if (!isSmallScreenWidth) {
- return {};
+ return {transform: [{translateX: withSpring(0)}, {translateY: withSpring(0)}]};
} POCI have fixed this issue. Please view the POC video 2023-10-11.06-58-35.mp4Root cause demo using Devtools
before.mp4
after.mp4 |
ProposalPlease re-state the problem that we are trying to solve in this issue.The background image is partially cropped when resizing. What is the root cause of that problem?We don't need the animated style for case What changes do you think we should make in order to solve the problem?We don't need animated style for We can add here:
And replace this with What alternative solutions did you explore? (Optional)We can update this line to
or
to force it to transform to 0, but I prefer the main suggested approach since it also optimizes performance. |
@trjExpensify This bug seems to be fixed by #26078 , not reproduced on staging. |
@trjExpensify, @fedirjh Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Ah yeah, same. I can't repro it anymore since that got deployed. We can close this issue out then! :) |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.3.80-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @namhihi237
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696951102341389
Action Performed:
Expected Result:
The background image is not partially cropped
Actual Result:
The background image is partially cropped
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2023-10-10.at.22.19.47.1.mov
Background.mp4
MacOS: Desktop
Screen.Recording.2023-10-10.at.22.18.59.mov
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: