Skip to content

Move LHN row data reads into the rows - #86

Draft
sosek108 wants to merge 764 commits into
feature/onyx-store-pr-5-recutfrom
perf/3039-lhn-item-level-useonyx
Draft

sosek108 wants to merge 764 commits into
feature/onyx-store-pr-5-recutfrom
perf/3039-lhn-item-level-useonyx

Conversation

@sosek108

Copy link
Copy Markdown

Explanation of Change

This targets the Onyx store bump in Expensify#98956.

LHNOptionsList subscribed to the whole report and policy collections, the report attributes and personal details, looked up each row's policy, invoice receiver policy and one-transaction-thread report, and passed them down. Those collections were also in extraData, so a write to any report or policy re-rendered every visible row.

Rows now read their own policy, invoice receiver policy and one-transaction-thread report by member key, and their own report attributes entry. Personal details come from the existing OnyxListItemProvider context. The alternate text still needs the names of other reports (moved or last-action reports), so the list builds one report-name map with a selector, whose reference only changes when a name changes. getOptionData and the alternate text helpers now only require reportName from that map. extraData is down to the list length, the option mode and the network state.

A new reassure test with 500 reports runs unchanged on the base and on this branch. A write to one report goes from 158.8 ms to 97.2 ms, and a write to a policy no row uses goes from 85.7 ms to 70.4 ms (28 to 18 renders). Mount and row press are unchanged.

Known issue: SidebarOrderTest "reorders the reports to always have the most recently updated one on top" fails. FlashList doesn't re-run renderItem when only an item's index changes, so the index-based DisplayNames-<index> testID goes stale after a reorder, while the order on screen is correct. Before, every report write changed extraData, which refreshed it.

Fixed Issues

$ https://github.com/callstack-internal/expensify-issues/issues/3039
PROPOSAL:

Tests

  1. Sign in to an account with several chats, workspace chats and an expense report in the LHN.
  2. Send a message in one chat. Verify the chat moves to the top with the new message preview, and the other rows keep their names, avatars and previews.
  3. Rename a workspace. Verify its workspace chat rows show the new name.
  4. Open an invoice room and an expense report with a single expense. Verify their LHN rows show the right name, avatar and preview.
  5. Pin and unpin a chat. Verify the order updates.
  6. Switch between Most recent and Focus mode. Verify the list renders correctly in both.
  • Verify that no errors appear in the JS console

Offline tests

  1. Go offline.
  2. Send a message in a chat. Verify the row updates with the pending message.
  3. Go back online. Verify the row stays correct.

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 verified any copy / text that was added to the app 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 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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

LukasMod and others added 30 commits October 13, 2026 12:06
…ydrationGuard

Co-authored-by: huult <huult@users.noreply.github.com>
…itedPathForPublicDomain

Co-authored-by: huult <huult@users.noreply.github.com>
…ButtonMessageBlocksAddWorkEmail

Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
jasperhuangg and others added 30 commits October 14, 2026 13:28
…survey-feedback

[Payment due @mkhutornyi] Acknowledge support survey reactions
…atch-4

[No QA] Remove 'group-by:report' example from documentation
…ompanyWorkspace

[No QA] Docs updates for E/A#99833 Add Join my company workspace option to help article
…teClearAfter

Co-authored-by: Kevin Brian Bader <ikevin127@users.noreply.github.com>
…TypeGuard

[Payment due @Krishna2323] Keep the rule editor's form when Describe returns another rule type
…loyeesInWorkflowBuilders

Skip null employeeList entries in the Workspaces tab red-dot check
…deHydrationGuard

[No QA] [Payment due @huult] Stop routing group workspace members to the reports upgrade screen
usePolicyForMovingExpenses now reads the load status that useOnyx
returns for the policy collection, and passes it to isLoadingOnyxValue.
The SearchColumnsPage test mocked useOnyx to return only the value, so
the metadata was undefined and the test crashed on main with
"Cannot read properties of undefined (reading 'status')".

Return a loaded status from the mock, as the real hook does.
…h-columns-page-test

[NoQA] Fix `SearchColumnsPageTest`
…egateClearAfter

Add a clear after date to vacation delegates and show them on the Profile page
…rt-ticket-title

[Payment due @ikevin127] [CP stag] Show the support ticket title while creation is pending
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.