[Submit] Fix details-page submit options and scope draft-workspace name resolution#96136
Draft
abzokhattab wants to merge 2 commits into
Draft
[Submit] Fix details-page submit options and scope draft-workspace name resolution#96136abzokhattab wants to merge 2 commits into
abzokhattab wants to merge 2 commits into
Conversation
Resolve the confirmation "To" name for a freshly created draft workspace (zero-workspace "Submit to my employer") via the policy explicitly passed to getPolicyName instead of broadening the early-bail guard with oldPolicyName, which affected all zero-policy users. The confirmation now forwards the draft policy for the matching participant so the name resolves through the normal path.
The track-expense details page menu still showed the single "Submit to someone" option. Split it into "Submit to a friend" / "Submit to my employer" behind the SUBMIT_2026 beta, matching the whisper (ChatActionableButtons). Fixes Expensify#96085.
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
Follow-up to #94319 (Submit → "Submit to my employer"). This PR contains two targeted changes:
1. Show the two submit options on the expense details page (#96085)
The track-expense details page menu still rendered the single "Submit to someone" option, while the whisper (
ChatActionableButtons) already split it into "Submit to a friend" / "Submit to my employer". This mirrors that split on the details page, gated behind the sameSUBMIT_2026beta, so non-beta users see the unchanged single option.2. Scope the draft-workspace name resolution to be targeted and safe
The original feature broadened
getPolicyName's early-bail guard witholdPolicyNameto resolve the "To" name for a freshly created draft workspace (zero-workspace "Submit to my employer"). That changed behavior for all zero-policy users. This replaces it with a targeted approach:getPolicyNamenow honors thepolicyargument a caller explicitly passes (instead of bailing whenpolicies/allPoliciesare empty). This only affects the case where a caller passed a valid policy but everything else was empty — previously that wrongly returned "Unavailable workspace".IOURequestStepConfirmationforwards the (draft) transaction policy for the matching participant, so the draft workspace name resolves through the normal path.Both changes are dead code paths for normal, non-draft flows (verified by the existing
getPolicyNameunit tests, all passing).Fixed Issues
$ #96085
PROPOSAL:
Tests
SUBMIT_2026beta.Offline tests
Same as tests — the two-option menu and name resolution are client-side and work offline.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionScreenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari