Skip to content

Allow linking an existing card feed to a non-USD workspace - #98509

Draft
MelvinBot wants to merge 2 commits into
mainfrom
claude-allowLinkFeedNonUsdWorkspace
Draft

Allow linking an existing card feed to a non-USD workspace#98509
MelvinBot wants to merge 2 commits into
mainfrom
claude-allowLinkFeedNonUsdWorkspace

Conversation

@MelvinBot

Copy link
Copy Markdown
Contributor

Explanation of Change

On a non-USD workspace, the Expensify Card empty-state CTA ran a currency check that forced the workspace to USD before it decided which flow to start. That check exists to protect enrolling a brand-new card program (which needs a USD bank account), but it fired unconditionally — so it also blocked the valid path of linking an existing card feed to a non-USD (e.g. CAD/GBP/EUR) workspace, which does not require USD.

This change skips the currency prompt when the workspace has accessible feeds (hasAccessibleFeeds). In that case the CTA calls startFlow() directly, which already routes to the feed selector so the admin can link an existing feed. The USD prompt still applies to the brand-new-program path (no accessible feeds). No new linking or currency logic is needed — the feed selector's "From other workspaces" section already calls linkCardFeedToPolicy, and the card UI already derives currency from the feed itself (from PR #93331).

Fixed Issues

$ #98503
PROPOSAL: #98503 (comment)

Tests

// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review".
// Please describe what tests you performed that validate your changes worked.

  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas they need to test for regressions.

  • 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Co-authored-by: Chuck Dries <chuckdries@users.noreply.github.com>
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
...nsifyCard/WorkspaceExpensifyCardPageEmptyState.tsx 0.00% <0.00%> (ø)
...ifyCard/WorkspaceExpensifyCardFeedSelectorPage.tsx 0.00% <0.00%> (ø)
... and 15 files with indirect coverage changes

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I looked into the failing checks — there's no code failure to fix here. Every code/CI check passes (typecheck, Bun tests, ESLint, Oxfmt, Storybook, all test jobs, and the builds). Only two checks are red, and both require human action, not a code change:

Check Why it's failing Who fixes it
PR Author Checklist / checklist 0/38 checklist boxes are ticked — the CI just verifies the boxes are checked The human co-author must fill out the Tests/QA sections and check the boxes
Check independent approval No independent reviewer approval yet A reviewer needs to approve the PR

I intentionally don't touch the author-checklist or approval checks — the Tests/QA sections in the PR body are marked "The human co-author must fill out…" for exactly this reason, and pushing a commit won't clear either check.

To get this PR green: fill in the Tests/QA steps + tick the author-checklist boxes, then have a reviewer approve. (The perf-test jobs were still running when I checked; they're informational benchmarks, not blockers.)

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Re-checked — status is unchanged, and there's still no code failure I can push a fix for. All code/CI checks pass. The only two red checks are the same human-action ones:

  • PR Author Checklist / checklist — 0/38 boxes ticked; a human co-author must fill out the Tests/QA sections and check the boxes.
  • Check independent approval — needs a reviewer's approval.

Neither clears from a commit, so pushing to the branch won't turn these green. To get the PR mergeable: complete the author checklist + Tests/QA, then get an independent review approval. (The perf-test job is still running — informational benchmark, not a blocker.)

…elector

Co-authored-by: Chuck Dries <chuckdries@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I looked at the failing checks — there's nothing here I can fix by pushing code. Both failures are process gates that need a human:

  • PR Author Checklist / checklist — fails because the author checklist boxes aren't ticked and the Tests/QA Steps sections still have the // TODO placeholders. The human co-author needs to fill these out and check the boxes. (annotation)
  • Check independent approval — fails because the PR doesn't yet have an independent reviewer approval. This clears once a reviewer approves. (run)

Everything else is green: Bun tests, ESLint, Oxfmt, typecheck, React Compiler, Storybook, unit tests (test (job 1–8)), and the builds all pass. The perf tests were the only ones still running and none of them are failing.

So no code change is warranted — the two red checks resolve on their own once the checklist is completed and a reviewer approves.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Still nothing for me to push here — the check status is unchanged from my earlier comments. The two red checks are both human-only gates, not code failures:

  • PR Author Checklist / checklist — needs the human co-author to fill out the Tests/QA Steps sections (still // TODO) and tick the checklist boxes.
  • Check independent approval — needs a reviewer to approve.

Every automated check (Bun tests, ESLint, Oxfmt, typecheck, React Compiler, Storybook, all unit test jobs, builds, and perf tests) is passing. No code change is warranted; these clear once the checklist is completed and a reviewer approves.

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.

2 participants