Add animation for switch children#55478
Conversation
| prevPendingFields?.[key] !== policy?.pendingFields?.[key] || isOffline || !policy?.pendingFields?.[key] ? isFeatureEnabled : currentFeatureStates[key]; | ||
| }); | ||
|
|
||
| setHighlightedFeature(Object.keys(newFeatureStates).at(0) ?? ''); |
There was a problem hiding this comment.
NAB: instead of empty string we could use undefined.
|
@dubielzyk-expensify @thesahindia 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] |
|
Same thing as we discussed in this draft PR but the padding is off here on the Android recording: The workflow animations looks pretty great 😄 Also MacOS Desktop, iOS mWeb, and Android mWeb videos didn't upload or display properly. |
here are not these changes for accounting tabs, they will be in a separaten PR, I added the wrong recording. It is already corrected |
|
@thesahindia What is your eta for this review? @sumo-slonik could you please highligh in the diff the changes made to fix the issue found in staging? thanks! |
Ahh all good then. It looks good to me on the workflow page 👍 |
if you want to see what the other tabs will look like you can check PR: |
|
There's an issue in navigation.
Screen.Recording.2025-01-22.at.4.54.31.PM.mov |
|
Currently, there's a sliding animation when a newly enabled feature appears in the list. Are we okay with just highlighting the new feature instead? Current behaviour: Screen.Recording.2025-01-22.at.5.20.33.PM.movNew behaviour: Screen.Recording.2025-01-22.at.5.19.14.PM.mov |
This also occurs on https://new.expensify.com, so I think it's not due to this PR |
| const [featureStates, setFeatureStates] = useState(policyFeatureStates); | ||
| const [highlightedFeature, setHighlightedFeature] = useState<string | undefined>(undefined); | ||
|
|
||
| const workspaceMenuItems: WorkspaceMenuItem[] = useMemo(() => { |
There was a problem hiding this comment.
@sumo-slonik could you please highligh in the diff the changes made to fix the issue found in staging? thanks!
The addition of mnemonization here eliminates the problem that caused unnecessary rerendering and caused the flag responsible for highlighting to be removed.
|
🚧 @mountiny has triggered a test hybrid app build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
@mountiny this looks weird, ad hoc builds are failing with a surprising error: |
|
@sumo-slonik thanks! Can you please fix the lint? @thesahindia please feel free to review and test even with the failing action. Thanks |
|
Hi, it seems to me that this is a rather large PR and in the changes I added there is already a risk of regression, I would prefer to avoid correcting imports not related to my PR in order not to increase this risk unnecessarily. What do you think about this @mountiny ? |
| } | ||
|
|
||
| function goBackWhenEnableFeature(policyID: string) { | ||
| setTimeout(() => { |
There was a problem hiding this comment.
I'm a bit concerned about using setTimeout, we try to avoid it unless absolutely necessary.
cc: @mountiny
There was a problem hiding this comment.
is exactly the same solution as it was before in the navigate function:
function navigateWhenEnableFeature(policyID: string) {
setTimeout(() => {
Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policyID));
}, CONST.WORKSPACE_ENABLE_FEATURE_REDIRECT_DELAY);
}
which we replacing here
There was a problem hiding this comment.
Ah, my bad. Let's not make any changes here then.
|
This one needs to be updated as well. App/src/libs/actions/Policy/Tag.ts Line 695 in b59f23b Please remove the function as well. Line 1066 in b59f23b |
|
@sumo-slonik sounds fine, if all the lint issues are about the import rule then dont worry about it |
…itch_childreans # Conflicts: # src/pages/workspace/WorkspaceInitialPage.tsx
|
I've already resolved the conflict but I'm checking if it still works on all platforms after attaching the master |
|
@thesahindia |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeScreen.Recording.2025-01-29.at.5.50.00.PM.moviOS: NativeScreen.Recording.2025-01-25.at.9.54.21.PM.moviOS: mWeb SafariScreen.Recording.2025-01-25.at.10.12.42.PM.movMacOS: Chrome / SafariScreen.Recording.2025-01-25.at.10.14.39.PM.movMacOS: DesktopScreen.Recording.2025-01-25.at.10.17.30.PM.mov |
mountiny
left a comment
There was a problem hiding this comment.
The PR is large enough already so we decided not ot fix all the libs import lint errors.
|
@mountiny looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
Explained above |
|
✋ 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/mountiny in version: 9.0.92-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.92-6 🚀
|
| 'payload' in action && | ||
| action.payload && | ||
| 'name' in action.payload && | ||
| (isSideModalNavigator(action.payload.name) || action.payload.name === NAVIGATORS.FULL_SCREEN_NAVIGATOR) |
There was a problem hiding this comment.
Looks like this line was missing 1 extra check which led to the causation of this issue:
| protectedMenuItems.push({ | ||
| translationKey: 'common.perDiem', | ||
| icon: CalendarSolid, | ||
| action: singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_PER_DIEM.getRoute(policyID)))), | ||
| routeName: SCREENS.WORKSPACE.PER_DIEM, | ||
| }); |
There was a problem hiding this comment.
there was a regression, we did not added highlighted prop which caused #56149



Explanation of Change
These PR add animations of the appearance and disappearance of elements after the switch using reanimated.
Fixed Issues
$ #53759
Fixed also reason to reverse previous revert:
$ #55451
PROPOSAL:
Tests
Offline tests
Offline tests are not needed.
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2025-01-21.at.12.12.57.mp4
Android: mWeb Chrome
Screen.Recording.2025-01-21.at.12.38.23.mp4
iOS: Native
Screen.Recording.2025-01-20.at.16.07.39.mp4
iOS: mWeb Safari
Screen.Recording.2025-01-20.at.16.13.57.mp4
MacOS: Chrome / Safari
Screen.Recording.2025-01-20.at.16.17.23.mp4
MacOS: Desktop
Screen.Recording.2025-01-20.at.16.40.29.mp4