Fix participant picker flashing on Create expense when Submissions are disabled#96561
Draft
MelvinBot wants to merge 1 commit into
Draft
Fix participant picker flashing on Create expense when Submissions are disabled#96561MelvinBot wants to merge 1 commit into
MelvinBot wants to merge 1 commit into
Conversation
…sabled Co-authored-by: thelullabyy <thelullabyy@users.noreply.github.com>
7 tasks
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Fixes the deploy blocker where the participant (recipient) list briefly appears and then disappears when opening FAB → Create expense on a workspace with Submissions disabled.
Root cause: After PR #96228 removed the
NEW_MANUAL_EXPENSE_FLOWbeta and made the embedded-confirmation + auto-opening participant picker the default, the auto-open decision (shouldAutoOpenParticipantPicker) is derived purely from whetherdefaultParticipantsis currently populated — it has no "still loading" state. On the first render(s) the Onyx sources that resolve the default destination haven't hydrated yet, sodefaultParticipantsis momentarily empty and the picker auto-opens. A beat later the default resolves (via the self‑DM branch when auto‑reporting/Submissions is off — seeuseDefaultParticipants.ts), the auto‑assign effect fires and the picker closes — the visible flash. It only reproduces with Submissions disabled because the self‑DM branch settles a render or two behind the policy‑expense‑chat branch used when Submissions are enabled.Fix:
useDefaultParticipantsnow also reports whether the Onyx data backing the resolution is still hydrating (isLoading), computed from the load status of the collections/keys the resolution reads (POLICY, REPORT, and the billing NVPs). All the lagging sub-hooks (useDefaultExpensePolicy,useSelfDMReport) andgetPolicyExpenseChatderive from those same POLICY/REPORT collections, soisLoadingstaystrueprecisely during the hydration window.IOURequestStepConfirmationnow keepsshouldAutoOpenParticipantPickerfalsewhileisLoadingis true, so an "empty because not resolved yet" state no longer flashes the picker. Once the data settles, a genuinely empty default still opens the picker as before. The status-only collection subscriptions use a constant selector so they don't add value-driven re-renders.Fixed Issues
$ #96558
PROPOSAL:
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review". Suggested: 1) Create a workspace and disable Submissions in Workflows. 2) Open FAB → Create expense. 3) Verify the participant list does NOT appear (no flash). 4) Regression: with Submissions enabled and from a workspace chat, verify create expense still works; verify the picker still auto-opens when there is genuinely no default participant.
Offline tests
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari