-
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
Pare back the parallax animation on empty chats #35232
Pare back the parallax animation on empty chats #35232
Conversation
src/libs/Accessibility/index.ts
Outdated
@@ -18,6 +18,15 @@ const useScreenReaderStatus = (): boolean => { | |||
return isScreenReaderEnabled; | |||
}; | |||
|
|||
const useReduceMotionStatus = (): boolean => { | |||
const [isScreenReaderEnabled, setIsScreenReaderEnabled] = useState(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.
const [isScreenReaderEnabled, setIsScreenReaderEnabled] = useState(false); | |
const [isReduceMotionEnabled, setIsReduceMotionEnabled] = useState(false); |
src/libs/Accessibility/index.ts
Outdated
const useReduceMotionStatus = (): boolean => { | ||
const [isScreenReaderEnabled, setIsScreenReaderEnabled] = useState(false); | ||
useEffect(() => { | ||
AccessibilityInfo.isReduceMotionEnabled().then((enabled) => setIsScreenReaderEnabled(enabled)); | ||
}, []); | ||
|
||
return isScreenReaderEnabled; | ||
}; |
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 use useReducedMotion
from Reanimated instead (see docs here).
Pros:
- It is synchronous (no need for additional render when promise is resolved and
false
changes totrue
)
Cons:
- it's not reactive (yet), meaning the setting state is read only once and you need to reset the app after you change the setting; however we plan to address it in the future
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 for applying code review suggestions. Looks good to me!
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, but let's get some feedback from @Expensify/design
This comment has been minimized.
This comment has been minimized.
src/CONST.ts
Outdated
@@ -46,6 +46,8 @@ const CONST = { | |||
IN: 'in', | |||
OUT: 'out', | |||
}, | |||
// Multiplier for gyroscope animation in order to make it a bit more subtle | |||
ANIMATION_GYROSCOPE_VALUE: 0.65, |
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.
What was the previous value? Just 1?
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.
Yes, it's a multiplier value I have just added, therefore previously it was 1 😄
Hey @shawnborton, thanks for the feedback! The low position of the image for task reports was apparently a small bug, I have just fixed it. In other cases it should work just fine 😄 As per the gyroscope value, I have just lowered it to 0.4, so we can run another build. |
Cool, will trigger a new build now |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Nice, this feels great to me! I'm good with merging this. cc @Expensify/design in case you have feedback too |
Hi, if needed, can we request another c+? I'm still busy with other issues. 😂 |
I am interested in reviewing 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.
LGTM, thanks @staszekscp!
Can you look into the failing jest test? Is it possible it was introduce here or is it unrelated / flaky?
@staszekscp please pull main. If unit tests still failing after that, caused by this PR for sure, as not happening on main. |
Tried it out on Android and it looks good to me as well! |
Could you add screenshots/videos per each platform? |
); | ||
} | ||
return ( | ||
<> | ||
<View style={[StyleUtils.getReportWelcomeContainerStyle(props.isSmallScreenWidth, 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.
The meaning of 2nd param is isMoneyReport
. Why is set to true here? (this is task report)
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.
I wanted to reuse the function in order to increase the topMargin
. The task report requires it in order to move the background screen a bit higher. I can rename it to be eg. MONEY_OR_TASK_REPORT
, if you wish
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 let's rename then
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 :)
I have added screenshots/videos to the template (screenshots for platforms that don't have animation on production) |
3f0a19f
to
7e6042d
Compare
performance test failing. please merge main |
Code looks good. Testing |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
well, that's weird edit: it's not directly related. |
Running a fresh build, let's see if it works this time: https://github.com/Expensify/App/actions/runs/7763478577 |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Hello! I've just merged main, so I hope we're good to go 🤞 |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.mp4Android: mWeb Chromeandroid.mp4iOS: Nativetrim.D885E55C-6BB1-4DCA-8351-1E9F66183AC4.MOViOS: mWeb Safarin/a MacOS: Chrome / Safarin/a MacOS: Desktopn/a |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 1.4.36-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
1 similar comment
🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 1.4.36-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
@roryabraham sorry, this was not ready yet to merge. (I haven't approved yet) |
@@ -627,7 +627,7 @@ function ReportActionItem(props) { | |||
if (ReportUtils.isTaskReport(props.report)) { | |||
if (ReportUtils.isCanceledTaskReport(props.report, parentReportAction)) { | |||
return ( | |||
<> | |||
<View style={[StyleUtils.getReportWelcomeContainerStyle(props.isSmallScreenWidth, 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.
ok, so I think above regression can be handled in #33922 since it's minor style issue. |
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.37-7 🚀
|
@roryabraham
Details
The PR limits limits the empty chat background gyroscope animation. It also adds a simple logic to disable the animation entirely if a user has the
Reduced Motion
set in system settings.The PR will be tested subjectively, and may be further adjusted, therefore I won't add any videos for now. It is supposed to be tested on an Ad-Hoc build.
Fixed Issues
$ #35172
PROPOSAL: #35172
Tests
Remove Animations/Reduce Motion
setting on your phoneOffline tests
QA Steps
Remove Animations/Reduce Motion
setting on your phonePR 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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label 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
rn_image_picker_lib_temp_b1714663-8e14-4385-a20a-5a2afb4c5b41-2024-01-31.10_09_48.201.mp4
Android: mWeb Chrome
rn_image_picker_lib_temp_d58bc9b0-03ef-4a2e-97ea-74c591a847ec-2024-01-31.10_09_27.946.mp4
iOS: Native
RPReplay_Final1706694977-2024-01-31.10_09_13.474.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop