Skip to content

Move LHN row data reads into the rows - #86

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

sosek108 wants to merge 3306 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

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@sosek108
sosek108 force-pushed the perf/3039-lhn-item-level-useonyx branch from a1a09cd to 6d0036f Compare October 16, 2026 09:14
francoisl and others added 28 commits October 20, 2026 15:21
fix Copilot - Not here page when click Create expense in delegate mode
…8-remove-getReportTransactions-p9

Remove getReportTransactions callers' reliance on the deprecated default in submitReport (Part 9)
…licker-recyclingkey

Key native attachment thumbnails on the attachment ID so they stay on screen after send
…me tests

Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
…ibeRuleAgentFallback

[Payment due @Krishna2323] Describe a rule from New rule and fall back to an agent rule
…-deprecatedAllTransactions-in-hasExpenses

# Conflicts:
#	src/components/ReportActionItem/MoneyReportView.tsx
Co-authored-by: huult <huult@users.noreply.github.com>
…rkspace picker

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

Co-authored-by: cretadn22 <cretadn22@users.noreply.github.com>
…ectEducationalModals

Co-authored-by: daledah <daledah@users.noreply.github.com>
…nModalBatch1

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>

# Conflicts:
#	src/pages/workspace/WorkspaceMembersPage.tsx
…sionModalBatch1

Migrate batch 1 one-button alerts from DecisionModal to useDecisionModal
mollfpr and others added 30 commits October 22, 2026 15:23
…port-name-skeleton-offline

Fix - Android-Expense-Report name shows 'Chat Report' briefly on expense opened offline via growl
…ckerTestCrash

[No QA] Mock useLoadPolicyCategories in CategoryPickerTest to fix failing test
…tReplaceDuringManualExpenseScan

Allow replacing a manual expense receipt while the backend scans it
…/fix-resize-sticky-filter-bar

fix: "Find Member" input and "Filters" button are moved while resizing members table
…sers

[Payment due @nkdengineer] Set user-level office arrangements
…eExpenseReportViewToggle

[CP Staging] Revert "Reapply "Add a More menu option to switch single-expense reports between expense view and table view""
…r-row-onyx-reads

[No QA] Update list-row Onyx rules: PERF-3, PERF-11, new PERF-21 and PERF-22
…x-tab-span-source-tab

[No QA] perf: record source tab and preload wait on the Inbox tab span
…/numeric-input-layout-tests

[No QA] add comprehensive layout and responsiveness tests for NumericInput
cspell rejected "recognise" and failed the spellcheck gate.
The record was added to App.ts's KEYS_TO_PRESERVE, which only guards the
reconnect and full-reset paths. User-initiated sign-out goes through
signOutAndRedirectToSignIn -> redirectToSignIn -> clearStorageAndRedirect,
which clears with KEYS_TO_PRESERVE_ON_SIGN_OUT instead. The record was
therefore wiped on every sign-out and the prompt came back on the next
sign-in, which is the loop this PR is meant to close.

The regression test passed anyway because it cleared Onyx with a
hand-written [APP_REVIEW_LAST_PROMPT] list, so it asserted the gate while
assuming the thing under test. It now clears with the real
KEYS_TO_PRESERVE_ON_SIGN_OUT and fails if the key is dropped from it.
…-prompt-loop

Stop the app review prompt from reappearing after the user answers it
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.