Skip to content

[Payment due @mkhutornyi] Add Bank account column to workspace Members page - #102427

Merged
arosiclair merged 39 commits into
Expensify:mainfrom
allgandalf:members-bank-account-column
Oct 20, 2026
Merged

arosiclair merged 39 commits into
Expensify:mainfrom
allgandalf:members-bank-account-column

Conversation

@allgandalf

@allgandalf allgandalf commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

When a workspace has payments on, admins now see a Bank account column on the Members page with the last four of each member's default bank account, and blank when they don't have one. The member details page shows the same account under Bank accounts.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/678518
PROPOSAL: N/A

Tests

  1. As a workspace admin, open a workspace with Workflows > Payments turned on
  2. Have one member add a personal bank account and leave another member without one
  3. Open Members
  4. Verify there is a Bank account column between Member and Role
  5. Verify the member with a bank account shows "Ending in" and the last four, and the other member's cell is empty
  6. Sort by Bank account and verify it sorts by the last four
  7. Click the member with a bank account
  8. Verify the Bank accounts section shows the bank icon, bank name and last four
  9. As the member, delete the bank account, then verify the admin's Members page clears the cell without a refresh
  10. Invite a member who has a bank account and verify their last four shows without a refresh
  11. Turn off Payments and verify the column and the Bank accounts section are gone
  12. Log in as a non-admin member and verify the column doesn't show
  • Verify that no errors appear in the JS console

Offline tests

  1. Load the Members page once online, then go offline
  2. Verify the Bank account column still shows the last four already loaded

QA Steps

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

Same as tests

  • 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 verified any copy / text that was added to the app 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 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/ONYXKEYS.ts 100.00% <ø> (ø)
...WorkspaceMembersTable/WorkspaceMembersTableRow.tsx 92.30% <100.00%> (+1.00%) ⬆️
src/hooks/useWorkspaceMembers.ts 89.65% <100.00%> (+0.36%) ⬆️
src/libs/ExportOnyxState/masking.ts 80.95% <ø> (ø)
src/libs/actions/PaymentMethods.ts 57.48% <100.00%> (+7.04%) ⬆️
src/pages/workspace/WorkspaceMembersPage.tsx 77.53% <100.00%> (+0.16%) ⬆️
...s/workspace/members/WorkspaceMemberDetailsPage.tsx 82.95% <100.00%> (+0.60%) ⬆️
.../components/Tables/WorkspaceMembersTable/index.tsx 57.14% <75.00%> (+4.64%) ⬆️
src/pages/settings/Wallet/WalletPage/index.tsx 0.00% <0.00%> (ø)
... and 15 files with indirect coverage changes

…t-column

# Conflicts:
#	src/components/Tables/WorkspaceMembersTable/WorkspaceMembersTableRow.tsx
#	src/components/Tables/WorkspaceMembersTable/index.tsx
#	src/pages/workspace/WorkspaceMembersPage.tsx
#	src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx
@mkhutornyi

Copy link
Copy Markdown
Contributor

Bug: Bank account column flickers when switch to Overview tab and then back to Members

bug.mov

@allgandalf

Copy link
Copy Markdown
Contributor Author

bring them on!!!

@mkhutornyi

Copy link
Copy Markdown
Contributor
  1. As the member, delete the bank account, then verify the admin's Members page clears the cell without a refresh

This step is failing. Member row is not updated without refresh

bug.mov

@mkhutornyi

Copy link
Copy Markdown
Contributor

Same refresh bug:

After disable workflow and enable again in another tab, Bank account column values are not showing until refresh

bug.mov

@allgandalf

Copy link
Copy Markdown
Contributor Author
image

@mkhutornyi

Copy link
Copy Markdown
Contributor

Column width flickers. Please check if similar bug already happening on production (either on this table or any other tables) and we can consider out of scope if so

bug.mov
bug.mov

@allgandalf

Copy link
Copy Markdown
Contributor Author

Bug: Bank account column flickers when switch to Overview tab and then back to Members

fixed. The bank accounts were kept on the member list, which gets reset every time the workspace loads. They have their own Onyx key now 34ed9dc

This step is failing. Member row is not updated without refresh

this one was my local backend 😅 , the job that sends updates to other accounts wasn't running. It's on now, can you retry ?

After disable workflow and enable again in another tab, Bank account column values are not showing until refresh

same cause as the flicker. The Members page also loads again now when the column comes back, same commit as above.

@allgandalf

Copy link
Copy Markdown
Contributor Author

Column width flickers. Please check if similar bug already happening on production

this one isn't from this PR. The table starts with a width of 0 here and uses equal columns until it's measured here, so every column jumps for one frame when the page opens. In your video Member and Approver move too, not just Bank account. It's the same on main with the Approver column, so i think we can keep it out of scope.

@mkhutornyi

Copy link
Copy Markdown
Contributor

this one was my local backend 😅 , the job that sends updates to other accounts wasn't running. It's on now, can you retry ?

Same

same.mov

@mkhutornyi

Copy link
Copy Markdown
Contributor

Is this bug? offline deleted bank account still shows

bug.mov

@mkhutornyi

Copy link
Copy Markdown
Contributor

Should we show Ending in in member detail page?

bug.mov

@mkhutornyi

mkhutornyi commented Oct 2, 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 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
    • 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
    • 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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: mWeb Safari
MacOS: Chrome / Safari
102427.mov

@allgandalf

Copy link
Copy Markdown
Contributor Author

Same

your app is connecting to Pusher with a different key than my backend. I see PusherError: Invalid key in subscription auth data from your session in my logs, so it never subscribes and no live update can reach it. Can you set PUSHER_APP_KEY in your .env to the one in .env.example, restart and retry ?

Is this bug? offline deleted bank account still shows

i think that's expected. The delete is still pending while offline, and the column shows what the server has, so it clears once you're back online (it does at the end of your video).

Should we show Ending in in member detail page?

i followed the mockup there, it shows the bank name with just the last four under it, and Ending in only in the table column.

@mkhutornyi

Copy link
Copy Markdown
Contributor

ok no blockers then

@MelvinBot

Copy link
Copy Markdown
Contributor

Review (re-review at 22256ca2)

No blockers. The fixes since my last review look correct. The only failing check is Check independent approval, which is a process check.

  1. Invite reload works, but each invite fires two reads. The new effect in useWorkspaceMembers.ts:50-57 runs once for the optimistic accountID and again when the server swaps in the real one. API.read waits for the AddMembersToWorkspace write, so the data ends up correct. Optional: compare with a Set instead of every + includes, which is O(n²) on large workspaces.
  2. The hook now reloads on the Agents page too. useWorkspaceAgents.ts:18 uses the same hook, so membership changes trigger OpenWorkspaceMembersPage there as well. This is harmless, but you could gate the effect to the Members page.

Open question from mkhutornyi: the default bank account doesn't update offline after the member changes it. I'd leave this as a follow-up. Fixing it means the set-default action must update policyMemberBankAccounts_ for every workspace where that user is an admin. It only shows up when admins change their own account, and it fixes itself once the user is back online.


Next Steps: Reply with @MelvinBot <your feedback> to refine this review.


view run

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22256ca2d7

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

Comment thread src/hooks/useWorkspaceMembers.ts Resolved
@MelvinBot

MelvinBot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Web test steps verification results: ⚠️ partial

I found no regressions on the Members page, the member details page, or the Payments toggle. I couldn't test the Workspace Agents page, which also uses the changed useWorkspaceMembers hook, because this test workspace has no entry point to it.
Workspaces list with no Agents entry point

Step Status
VERIFY 1: With Payments on, Members shows Member, Bank account, Role columns in order, with empty cells for members without a bank accountColumn headers appeared in the order Member, Bank account, Role. The owner, who has no bank account, had an empty Bank account cell.
Members table with Member, Bank account, Role columns
✅
VERIFY 2: Inviting a new member adds them once, with no duplicates, errors, or stuck loadingAfter inviting melvinbottestuser+inviteemember1@gmail.com, the page showed 2 members with exactly one new row. No errors or stuck loading appeared.
Members list with 2 members after invite
✅
VERIFY 3: Sorting by Member, Bank account, and Role works without errors or layout breakageEach header click re-sorted the table. No columns went missing and no errors appeared.
Table sorted by Bank account
Table sorted by Member
✅
VERIFY 4: Row selection and the bulk-actions menu still workSelecting the invited member changed the button to "1 selected". The menu showed "Remove member" and "Make workspace admin". Dismissing it left both members in place.
Bulk actions menu
✅
VERIFY 5: Searching members filters rows correctlySearching "inviteemember1" left only the matching row. Clearing the search restored both rows.
Members list filtered by search
✅
VERIFY 6: Member details shows Email, Role, and Profile normally, with no empty Bank account headerAll three sections rendered. No Bank account section appeared for this member, who has no bank account.
Member details page without Bank account section
✅
VERIFY 7: Going Members > Overview > Members keeps the table stableAfter returning to Members, the Member, Bank account, and Role columns and both rows were unchanged.
✅
VERIFY 8: Turning Payments off removes the Bank account column, and turning it on restores it without a refreshWith Payments off, only the Member and Role columns remained. Turning Payments back on restored the Bank account column without a page reload.
Members table without Bank account column, Payments off
Members table with Bank account column restored
✅
VERIFY 9: At mobile width, Members shows no Bank account column and rows stay usableAt 375×667, Members rendered as a single-column list. Each row showed the name, role, and email, and each row could be tapped.
Members list at mobile width
✅
VERIFY 10: The Workspace Agents page loads normallyNot tested. The tester found no Agents entry point in the workspace menu, More features, or the Workspaces list. The page may need a specific plan or a feature flag.
Workspaces list with no Agents entry point
⚠️

view run · view recording

@allgandalf

Copy link
Copy Markdown
Contributor Author

This is fixed online but still not optimistically. Are we fine to leave as is?

yeah i'd leave it, it only happens when an admin changes their own default and it updates as soon as the request goes through

Comment thread src/hooks/useWorkspaceMembers.ts Resolved
@arosiclair

Copy link
Copy Markdown
Contributor

Another refresh bug: After updating default payment method, Bank account is not updated until refresh

This is fixed online but still not optimistically. Are we fine to leave as is?

yeah i'd leave it, it only happens when an admin changes their own default and it updates as soon as the request goes through

Can we just fix that now? It will get reported as a bug otherwise.

@allgandalf

Copy link
Copy Markdown
Contributor Author

Can we just fix that now? It will get reported as a bug otherwise.

yep, done 6da036a

@allgandalf
allgandalf requested a review from arosiclair October 17, 2026 08:32

@arosiclair arosiclair 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.

@allgandalf

Copy link
Copy Markdown
Contributor Author

Auth PR was deployed, lets merge this @arosiclair

@allgandalf
allgandalf requested a review from arosiclair October 20, 2026 04:08
@arosiclair
arosiclair merged commit 0cbe490 into Expensify:main Oct 20, 2026
45 of 65 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/arosiclair in version: 9.5.15-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed. This PR adds a read-only Bank account column and member detail entry for admins, but no existing article sentence becomes incorrect, and documenting it would mean adding new content rather than fixing a wrong step.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.5.15-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@melvin-bot

melvin-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #104622

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.

8 participants