fix: Category toggle visually switches while scrolling#83050
fix: Category toggle visually switches while scrolling#83050Beamanator merged 10 commits intoExpensify:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78ad34ea1e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| disabledAction?.(); | ||
| return; | ||
| } | ||
| hasUserToggled.current = true; |
There was a problem hiding this comment.
Reset user-toggle flag when toggle is rejected
hasUserToggled.current is set before onToggle runs, but it is only cleared later when isOn actually changes in useLayoutEffect. In flows where onToggle intentionally exits without changing state (for example, category toggles that show a modal and return when trying to disable the last enabled category), this flag stays true and the next recycled isOn prop change is misclassified as a user action, so the switch animates during scroll again. This reintroduces the visual glitch the commit is trying to prevent.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This indeed might cause regression. Can you check?
Example case:
Screen.Recording.2026-02-22.at.11.22.54.PM.mov
There was a problem hiding this comment.
@situchan I updated. Please help to check again. Thanks!
JmillsExpensify
left a comment
There was a problem hiding this comment.
Product behavior looks good in this PR.
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.mov |
|
@paulnjs can you check this? Screen.Recording.2026-02-23.at.9.18.17.PM.movRepro step:
|
|
I'm checking the bug |
|
@situchan Could you check again on your side? I'm unable to reproduce it. I toggle off the category as fast as I can and also checked in other platforms Screen.Recording.2026-02-25.at.17.10.50.mov |
I reproduced on main as well but no animation is just the different behavior. I think this is not blocker. |
|
Looks great other than that tiny comment ^ 🙏 |
|
🚧 @Beamanator has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/Beamanator in version: 9.3.26-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.3.26-8 🚀
|
Explanation of Change
Fixed Issues
$#79863
PROPOSAL:#79863 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
android.mov
Android: mWeb Chrome
android_ch.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios_sfr.mov
MacOS: Chrome / Safari
chorme.mov