Skip to content

Show the new bank account statuses on Workflows for every workspace - #98026

Open
marufsharifi wants to merge 3 commits into
Expensify:mainfrom
marufsharifi:fix/workflows-bank-account-status-not-shown
Open

Show the new bank account statuses on Workflows for every workspace#98026
marufsharifi wants to merge 3 commits into
Expensify:mainfrom
marufsharifi:fix/workflows-bank-account-status-not-shown

Conversation

@marufsharifi

@marufsharifi marufsharifi commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

The Workflows payment account row gated the new bank account statuses on canAccessSubmitWorkspaceFeatures, which is isSubmitPolicy(policy) && beta, so only Submit workspaces got them and everyone else kept the old Action required badge. It now gates on the walletConnectionStatus beta alone, matching the Wallet page.

Fixed Issues

$ #91300
PROPOSAL:

Tests

Precondition:

  • Logged in to a walletConnectionStatus beta account.
  1. Start setting up a U.S. business bank account for that workspace and leave it partially set up
  2. Go to Workspaces > [workspace] > Workflows
  3. Verify the payment account shows Incomplete, Finish adding bank account and a Finish button, instead of the old Action required badge
  4. Verify Account > Wallet > Bank accounts shows the same account in the same style
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Screen.Recording.2026-08-12.at.11.52.34.AM.mov
Android: mWeb Chrome
Screen_Recording_20260812_120303_Chrome.mp4
iOS: Native
Screen.Recording.2026-08-12.at.12.11.05.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-08-12.at.12.12.56.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-08-12.at.11.32.51.AM.mov

@marufsharifi
marufsharifi marked this pull request as ready for review August 12, 2026 08:56
@marufsharifi
marufsharifi requested review from a team as code owners August 12, 2026 08:56
@melvin-bot
melvin-bot Bot requested review from mkhutornyi and trjExpensify and removed request for a team August 12, 2026 08:56
@melvin-bot

melvin-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

@mkhutornyi 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]

@mkhutornyi

mkhutornyi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
ios.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mov

@melvin-bot
melvin-bot Bot requested a review from Gonals August 13, 2026 16:02
@MelvinBot

Copy link
Copy Markdown
Contributor

Review

LGTM — the fix is correct and the logic is sound. 🟢

The root cause matches your description: canAccessSubmitWorkspaceFeatures returns isSubmitPolicy(policy) && beta, so gating the new statuses on canAccessSubmitWorkspaceFeatures(policy, isWalletConnectionStatusBetaEnabled) restricted them to Submit workspaces. Gating on isWalletConnectionStatusBetaEnabled alone matches the Wallet page, which gates the same feature on isBetaEnabled(CONST.BETAS.WALLET_CONNECTION_STATUS) directly.

Verification details
  • Offline-pressable behavior is a real change, and it's consistent with the Wallet. Beyond the gating swap, this moves the row from disabled: isOffline || !canWritePayments to disabled: !canWritePayments in the beta path and drops the isOffline guard from onPress / the ConnectionStatusMessage action. I confirmed this matches the Wallet, where the bank-account row is only disabled on a pending delete (PaymentMethodList.tsx:602) and never on offline — so the inline comment's rationale holds.
  • isActionDisabled removal is safe — the prop defaults to false in ConnectionStatusMessage, so dropping it just removes the offline-disable, consistent with the point above.
  • No leftovers: canAccessWalletConnectionStatusFeatures and canInteractWithBankAccountRow are fully removed, both call sites updated, and the useMemo dependency array was updated to isWalletConnectionStatusBetaEnabled (L1021).
  • Non-beta path unchanged: the old Action required badge, DotIndicator, and disabled: isOffline || !canWritePayments still apply when the beta is off.

One thing worth confirming manually, since it's a behavior change (not just the gating fix): for a non-Submit workspace on the beta, verify the bank account row is now interactive while offline and pressing it opens the bank account flow as expected — this path was previously offline-disabled.

I couldn't run a live web check this pass: sign-in on the CI test session is blocked by a Cloudflare bot-mitigation challenge (403 on the dev server's /api/Ping), which is an infrastructure issue unrelated to this PR. The review above is static.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: e8b8d2c1a4

ℹ️ 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".

@MelvinBot

Copy link
Copy Markdown
Contributor

Regression scan

No code-level regressions found. The diff is a clean gating swap plus a documented offline-behavior change. The two behaviors that genuinely change should get a manual check, though — they're the real regression surface.

What actually changes behavior (verify these)

  1. Submit workspaces on the beta can now press the bank row while offline. This isn't just the non-Submit expansion — the beta path's disabled went from isOffline || !canWritePayments to !canWritePayments (L552-L563), so an already-live population (Submit + beta) that previously couldn't tap this row offline now can. Verify tapping it offline opens the bank account flow cleanly (no crash / no dead tap). It matches the Wallet, where the row is only disabled on a pending delete (PaymentMethodList.tsx:602), so this is expected — just confirm it.

  2. Non-Submit workspaces on the beta now render the new status UI for every account state. Confirm each state looks right on a non-Submit workspace: Active (OPEN), Incomplete/Finish (SETUP), Confirm test transactions (PENDING), Verifying tooltip, Locked/Unlock.

Why I don't expect hidden regressions

