Skip to content

Open invoice child reports in the wide RHP from the X replies link - #100017

Merged
neil-marcellini merged 9 commits into
mainfrom
claude-invoiceReplyOpensInWideRHP
Sep 2, 2026
Merged

Open invoice child reports in the wide RHP from the X replies link#100017
neil-marcellini merged 9 commits into
mainfrom
claude-invoiceReplyOpensInWideRHP

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Tapping the "1 reply" link on an invoice preview opened the invoice report full-screen in the central pane, while tapping the invoice preview card itself opens the same report in the wide RHP. The two entry points on the same card disagreed.

navigateToAndOpenChildReport gates the wide-RHP route on isMoneyRequestReport(report), which is defined as isIOUReport(report) || isExpenseReport(report). An invoice report has type === CONST.REPORT.TYPE.INVOICE, so it fails that guard, hits the !isMoneyRequest early return, and navigates via REPORT_WITH_ID — also losing the shouldScrollToLatest flag.

This adds invoice reports to the guard, matching the pairing the codebase already uses in shouldReportAlignToTop (isMoneyRequestReport(report) || isInvoiceReport(report)) and matching what the invoice preview card already does in MoneyRequestReportPreview (which navigates to EXPENSE_REPORT_RHP with no report-type guard at all).

Note: this is an incomplete rollout rather than a regression — before #99165 every child report went to the central pane, so invoices behave the same on production. #99165 moved IOU/expense to the wide RHP and left invoices behind, which is what made the inconsistency visible.

Link.ts and ParentNavigationSubtitle.tsx have the same isMoneyRequestReport-only guard for the same wide-RHP route, so an invoice reached via a report link or the parent-report subtitle likely has the same problem. Those are deliberately left out of this PR to keep it minimal and are worth a follow-up.

Fixed Issues

$ #99967
PROPOSAL: #99967 (comment)

Tests

// TODO: The human co-author must fill out the tests they ran before marking this PR as "ready for review".

Suggested manual steps (not yet run by a human — browser verification was blocked by a test-infrastructure failure, see below):

  1. Enable the Invoice feature.
  2. Open FAB > Send invoice, and send an invoice to any user.
  3. Open the invoice report and send a message in it.
  4. Go back to the chat containing the invoice preview.
  5. Click "1 reply" on the invoice preview.
  6. On a wide layout, verify the invoice report opens in the wide RHP (chat still visible behind it), scrolled to the latest message — not full-screen in the central pane.
  7. On a narrow layout, verify it opens in the full report view, scrolled to the latest message.
  8. Regression: verify "X replies" on a regular expense preview still opens in the wide RHP.
Automated checks Melvin ran
  • npm test -- tests/actions/ReportTest.ts — 287 passed (includes 2 new invoice cases; both fail on main without this change and pass with it)
  • npm run lint-changed — passed
  • npm run typecheck — passed
  • npm run spell-changed — passed

Browser verification via the automated web tester could not be completed: the pre-started session rendered a blank page (0 accessibility nodes, no recorded network activity) despite a healthy dev server, so none of the invoice steps could be driven. This is a test-infra failure, not a product finding.

  • Verify that no errors appear in the JS console

Offline tests

// TODO: The human co-author must fill this out. This change only affects client-side navigation routing and makes no API calls, so behavior should be identical offline.

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

Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
@sobitneupane

Copy link
Copy Markdown
Contributor

@MelvinBot Could you please update the PR Author Checklist and tick off all the items? I have checked them all.

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.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Web test results — partial pass

The routing change works. On a wide layout, clicking "1 Reply" on an invoice preview now opens the invoice report in the wide RHP with the chat still visible behind it — not full-screen in the central pane. On a narrow layout it opens the full report view. The regular-expense regression path still opens in the wide RHP.

The "scrolled to the latest message" half of steps 6 and 7 could not be confirmed. The money-request report RHP renders anchored at the top of the action list in this dev-web build — identically for invoices, for the regular-expense baseline, and whether opened from the replies link or the preview body. So there is no invoice-specific difference, but shouldScrollToLatest has no observable effect here. Worth a human check.

Step Status Observation
1. Enable the Invoice feature ✅ pass Workspace > More features > Earn > Invoices toggled on. Toggle renders ON, an "Invoices" item with a €0.00 balance appears in the workspace nav, and #admins posts "enabled invoicing".
2. FAB > Send invoice to any user ✅ pass After enabling Invoices, the FAB gained a "Send invoice" entry (absent before). Sent €42.00 to a test recipient; the workspace Invoices search shows "Sep 1 · Outstanding · €42.00".
3. Open the invoice report and send a message ✅ pass "View" opened the invoice report (Outstanding, From workspace & recipient). Composer accepted a message; 10 more sent successfully.
4. Go back to the chat with the invoice preview ✅ pass The preview gained a "1 Reply" button (later "11 Replies" after more messages).
5. Click "1 reply" on the invoice preview ✅ pass Navigated straight into the invoice report — no error or not-found state.
6a. Wide layout: opens in the wide RHP, chat visible behind, not full-screen ✅ pass At 1280x900 the report renders as an RHP overlay at x≈440-1280, with the dimmed invoice chat and the LHN still visible behind it.
6b. Wide layout: scrolled to the latest message ❌ fail With 11 thread messages the RHP opened top-anchored — msg 8-10 clipped below the composer. Wheel scrolling the pane was a no-op. Same top-anchored render for the regular expense report, so no invoice-specific regression.
7. Narrow layout: full report view, scrolled to latest ⚠️ partial At 500x800 "11 Replies" opened the report full-screen with no RHP overlay — correct per the narrow branch. Scroll position again top-anchored (msg 4-10 clipped).
8. Regression: "X replies" on an expense preview still opens in the wide RHP ✅ pass Created a €77.00 manual expense, sent 11 messages, clicked "11 Replies": expense report opened in the wide RHP overlay with chat and LHN behind, Submit/More header intact.

No console errors were collected — console capture is outside the web driver's scope.

Incidental observations (not caused by this diff)

  • On the first send attempt, the in-flow Company info step accepted a scheme-less website (melvin-test.example.com) client-side, but the backend rejected it: "Unexpected error sending this invoice. Please try again later. Company website is invalid", plus "Unexpected error creating this chat" with a Fix badge in the LHN. Re-selecting that same recipient later rendered an RHP "Hmm... it's not here" not-found page. Setting Workspace > Invoices > Invoicing details with a full https:// URL and sending to a fresh recipient worked cleanly.
  • The money-request report thread pane did not respond to wheel scrolling at all in either layout, which is why the scroll-to-latest assertion could only be judged from the initially rendered window.
Screenshots (13)

Invoices toggle OFF before enabling (baseline)

Invoices toggle OFF before enabling (baseline)

Workspace More features with Invoices toggle ON and Invoices nav item

Workspace More features with Invoices toggle ON and Invoices nav item

First invoice attempt left in error state (Company website is invalid)

First invoice attempt left in error state (Company website is invalid)

Workspace Invoices search showing the sent €42.00 outstanding invoice

Workspace Invoices search showing the sent EUR 42.00 outstanding invoice

Invoice chat with invoice preview after sending

Invoice chat with invoice preview after sending

Message sent inside the invoice report

Message sent inside the invoice report

Invoice preview in chat showing the "1 Reply" link

Invoice preview in chat showing the 1 Reply link

Wide layout: "1 Reply" opens the invoice report in the wide RHP with chat behind

Wide layout: 1 Reply opens the invoice report in the wide RHP with chat behind

Wide RHP invoice report with 11 replies, top-anchored

Wide RHP invoice report with 11 replies, top-anchored

Narrow layout invoice chat with "11 Replies" link

Narrow layout invoice chat with 11 Replies link

Narrow layout: invoice report opens in the full report view

Narrow layout: invoice report opens in the full report view

Regression: expense preview "11 Replies" opens the expense report in the wide RHP

Regression: expense preview 11 Replies opens the expense report in the wide RHP

Expense report opened from the preview body — identical top-anchored scroll position

Expense report opened from the preview body - identical top-anchored scroll position

view run

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Done — all 36 items in the PR Author Checklist are now ticked. Everything else in the description is byte-identical; I only changed the checkbox characters in that section.

Three things you may want to look at before this leaves draft:

  1. Two checkboxes outside the checklist are still unchecked — the Verify that no errors appear in the JS console items under Tests and under QA Steps. Your quoted list didn't include them, so I left them alone. Say the word and I'll tick those too.
  2. The Tests, Offline tests, and QA Steps sections still carry // TODO: The human co-author must fill this out placeholders, and QA Steps has no steps at all. That reads as inconsistent with the now-ticked "I added steps for local testing / offline behavior / Staging and Production testing" items, and the empty QA Steps will need either real steps or [No QA] in the title.
  3. The scroll-to-latest assertion is still unproven. My web run earlier today confirmed the routing fix — wide layout opens the invoice report in the wide RHP, narrow opens the full report view, and the expense regression path is fine — but the report pane rendered top-anchored rather than scrolled to the latest message. That happened identically for the regular-expense baseline, so it is not invoice-specific, though it does mean shouldScrollToLatest had no observable effect in that environment. Worth a second look if you have a real device handy.

view run

@sobitneupane

Copy link
Copy Markdown
Contributor

I am not sure if we want to scroll it down if there is only one expense and we open the expense directly instead of the expense report. Asked here

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

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-09-01.at.17.25.57.mov
Android: mWeb Chrome
Screen.Recording.2026-09-01.at.17.13.25.mov
iOS: HybridApp
iOS: mWeb Safari
Screen.Recording.2026-09-01.at.17.48.12.mov
MacOS: Chrome / Safari
Screen.Recording.2026-09-01.at.16.52.55.mov

@sobitneupane

Copy link
Copy Markdown
Contributor

@MelvinBot Can we scroll the user to the bottom for one-expense report view as well, just like we do for multi-expense reports?

…ies link

Only MoneyRequestReportActionsList honored shouldScrollToLatest, and a report
holding a single expense renders ReportActionsList instead, which is actively
pinned to the top for money-request and invoice reports. Honor the param in
useReportActionsScroll so both views land on the latest message.

Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Claude's API is currently overloaded (HTTP 529). This is a temporary issue on Anthropic's side. Try again in a few minutes, or check status.anthropic.com.

Run details

@sobitneupane

Copy link
Copy Markdown
Contributor

@MelvinBot Mark this PR ready for review.

@MelvinBot
MelvinBot marked this pull request as ready for review September 1, 2026 16:04
@MelvinBot
MelvinBot requested a review from a team as a code owner September 1, 2026 16:04
@melvin-bot
melvin-bot Bot requested review from sobitneupane and removed request for a team September 1, 2026 16:04
@melvin-bot

melvin-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

@sobitneupane 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 joekaufmanexpensify and removed request for a team September 1, 2026 16:04
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Done — this PR is now marked ready for review.

Two things still need a human before merge:

  • The Tests, Offline tests, and QA Steps sections still carry // TODO placeholders. I can't fill those out on a person's behalf.
  • The web test run confirmed the routing fix on both wide and narrow layouts, but the "scrolled to the latest message" assertion could not be verified — the report pane opens top-anchored in the dev-web build, identically for invoices and for the regular-expense baseline. Not invoice-specific, but worth a manual check.

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: ef4cac9b62

ℹ️ 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/libs/actions/Report/index.ts Outdated
// These reports open scrolled to the top. Opening from the "X Replies" link should instead land on the latest
// message, so we append the shouldScrollToLatest flag for the money-request branches.
const isMoneyRequest = isMoneyRequestReport(report);
const isMoneyRequest = isMoneyRequestReport(report) || isInvoiceReport(report);

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 Preserve invoice classification when the child is uncached

When an invoice child report is not already present in Onyx, createChildReport() returns an optimistic report whose type is always CHAT, so this predicate is false even when parentReportAction.childType identifies an invoice. Tapping the replies link in that cache-miss/offline state therefore takes the SEARCH_REPORT/REPORT_WITH_ID branch without shouldScrollToLatest, and the later report fetch does not move it into the wide expense RHP. Include the parent action's child type when classifying the destination (and avoid overwriting the cached type with the optimistic chat type) so invoice links work before their report data is loaded.

Useful? React with 👍 / 👎.

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 tested it but could not reproduce the issue. Even if it is reproducible, it seems to be a one-off case, so I think we can ignore it for now.

Comment thread src/hooks/useReportActionsScroll.ts Outdated

// A report opened from the "X Replies" link should land on the latest message, which is the opposite of the
// align-to-top mount that money-request and invoice reports normally get. Multi-expense reports get this from
// MoneyRequestReportActionsList; a report holding a single expense renders this list instead, so it has to honor

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-16 (docs)

This newly added comment joins two independent clauses with a semicolon (MoneyRequestReportActionsList; a report holding a single expense renders this list instead). Comments should read as plain sentences, and a semicolon should be split into two separate sentences.

Suggested fix:

// align-to-top mount that money-request and invoice reports normally get. Multi-expense reports get this from
// MoneyRequestReportActionsList. A report holding a single expense renders this list instead, so it has to honor
// the same route param. The value is latched on mount because clearing the param below must not flip the list

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Valid flag — applied the suggested fix in 1a6f664. The semicolon is now a period, so MoneyRequestReportActionsList. and A report holding a single expense renders this list instead... read as two separate sentences.

Comment thread src/libs/actions/Report/index.ts Outdated
// ParentNavigationSubtitle. Other child reports keep the standard SEARCH_REPORT / REPORT_WITH_ID navigation.
// A money-request/expense/invoice child report must open in the wide/super-wide RHP (SEARCH_MONEY_REQUEST_REPORT in
// the Search context, EXPENSE_REPORT_RHP in the inbox), mirroring how report links are routed in Link.ts and
// ParentNavigationSubtitle. Invoice reports render in that same wide RHP — the invoice preview card already opens

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-16 (docs)

This newly added comment uses em dashes to set off a parenthetical clause (render in that same wide RHP — the invoice preview card already opens them there — so they must pass this guard too). Comments should read as plain sentences without em dashes.

Suggested fix (rewrite without dashes):

// ParentNavigationSubtitle. Invoice reports render in that same wide RHP, and the invoice preview card already opens
// them there, so they must pass this guard too, which isMoneyRequestReport (IOU || Expense) alone does not do.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Valid flag — applied the suggested fix in 1a6f664. Both em dashes are gone; the parenthetical is now joined with commas: ...render in that same wide RHP, and the invoice preview card already opens them there, so they must pass this guard too...

@sobitneupane

Copy link
Copy Markdown
Contributor

@MelvinBot Could you please check the comments at #100017 (comment) and #100017 (comment)?

Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner September 1, 2026 16:30
@melvin-bot
melvin-bot Bot requested a review from neil-marcellini September 1, 2026 16:30
…ensInWideRHP

Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ MelvinBot CI Fix Loop Detected

MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR.

Next steps: A human should review the recent commits and resolve the conflicting CI errors manually.

MelvinBot and others added 2 commits September 2, 2026 09:15
…hildReport tests

Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
…P' into claude-invoiceReplyOpensInWideRHP

Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
@MelvinBot

MelvinBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Fixed the failing typecheck check — it now passes.

Cause: this branch was behind main. While it sat open, main added a 9th required parameter conciergeChat to navigateToAndOpenChildReport. CI typechecks the merged result, so main's updated call sites had 9 arguments while the two invoice tests this PR added still passed 8:

tests/actions/ReportTest.ts(5794,20): error TS2554: Expected 9 arguments, but got 8.
tests/actions/ReportTest.ts(5817,20): error TS2554: Expected 9 arguments, but got 8.

Fix: merged main into the branch (no conflicts — the new conciergeChat parameter and this PR's isMoneyRequestOrInvoice guard merged cleanly) and passed undefined for conciergeChat in the two new invoice cases, matching every other call site in the file.

Verification
  • npm run typecheck — passed locally, and now passes in CI
  • npm test -- tests/actions/ReportTest.ts tests/unit/useReportActionsScrollTest.tsx — 322 passed
  • npm run lint-changed — passed
  • npm run spell-changed — passed

The push also picked up the Remove unreachable linked-action + shouldScrollToLatest test case commit that landed on the branch in the meantime.

The only remaining failing check is Check independent approval, which just needs a human reviewer — no code change can clear it.


view run · no recording available

@sobitneupane

Copy link
Copy Markdown
Contributor

@MelvinBot Could you please review #100017 (comment) and #100017 (comment) comment as well?

@MelvinBot

MelvinBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

🤖 The remaining test (job 3) failure is unrelated to this PR — it's a calendar-boundary flake that only fires on the 2nd of the month, and today is 2026-09-02. I did not push a fix for it.

The earlier typecheck failure was mine and is already fixed — it now passes.

The failing test: libs/NextStepUtils › buildNextStep › … › scheduled submit enabled › monthly on the 2nd

- Expected  "dateTime": "2026-10-02"
+ Received  "dateTime": "2026-09-02"

Why it fails today: the test and the production code compute "the next 2nd of the month" two different ways, and they only disagree when today's day-of-month equals the offset.

  • Production, src/libs/NextStepUtils.ts:212-215: setDate(new Date(), 2) keeps the current time-of-day, so on the 2nd it returns today. isPast() is false, so no month is added → 2026-09-02.
  • The test's expectation, src/libs/DateUtils.ts:1264-1276: getNextNthOfMonth(2) checks day < nth, which is 2 < 2 → false, so it rolls to next month → 2026-10-02.

Evidence it isn't from this PR:

  • tests/unit/NextStepUtilsTest.ts, NextStepUtils.ts, and DateUtils.ts are byte-identical to main on this branch (git diff origin/main...HEAD on those three paths is empty).
  • This PR only touches src/hooks/useReportActionsScroll.ts, src/libs/actions/Report/index.ts, tests/actions/ReportTest.ts, and tests/unit/useReportActionsScrollTest.tsx — none of which the failing test exercises.
  • It reproduces locally on this branch with the same date diff, driven purely by the system clock.

Suggested follow-up (separate PR): align the two implementations on the boundary day — either have getNextNthOfMonth use day <= nth, or have NextStepUtils normalize to start-of-day before the isPast check. Either way it's a pre-existing bug in main, so it shouldn't block this PR.

Earlier typecheck fix (now passing)

main had added a 9th required parameter conciergeChat to navigateToAndOpenChildReport while this branch was open. CI typechecks the merged result, so main's updated call sites passed 9 arguments while this PR's two new invoice tests still passed 8. I merged main in (no conflicts) and passed undefined for conciergeChat in both cases.

Verified: npm run typecheck passed, tests/actions/ReportTest.ts + tests/unit/useReportActionsScrollTest.tsx — 322 passed, npm run lint-changed and npm run spell-changed passed.

Check independent approval is the only other failing check; it just needs a human reviewer.


view run · no recording available

…Latest param

Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
@MelvinBot

MelvinBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Both valid — addressed in 209f7b2. Comment-only changes, no behavior touched.

Comment Change
r3906390920 — redundant clause Dropped which isMoneyRequestReport (IOU || Expense) alone does not do. The next line of code is isMoneyRequestReport(report) || isInvoiceReport(report), so the clause just restated it. Report/index.ts:2820
r3906410756 — odd "X Replies flag" wording Reworded to name the actual thing cleared, the shouldScrollToLatest route param, rather than the UI link that sets it. useReportActionsScroll.ts:311-313
Checks Melvin ran
  • npm run typecheck — passed
  • npx eslint src/libs/actions/Report/index.ts src/hooks/useReportActionsScroll.ts — 0 errors (30 pre-existing eslint-seatbelt warnings, none on the touched lines)
  • npm test -- tests/actions/ReportTest.ts tests/unit/useReportActionsScrollTest.tsx — 322 passed
  • npm run spell-changed — 0 issues
  • npm run react-compiler-compliance-check -- check src/hooks/useReportActionsScroll.ts — no violations reported. check-changed could not run here because it cannot resolve origin/main in this shallow clone.

No browser run: both edits are code comments, so they cannot change runtime behavior.

Still open from your earlier message: r3906451733, where you asked whether to remove the shouldFocusToTopOnMount test case. Reply on that thread if you want me to take it.


view run · view recording

@melvin-bot
melvin-bot Bot requested a review from neil-marcellini September 2, 2026 09:53
@neil-marcellini

Copy link
Copy Markdown
Contributor

Merging with jest failing because it's caused by this which is totally unrelated.

@neil-marcellini
neil-marcellini merged commit 8593222 into main Sep 2, 2026
42 of 46 checks passed
@neil-marcellini
neil-marcellini deleted the claude-invoiceReplyOpensInWideRHP branch September 2, 2026 15:10
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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

@melvin-bot melvin-bot Bot added the Emergency label Sep 2, 2026
@melvin-bot

melvin-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

@neil-marcellini looks like this was merged without a test passing. These checks had not passed on 209f7b2 when it was merged:

Please add a note explaining why this was done and remove the Emergency label if this is not an emergency.

@m-natarajan

Copy link
Copy Markdown

@sobitneupane @neil-marcellini No QA steps, do we have to validate the Test section?

@OSBotify

OSBotify commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.4.69-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site changes are required for this PR, so I did not create a draft PR.

This change is an internal navigation fix. Clicking the "X replies" link on an invoice preview now opens the invoice report in the wide right-hand panel scrolled to the latest message, matching what the invoice preview card already did. No feature, setting, label, button, or user workflow changed.

What I checked

Files changed — all routing, scroll, and test code:

Articles I searched in docs/articles:

  • new-expensify/reports-and-expenses/Send-an-Invoice.md — covers enabling Invoice, sending an invoice, and receiving payment. It mentions the invoice chat room but never documents where a report opens or how the replies link behaves.
  • new-expensify/wallet-and-payments/Pay-an-invoice.md — payment steps only.
  • new-expensify/chat/Chat-Features-and-Moderation-Tools.md — documents Reply in thread, not the "X replies" link destination.

I also grepped every article for "X replies", "replies link", "right-hand panel", and "side panel". The panel references all describe the Spend page, workspace settings, and expense editing. None describe which pane a report opens in from a preview card.

The help site documents what invoicing does and how to use it, not which pane a report renders in. Since this PR only makes two existing entry points agree with each other, there is no documented behavior to correct.

@sobitneupane, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review


view run

@sobitneupane

Copy link
Copy Markdown
Contributor

No QA steps, do we have to validate the Test section?

@m-natarajan Yes, please.

@neil-marcellini

Copy link
Copy Markdown
Contributor

Not an emergency as noted here.

@OSBotify

OSBotify commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/francoisl in version: 9.4.69-1 🚀

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.

6 participants