[NO QA] Fix Consolidated Travel Billing toggle lock icon flashing while loading - #98800
Conversation
Switch renders the lock icon whenever `disabled` is true, and the toggle's `disabled` included `isLoading`. openPolicyTravelPage pulses cardSettings.isLoading on every page focus, so the lock blinked on and off with each pulse. Drop isLoading from disabled and guard handleToggle directly instead, since pendingAction doesn't block presses on its own.
|
@ChavdaSachin Please 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] |
# Conflicts: # src/pages/workspace/travel/WorkspaceTravelBillingSection.tsx
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 rlinoz 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/rlinoz in version: 9.4.57-0 🚀
|
|
🤖 No help site changes required. I reviewed the changes in this PR against the help site articles under Why: This is a purely visual bug fix. It stops the Consolidated Travel Billing toggle's lock icon from flashing on/off during the What I checked
Since there's no help site PR to link, there's nothing further for you to review on the docs side, @ishpaul777. If you believe any of the above behavior is actually documented incorrectly and should change, reply with the specifics and I'll draft the doc updates. |
|
What account should we use for this PR? We don't have account with outstanding travel balance. let me know if I missed anything First 3 steps passed Recording.3941.mp4 |
|
hmmm the cardtest domain also doesn't have pending balance anymore, thoughts @blimpich ? |
|
Eh lets just say NO QA. Not worth belaboring |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.57-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
The Consolidated Travel Billing toggle flashes a lock icon on the Travel settings page.
Switchrenders the lock wheneverdisabledistrue, regardless of theshowLockIconprop, and the toggle'sdisabledincludedisLoading.openPolicyTravelPagepulsescardSettings.isLoadingtrue then false on every page focus, so the lock blinked on and off with each pulse.Dropped
isLoadingout of the toggle'sdisabledso the lock is only driven by the stable reasons (!canWriteMoreFeatures || isOnWaitlist || hasOutstandingBalance, matching the existingshowLockIcon). Added an earlyif (isLoading) returninhandleToggleso the toggle still can't be flipped mid-request, since that was the only thingdisabledwas doing there (pendingActiondoesn't block presses).Fixed Issues
$ #94909
PROPOSAL:
Tests
Offline tests
The lock is derived from Travel Invoicing card settings already in Onyx, so it renders the same offline. An outstanding balance still shows the lock offline, and a loading pulse never shows one.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.Screenshots/Videos
before
Screen.Recording.2026-08-18.at.2.12.33.AM.mov
After
Screen.Recording.2026-08-18.at.2.12.52.AM.mov