Details
  • Non-beta path is untouched — old Action required/Locked badge, DotIndicator, and disabled: isOffline || !canWritePayments still apply when the beta is off, so no regression for the default population.
  • No state falls through to a blank row. getBankAccountConnectionStatus covers OPEN/SETUP/PENDING/VERIFYING/LOCKED — a superset of the old getBadgeText (SETUP, LOCKED only) — so routing all workspaces through it doesn't leave any real bank-account state without a status.
  • The beta rendering path was already exercised by Submit workspaces before this PR; it's state-driven, not policy-type-driven, so running it for non-Submit workspaces reuses proven code.
  • No dangling references: canAccessWalletConnectionStatusFeatures and canInteractWithBankAccountRow are fully removed, both call sites rewired, and the useMemo deps updated.
  • isActionDisabled removal is safe — the prop defaults to false, so the ConnectionStatusMessage action button simply stops being offline-disabled, consistent with change Some initial fixes and code style updates #1.

I couldn't run a live web pass to confirm scenarios 1 & 2 dynamically — sign-in on the CI test session is blocked by a Cloudflare bot-mitigation challenge (403 on the dev server's /api/Ping), which is an infrastructure issue unrelated to this PR. The scan above is static.

@mkhutornyi

Copy link
Copy Markdown
Contributor

@marufsharifi please fix offline delete pending case.
The entire row is clickable. And should the button be disabled too?

Screen.Recording.2026-08-13.at.5.14.14.PM.mov

And check potential regressions:

1. "Unlock" button lies to non-reimburser admins (Collect/Control)

src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx:870-876src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx:550-573

getBankAccountConnectionStatus(LOCKED) returns requiresUnlockHandler: true plus an Unlock action, but this page ignores requiresUnlockHandler and always calls handleBankAccountPress, which only sends the unlock request when isUserReimburser. Everyone else falls through to BANK_ACCOUNT_CONNECT_EXISTING_BUSINESS_BANK_ACCOUNT or navigateToBankAccountRoute — i.e. pressing Unlock starts adding/linking a different bank account and never asks Concierge to unlock anything. On Submit workspaces this was unreachable (the single member is the reimburser); on Collect/Control, admin ≠ reimburser is the norm, and the paymentsAdmin role has WORKFLOWS_PAYMENTS: WRITE without being the payer at all.

Before this PR these workspaces just showed a plain Locked badge with no CTA.

Repro

  1. Enable the walletConnectionStatus beta on your account.
  2. Use a Collect or Control workspace whose payment bank account is in the LOCKED state, where the workspace's authorized payer (Workflows → Authorized payer) is someone other than you, and you're an admin (or paymentsAdmin).
  3. Go to Workspaces → [workspace] → Workflows.
  4. Under Payment account you now see the red "Your account requires attention" row with an Unlock button.
  5. Press Unlock → you're dropped into the add/connect-bank-account flow. No unlock request is sent and no Concierge message appears. Expected: either the unlock request fires, or the button isn't offered to non-reimbursers.

2. Read-only viewers get a red dead-end

src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx:868-877

shouldShowPayments is canMemberRead(...), and auditor has READ on every feature (src/libs/PolicyUtils.ts:167) — a role that only exists on Control policies, so it was never in scope before this PR. An auditor now sees the danger-tone ConnectionStatusMessage ("Finish adding bank account" / "Your account requires attention") with a red dot and no button, since onActionPress is gated on canWritePayments. Previously they saw a neutral/success Action required badge. Lower severity than the above, but it's a red error a viewer can't clear or act on.

Repro: as an auditor on a Control workspace with a SETUP-state payment bank account and the beta on, open Workflows — the payment account shows a red error line with no action.


These happen only when beta enabled so not blockers but keep them in mind.

@trjExpensify
trjExpensify requested review from joekaufmanexpensify and removed request for trjExpensify August 13, 2026 19:08
@trjExpensify

Copy link
Copy Markdown
Contributor

Switching @joekaufmanexpensify in for product review.

P.S - what is this? I don't see that in betaify at all.

Logged in to a walletConnectionStatus beta account.

@mkhutornyi

mkhutornyi commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

P.S - what is this? I don't see that in betaify at all.

Logged in to a walletConnectionStatus beta account.

It's pure frontend beta permission. Will be removed after #91300 (comment) is done.
This PR fixes one of those bugs.

@trjExpensify

Copy link
Copy Markdown
Contributor

Mhm, but @joekaufmanexpensify said in that comment those are "post-launch" bugs so I'm curious for his take on if they are blockers.

@mkhutornyi

Copy link
Copy Markdown
Contributor

Mhm, but @joekaufmanexpensify said in that comment those are "post-launch" bugs so I'm curious for his take on if they are blockers.

It's post-"beta launch" bugs. Non-beta users still see legacy layout in production.

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

Two of the three bugs I found are polish. This one is the only one I would consider holding the release on.

It shows a non-U.S. business bank account that's in the process of being set up in the totally incorrect state. We say it's "pending" and test transactions are needed, even though it's in the process of being set up and there's no test transaction step for non-US bank accounts. I feel like that has real potential to confuse people.

Is that one in progress @marufsharifi @mkhutornyi? If that one was done, I think we could release this and finish the others after.

@marufsharifi

Copy link
Copy Markdown
Contributor Author

Two of the three bugs I found are polish. #93852 (comment) is the only one I would consider holding the release

@joekaufmanexpensify that one's fixed in #98023 — it was still in draft, just marked it ready for review and linked it to the issue. Thanks!

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

Awesome, thank you!

@github-actions

Copy link
Copy Markdown
Contributor

🚧 joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #98026.

Android 🤖 iOS 🍎
⏩ SKIPPED ⏩ ⏩ SKIPPED ⏩
The build for Android was skipped The build for iOS was skipped
Web 🕸️
https://98026.pr-testing.expensify.com
Web

👀 View the workflow run that generated this build 👀

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

Testing well! Can't approve because GH is down, but will do so later

@joekaufmanexpensify joekaufmanexpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good for product

@madmax330

Copy link
Copy Markdown
Contributor

Conflicts @marufsharifi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants