Skip to content

Removed the Onyx.connect usage for introSelected from NextStepUtils.ts and ReportNameUtils.ts.#93883

Open
jayeshmangwani wants to merge 11 commits into
Expensify:mainfrom
jayeshmangwani:follow-up-remove-Onyx.connect-usage
Open

Removed the Onyx.connect usage for introSelected from NextStepUtils.ts and ReportNameUtils.ts.#93883
jayeshmangwani wants to merge 11 commits into
Expensify:mainfrom
jayeshmangwani:follow-up-remove-Onyx.connect-usage

Conversation

@jayeshmangwani

@jayeshmangwani jayeshmangwani commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

This is a follow-up PR to remove the Onyx.connect usage for introSelected from NextStepUtils.ts and ReportNameUtils.ts, which was introduced in this PR: #92254.

Fixed Issues

$ #86223
PROPOSAL: #86223 (comment)

Tests

Prerequisites:

  • The user selected "Organize my personal spending" / "Track expenses for my business" during onboarding (TRACK_WORKSPACE or PERSONAL_SPEND)
  • The workspace policy has submit-and-close approval mode (no approvals)

Test 1:

  1. Create a new account and select "Organize my personal spending" / "Track expenses for my business" during onboarding
  2. Navigate to the workspace chat and verify the welcome text says "This is where you'll track expenses."
  3. Create an expense in the workspace
  4. Verify the Submit CTA says "Mark as done"
  5. Click "Mark as done" and verify the animation status shows "Marked as done" and the system message says "marked as done"
  6. Open Search, find a submittable report, and verify the action button shows "Done"
  7. Select multiple submittable reports in Search and verify the bulk Submit action says "Mark as done"
  8. Check the LHN and verify the action badge for a submittable report says "Mark as done"
  9. Log in with a different account that selected "Manage team expenses" during onboarding
  10. Verify all standard copy appears: "Submit", "submitted", and the normal workspace chat welcome message

Test 2:

  1. Go to staging.new.expensify.com
  2. Log in with new Gmail account.
  3. Skip work email step.
  4. Select "Organize my personal spending" / "Track expenses for my business".
  5. Complete the onboarding.
  6. Go to workspace chat.
  7. Create an expense.
  8. Open the report.
  9. Click Mark as done.
  10. Right click on "marked as done" system message > Copy to clipboard.
  11. Paste the content.
  12. Verify that "marked as done" will be pasted.

Test 3:

  1. Go to staging.new.expensify.com
  2. Log in with new Gmail account.
  3. Skip work email step.
  4. Select "Organize my personal spending" / "Track expenses for my business".
  5. Complete the onboarding.
  6. Go to workspace settings > Members.
  7. Invite a member to the workspace.
  8. Go to Inbox.
  9. Open search router.
  10. Open member's workspace chat.
  11. Verify that Member's workspace chat should display "This is where [User] will submit expenses to [Workspace]. Just use the + button.".

Test 4:

  1. Go to staging.new.expensify.com
  2. Log in with new Gmail account.
  3. Skip work email step.
  4. Select Organize my personal spending / Track expenses for my business
  5. Complete the onboarding.
  6. Go to workspace chat.
  7. Create an expense.
  8. Open the report.
  9. Click Mark as done.
  10. Verify that Mark as done button will change to Marked as done in the expense report.

Test 5:

Prerequisite:

  • Login new gmail account via track & budget expense

Steps:

  1. Launch app
  2. Open workspace chat
  3. Create track distance manual expense
  4. Long press preview and select hold
  5. Hold the expense entering a reason
  6. Open the expense - header and pin the report
  7. Navigate back to LHN and open the chat
  8. Tap more - mark as done
  9. Note header shows hold message after mark as done.
  10. Note system message below shows mark as done as last message
  11. Verify that after marking the held expense as done, the header displays the hold message (This expense was put on hold. Please review the comments for next steps.) and the LHN reflects the latest status correctly ('marked as done')

Test 6:

  1. Go to staging.new.expensify.com
  2. Log in with new Gmail account.
  3. Skip work email step.
  4. Select Organize my personal spending / Track expenses for my business
  5. Complete the onboarding.
  6. Create another workspace and enable approvals.
  7. Create an expense in both workspace chats.
  8. Go to Reports > Reports.
  9. Bulk select both reports.
  10. Click dropdown button.
  11. Verify that Dropdown button will not show Submit since one of the reports can only be marked as done instead of submitting.

Test 7:

Prerequisite:

  • Log in with a Track Expense-enabled user.

Steps:

  1. Go to the Workspace Chat.
  2. Create an expense.
  3. Open the expense.
  4. Verify that the Mark as Done button is displayed.
  5. Click More > Hold.
  6. Enter a reason and save it.
  7. Click the More menu.
  8. Verify that the Mark as Done option is displayed in the More menu.

Test 8:

Prerequisite:

  • Log in with a Track Expense-enabled user.

Steps:

  1. Go to the Workspace Chat.
  2. Create an expense.
  3. Open the expense.
  4. Verify that the Mark as Done button is displayed.
  5. Click More > Hold.
  6. Enter a reason and save it.
  7. Click the More menu.
  8. Verify that the Mark as Done option is displayed in the More menu.

Test 9:

Prerequisite:

  • Log in with a Track Expense-enabled user.

Steps:

  1. Go to workspace chat.
  2. Create an expense.
  3. Open the expense.
  4. Click Mark as done button.
  5. Right click on Mark as done system message > Reply in thread.
  6. Verify that Marked as done will be shown in system message thread header and LHN report name.

Test 10:

Prerequisites:

  • User A and User B completed onboarding with Track expenses for my business intent.
  • User A invites User B to the workspace.
  • Perform steps below as User B.

Steps:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Go to Spend > Reports.
  5. Select the expense via checkbox.
  6. Click dropdown button.
  7. Verify that Dropdown button will show the Submit button as the report row.

Test 11:

Prerequisite:

  • Log in with a Track Expense-enabled user.

Steps:

  1. Open workspace chat
  2. Go forced offline
  3. Create 2 track distance manual expenses
  4. Open the expense report and note header message
  5. Verify that "Waiting for you to mark this as done" shown in header.

Test 12:

Prerequisites:

  • Log in with a Track Expense-enabled user.

Steps:

  1. Open a Workspace Chat.
  2. Create a manual distance expense.
  3. Open the expense and split it.
  4. Open the expense report.
  5. Verify that the header displays "Waiting for you to mark this as done."
  6. Send a message and verify that the header still displays "Waiting for you to mark this as done."
  7. Tap the back arrow and return to the expense chat.
  8. Verify that the header message still displays "Waiting for you to mark this as done."
  • Verify that no errors appear in the JS console

Offline tests

Same as Tests

QA Steps

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 followed proper code patterns (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 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 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 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.mov
Android: mWeb Chrome
mweb-chrome.mov
iOS: Native
ios.mov
iOS: mWeb Safari
mweb-safari.mov
MacOS: Chrome / Safari
web.mov

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
...yReportHeaderPrimaryAction/SubmitPrimaryAction.tsx 0.00% <ø> (ø)
...nents/Navigation/QuickCreationActionsBar/index.tsx 85.71% <100.00%> (+0.17%) ⬆️
...m/MoneyRequestReportPreview/SubmitActionButton.tsx 0.00% <ø> (ø)
...c/components/ReportActionItem/MoneyRequestView.tsx 72.77% <100.00%> (+0.06%) ⬆️
...arch/SearchList/ListItem/ExpenseReportListItem.tsx 0.00% <ø> (ø)
...earch/SearchList/ListItem/ReportListItemHeader.tsx 90.62% <100.00%> (+0.14%) ⬆️
.../SearchPageHeader/SearchActionsBarCreateButton.tsx 96.15% <100.00%> (+0.04%) ⬆️
src/components/SettlementButton/index.tsx 82.44% <100.00%> (+0.06%) ⬆️
src/hooks/useBulkDuplicateAction.ts 100.00% <100.00%> (ø)
src/hooks/useBulkDuplicateReportAction.ts 100.00% <100.00%> (ø)
... and 98 more
... and 7 files with indirect coverage changes

@jayeshmangwani

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 3cdccadb15

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

allPolicyTags: policyTags,
conciergeReportID: conciergeReportID ?? undefined,
reportAttributes: currentValue?.reports,
isTrackIntentUser: isTrackOnboardingChoice(introSelected?.choice),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recompute report attributes when intro choice changes

When NVP_INTRO_SELECTED changes after DERIVED.REPORT_ATTRIBUTES already has a currentValue, the derived compute runs with only that key in sourceValues. Because needsFullRecompute does not include this new dependency and the incremental updates list also ignores it, the function returns the previous value before reaching this isTrackOnboardingChoice usage. That leaves report/thread names that depend on shouldShowMarkAsDone (for example “submitted” vs “marked as done”) stale until some unrelated report update happens; please trigger a full recompute or otherwise enqueue affected reports when this key changes.

Useful? React with 👍 / 👎.

@jayeshmangwani jayeshmangwani marked this pull request as ready for review June 19, 2026 10:13
@jayeshmangwani jayeshmangwani requested review from a team as code owners June 19, 2026 10:13
@melvin-bot melvin-bot Bot requested review from Ollyws and joekaufmanexpensify and removed request for a team June 19, 2026 10:13
@melvin-bot

melvin-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

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

@melvin-bot melvin-bot Bot requested review from a team, Valforte and ahmedGaber93 and removed request for a team June 19, 2026 10:13
@melvin-bot

melvin-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

@ahmedGaber93 @Valforte 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]

@jayeshmangwani

Copy link
Copy Markdown
Contributor Author

@ahmedGaber93 , sorry for the ping. @Krishna2323 will review this PR, as it is a follow-up to our previous PR.

* @param sessionAccountID - accountID of the current user
* @param sessionEmail - email of the current user
*/
// eslint-disable-next-line @typescript-eslint/max-params

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.

❌ CONSISTENCY-5 (docs)

This newly added // eslint-disable-next-line @typescript-eslint/max-params on completeSplitBill has no accompanying comment explaining why the rule is suppressed. eslint-disable comments hide the violation from the seatbelt baseline entirely, so they should only be used for permanent suppressions and must always carry a justification so future maintainers understand the intent.

This suppression was only added because threading the new isTrackIntentUser argument pushed the parameter count over the limit — that reads like a temporary/convenience suppression rather than a permanent one. Prefer widening the baseline with SEATBELT_INCREASE (which keeps the violation visible so the over-long parameter list can still be refactored later, e.g. into a single params object), or, if the disable is intentional and permanent, add a justification comment:

// eslint-disable-next-line @typescript-eslint/max-params -- <reason this parameter list is intentionally kept positional>
function completeSplitBill(

See LINTING.md for guidance on choosing between eslint-disable and SEATBELT_INCREASE.


Reviewed at: 73368cb | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

@jayeshmangwani

Copy link
Copy Markdown
Contributor Author

@Krishna2323 , while testing the changes, I found a bug in FloatingMessageCounter.

We are using getActionBadgeText for actionBadgeText.

const actionBadgeText = getActionBadgeText(actionBadge, translate, isMarkAsDone);

Before our changes, it was using:
translate(`common.actionBadge.${actionBadge}`)

The issue now is that when an expense has something that needs to be fixed, it shows "Mark as done" instead of "Fix".
Screenshot 2026-06-19 at 4 13 54 PM

I think "Fix" label should continue to be used for these cases, even for track-intent users.
Screenshot 2026-06-19 at 4 12 14 PM

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.

1 participant