Fix flickering lock icon on Consolidated Travel Billing toggle#95047
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
rlinoz
left a comment
There was a problem hiding this comment.
Thanks! I really thought that we were gonna need a backend fix here, glad it is a small change.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 blimpich has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.4.27-1 🚀
|
|
🤖 Help site review: no changes required. This PR is a UI-only bug fix — the Consolidated Travel Billing toggle showed a lock icon that flickered off on load. The fix keeps The underlying rule this fix visually reflects is already documented correctly in Enable-Consolidated-Travel-Billing-in-a-Workspace.md:
Since the help site already describes the "can't disable until the balance is paid" behavior, no article changes are needed and no draft docs PR was created. @allgandalf, please confirm you agree no help site update is required here. If you'd like the lock/outstanding-balance behavior called out more explicitly in the article, let me know and I'll open a draft PR. |
Explanation of Change
The Consolidated Travel Billing toggle showed a lock on load that then flickered off. The lock on mount comes from the toggle being
disabledwhileopenPolicyTravelPageis loading, and once the fetch finishesshowLockIcondropped it because it only checkedcanWriteMoreFeaturesand the waitlist, not the outstanding balance.handleTogglealready blocks disabling when there is an unpaid balance, so the lock should stay to reflect that.Added
hasOutstandingTravelBalance(travelSettings)toshowLockIconso the lock stays while there is an outstanding balance, same shape the other workspace toggles use (e.g. tagsshowLockIcon={!canWriteTags || shouldPreventDisableOrDelete}). The toggle stays interactive (notdisabled) so tapping it still opens the outstanding balance modal, same as before.Fixed Issues
$ #94909
PROPOSAL:
Tests
Pay balancebutton shows).Offline tests
The lock is derived from the Travel Invoicing card settings already in Onyx, so it renders the same offline. Tapping the toggle while a balance is outstanding shows the outstanding balance modal offline too.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screen.Recording.2026-07-01.at.6.06.49.PM.mov