Skip to content

Perf: check the Submit badge before the Mark as done check in LHN rows #108605

Todo

Description

@mountiny

Problem

Every LHN row decides whether to show the "Mark as done" copy. OptionRowLHNContent calls shouldShowMarkAsDone before it checks actionBadge === CONST.REPORT.ACTION_BADGE.SUBMIT.

For users who chose to track expenses and use a Submit & Close workspace, shouldShowMarkAsDone passes its cheap checks for each of their own reports. It then calls getNextApproverAccountID, which scans all approval rules through getSubmitToEmail and reads personal details. This runs on every render of every such row. Only draft reports have the Submit badge, so the result is thrown away for most rows.

This is a follow-up to Perf: check cheap conditions before expensive ones in report, option list, and bulk action paths, found in a second scan of src/.

Expected outcome

  • Check the Submit badge first, so shouldShowMarkAsDone runs only for rows that show the Submit badge.
  • Keep every result unchanged. The change only reorders two checks that have no side effects.
  • Cover the change with a test that fails if shouldShowMarkAsDone runs for a row without the Submit badge.

Pull requests

Activity

  1. self-assigned this
    on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions