Skip to content

Fix company card export/details RHP background when opened from Members - #99056

Merged
mjasikowski merged 3 commits into
mainfrom
claude-companyCardExportRhpBackground
Aug 25, 2026
Merged

mjasikowski merged 3 commits into
mainfrom
claude-companyCardExportRhpBackground

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

The company-card details and export RHP screens are dynamic routes that can be opened from more than one place (Members and Company cards). They were listed in WORKSPACE_TO_RHP, which is inverted (last-wins) into RHP_TO_WORKSPACE. Because COMPANY_CARDS is defined after MEMBERS, both dynamic screens inverted to Workspace_CompanyCards, and getMatchingFullScreenRoute consulted that map before the dynamic base-path branch. As a result, opening these RHPs from a member's profile and refreshing (or navigating in-app) resolved the background to Company cards instead of Members.

This PR removes the three dynamic-screen entries (DYNAMIC_COMPANY_CARD_DETAILS from both MEMBERS and COMPANY_CARDS, and DYNAMIC_COMPANY_CARD_EXPORT from COMPANY_CARDS) so the background is resolved from the actual URL by the dynamic base-path branch — the same pattern the file already documents for DYNAMIC_IMPORTED_MEMBERS_ROLE. The background now stays correct for every entry point (Members, Company cards, Expensify Card, Rillet card list). An explanatory comment was added so the entries aren't re-added.

Fixed Issues

$ #95303
PROPOSAL: #95303 (comment)

Tests

Same as #95303

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Same as #95303

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.

Co-authored-by: Michał Jasikowski <mjasikowski@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Android testing blocked — could not exercise the test cases.

I couldn't run any of the three test steps because the required precondition can't be set up on this automated test account. This PR's tests need a workspace with a direct company-card feed, a card assigned to a member, and Sage Intacct connected — but creating the first company-card feed requires account validation.

Where it blocked: On a fresh account I completed onboarding, created a workspace, and enabled the Company cards feature. Opening Workspace → Company cards → Add cards immediately routed to a "This feature requires you to validate your account" screen asking for a 6‑digit security code emailed to the test account. That inbox isn't accessible to this run, so the flow can't proceed — and without a feed there's no assigned card or export screen to test.

Account-validation security-code screen shown when tapping Add cards

Result per test step:

Step Status
Members → member → card → export RHP background stays Members ⛔ Blocked (no feed/card)
Members → member → card details RHP background stays Members ⛔ Blocked (no feed/card)
Regression: Company cards → card → export RHP background stays Company cards ⛔ Blocked (no feed/card)
What I got through before the block
  • Drove the pre-started session from the post-login screen to Home, dismissed the notification-permission dialog, and completed the onboarding wizard ("Manage my team's expenses" → "11-50 employees" → enabled Company cards + Accounting), which auto-created a workspace.
  • Enabled the Company cards feature (confirmed it appeared in the workspace left-nav).
  • Tapped Add cards → hit the account-validation magic-code screen.

To verify this PR on Android, testing needs a pre-provisioned account that already has a direct feed + an assigned company card + Sage Intacct connected (magic-code validation can't be completed here). Alternatively, this is a navigation/route-resolution fix that is straightforward to verify on web with a URL refresh — happy to re-run on web, or on Android against a properly provisioned account, if you can point me at one.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Web testing blocked — could not exercise the test cases.

Same root blocker I hit on Android: this PR's tests need a workspace with a direct company-card feed + a card assigned to a member + Sage Intacct connected, and none of those preconditions can be established on the automated test account.

Where it blocked:

  • On a fresh account I drove to Home and created a workspace. Opening Company cards → Add cards (to create the first direct feed) immediately routed to a "Validate your account" 6‑digit magic-code screen. The code is emailed to an inbox this run can't access, so the feed can't be created — and without a feed there's no card to assign to a member and no export/details RHP to test.
  • I got further on the accounting side (enabled Accounting, upgraded to Control, reached the Sage Intacct setup wizard), but the wizard's next step triggered a full off-app navigation to help.expensify.com, which is a hard stop for the tester.

Validate your account magic-code screen blocking Add cards

Result per test step:

Step Status
Members → member → card → export RHP background stays Members after refresh ⛔ Blocked (no feed/card)
Members → member → card details RHP background stays Members after refresh ⛔ Blocked (no feed/card)
Regression: Company cards → card → export RHP background stays Company cards after refresh ⛔ Blocked (no feed + Sage Intacct wizard left app)
What I got through before the block
  • Drove the pre-started session from the post-signup "Join" screen to Home.
  • Created a workspace (account had none).
  • Company cards → Add cards → hit the account-validation magic-code wall.
  • Enabled Accounting → Sage Intacct → upgraded to Control → reached the Sage Intacct setup wizard, whose next step navigated off-app (help.expensify.com), ending the drive.

To verify this PR, testing needs a pre-provisioned account that already has a direct company-card feed, a card assigned to a member, and Sage Intacct connected — the magic-code account validation can't be cleared in this environment. If you can point me at such an account, I can re-run web or Android.


view run

@mjasikowski
mjasikowski requested a review from huult August 24, 2026 12:32
@mjasikowski
mjasikowski marked this pull request as ready for review August 24, 2026 12:32
@mjasikowski
mjasikowski requested a review from a team as a code owner August 24, 2026 12:32
@melvin-bot
melvin-bot Bot requested review from heyjennahay, ikevin127 and mjasikowski and removed request for a team August 24, 2026 12:32
@melvin-bot

melvin-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

@ikevin127 @mjasikowski One of you needs to 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]

@mjasikowski
mjasikowski removed the request for review from ikevin127 August 24, 2026 12:32
@mjasikowski

Copy link
Copy Markdown
Contributor

@huult can you check and review this please?

@huult

huult commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

I will review this PR soon.

@huult

huult commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

@mjasikowski Please check off the author checklist and QA step

@huult

huult commented Aug 25, 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.
  • 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
Screen.Recording.2026-08-25.at.11.51.02.mov

@huult

huult commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

@mjasikowski could you sync with main?

@mjasikowski

Copy link
Copy Markdown
Contributor

@MelvinBot merge main

@huult

huult commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

@mjasikowski Please check off the author checklist and QA step

Could you check this one as well?

@mjasikowski

Copy link
Copy Markdown
Contributor

@mjasikowski Please check off the author checklist and QA step

Could you check this one as well?

Yes, this is already done

…ortRhpBackground

Co-authored-by: Michał Jasikowski <mjasikowski@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner August 25, 2026 06:23
@melvin-bot
melvin-bot Bot requested review from thesahindia and removed request for a team August 25, 2026 06:23
@melvin-bot

melvin-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Merged main into this branch — no conflicts. Pushed as 210b7436b02.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

There's no code failure to fix here. The only failing check is Check independent approval (its Verify peer review step), which is the approval gate — it fails simply because the PR hasn't received an independent reviewer's approval yet. That clears on its own once someone approves; it isn't fixable by pushing to the branch.

Every actual CI check is green — tests (jobs 1–8), ESLint, Oxfmt, typecheck, React Compiler, Storybook, Bun tests, and all builds. The perf tests (branch-perf-tests / baseline-perf-tests) are still running and haven't failed.

So nothing to push — this PR just needs a reviewer approval to turn that last check green.


view run

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

LGTM.

SCREENS.WORKSPACE.DYNAMIC_COMPANY_CARD_DETAILS,
// For the same reason, the dynamic company-card details/export screens are NOT listed here (or under
// Company cards): they are shared by Members and Company cards, so their background must be resolved from
// the URL by the dynamic base-path branch, not pinned to a single central pane.

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.

I don't think we need this comment. @mjasikowski, could you remove it?

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.

@MelvinBot remove this comment:

        // For the same reason, the dynamic company-card details/export screens are NOT listed here (or under
        // Company cards): they are shared by Members and Company cards, so their background must be resolved from
        // the URL by the dynamic base-path branch, not pinned to a single central pane.

Co-authored-by: Michał Jasikowski <mjasikowski@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Removed the comment from WORKSPACE_TO_RHP.ts and pushed as fbc771d.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Still nothing to push here. The only failing check is Check independent approval (its Verify peer review step) — the approval gate. It fails only because the PR hasn't received an independent reviewer's approval yet, and it clears automatically once someone approves. There's no code failure behind it.

All actual CI checks are green (tests, ESLint, Oxfmt, typecheck, React Compiler, Storybook, Bun tests, builds); the perf tests are still running and haven't failed. This PR just needs a reviewer approval.


view run

@mjasikowski
mjasikowski removed the request for review from thesahindia August 25, 2026 11:20
@mjasikowski
mjasikowski merged commit 87ff05b into main Aug 25, 2026
44 of 47 checks passed
@mjasikowski
mjasikowski deleted the claude-companyCardExportRhpBackground branch August 25, 2026 11:22
@github-actions

Copy link
Copy Markdown
Contributor

🚧 mjasikowski 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/mjasikowski in version: 9.4.61-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 No help site changes required.

This PR is a navigation-routing bug fix. Its only change is to src/libs/Navigation/linkingConfig/RELATIONS/WORKSPACE_TO_RHP.ts, correcting which background pane resolves behind the company-card details and export RHP screens (Members vs Company cards) when opened from a member's profile and refreshed.

Nothing user-facing changes: the same screens open with the same content, buttons, and labels — only the underlying background is resolved from the URL instead of always defaulting to Company cards. App/docs/articles documents features and workflows, none of which are altered here, so there's nothing to add or update.

No draft PR was created.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/AndrewGable in version: 9.4.61-4 🚀

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

Bundle Size Analysis (Sentry):

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

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants