You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-08-11] [$250] Spend - First expense row flickers after switching from Inbox to Spend #97154
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
⚠️ Confidence: medium — this is a frontend timing/animation issue. The root cause below is well-supported by code, but the exact re-fire trigger should be confirmed with an in-browser trace before implementing.
What is the root cause of that problem?
The "flicker" is the new-expense highlight animation replaying on the first (newest) row when the Search screen re-renders on navigation back.
Expenses default-sort date desc, so the expense you just created is at index 0 — the first row. Two things combine to make only that row flash when you return from Inbox:
Search is not unmounted on web — it's suspended by react-freeze. Leaving to Inbox freezes the Search subtree; coming back thaws and re-renders it. This is why the bug is web-only (Chrome/Safari) and doesn't repro on native.
On refocus, the Search API is re-fired (Search/index.tsx:373-413), which pulses snapshot.search.isLoading true→false and replaces the snapshot data object. useSearchSnapshot re-runs its projection and re-stamps shouldAnimateInHighlight, and the top row re-renders/remounts while the highlight animation (useAnimatedHighlightStyle, gated on didScreenTransitionEnd) is eligible to replay.
The reason it's the first row specifically: in useSearchHighlightAndScroll.ts:309-317, the new-item handler returns early for index ≤ 0 without resetting triggeredByHookRef, so the highlight machinery is left "armed" only for the top row. Rows below index 0 get the reset; row 0 doesn't.
Supporting evidence & data flow
Highlight flag stamped per-row: useSearchSnapshot.ts:325-342 (shouldAnimateInHighlight = isBaseKeyMatch || isAnyTransactionMatch).
isLoading optimistic/finally pulse on every refetch: Search.ts:692-748. The full-page skeleton is ruled out — isDataLoaded stays true on a warm refocus (index.tsx:338-343), so this is a per-row artifact, not a skeleton swap.
Flow: create expenses → top row highlighted once, but its reset is skipped (index 0) → navigate to Inbox (Search freezes) → navigate back (Search thaws + refetch replaces snapshot data) → top row re-renders while still "armed" → highlight fade replays → flicker.
This is staging-only / not in production, so it's a recent regression (v9.4.45-0). Git history was unavailable in this checkout — a bisect on useSearchHighlightAndScroll.ts, useSearchSnapshot.ts, and the freeze wrapper around the 9.4.45 window would pinpoint the introducing PR.
What changes do you think we should make in order to solve the problem?
Primary (smallest, first-row-specific): in useSearchHighlightAndScroll.ts:309-317, also reset triggeredByHookRef.current = false in the indexOfNewItem <= 0 early-return branch, so the top row can't stay "armed" across an Inbox round-trip.
Defense-in-depth: give the Wide row the same mount-latch behavior as the Narrow row (or pass skipInitialFade once the highlight has already been consumed) in TransactionListItemWide.tsx:145-151, so a react-freeze thaw/remount never replays a stale highlight.
Before implementing, confirm the exact trigger with an in-browser trace (log shouldAnimateInHighlight flips in useSearchSnapshot and the enter effect in useAnimatedHighlightStyle while reproducing Inbox→Spend). This disambiguates "highlight replay" from "pure snapshot-churn remount," which changes which of the two fixes is sufficient.
What alternative solutions did you explore? (Optional)
Skipping/short-circuiting the focus-refetch when snapshot data is unchanged (avoids the row-identity churn entirely), or memoizing row identity so the first row doesn't remount on refocus. These are broader and riskier than the targeted reset above.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/97154) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Classification: Frontend bug Causing PR: #95618 - "[Split #94595] Batch C - Remove useOnyx deps from Search" by @fabioh8010 (Medium confidence) Related Issues: none
Recommendation: REVERT
Two staging-only Search-performance refactors landed on 2026-07-24 (this 9.4.45-0 window) and both perturb the exact re-render/snapshot machinery that gates the first-row highlight animation. #95618 is the more likely trigger because it removes the useOnyx dependency arrays from the transaction-row selectors, making their results recompute to new references on every render and amplifying the top row's re-render when Search thaws from react-freeze and refetches on refocus — replaying the highlight fade. Revert #95618 first and re-test; if the flicker persists, revert #96642 next.
Assigned: @fabioh8010 (PR author), @hoangzinh and @mountiny (approving reviewers) from the highest-confidence causing PR (#95618) Labels: No change. DeployBlockerCash kept (this is a frontend bug that blocks the App deploy). DeployBlocker was not present, so nothing to remove. Never removing both / keeping the App blocker since an App PR caused it.
📋 Detailed Analysis
Evidence
The bug is web-only (Chrome/Safari, not native) and staging-only (not production) — a regression newly introduced in the 9.4.45-0 window. Web-only + "first row re-renders and the highlight fade replays" points at the interaction between the desktop-web react-freeze suspend/thaw on the Search screen and the per-row highlight (useAnimatedHighlightStyle, gated on item.shouldAnimateInHighlight).
I bisected via the GitHub API (local App checkout is a shallow clone). The production...staging compare shows exactly two staging-only PRs touching the Search highlight/snapshot/row path:
#95618 by @fabioh8010, merged 2026-07-24T17:00Z. Removes the useOnyx dependency arrays from Search row selectors, including in src/components/Search/SearchList/ListItem/TransactionListItem/index.tsx — the parent of the highlight-carrying TransactionListItemWide. Selectors like personalDetailsLoginSelector(...) and the inline parentReportAction selector build a fresh object each call; without the deps array their memoization is weakened, so they return new references and re-render the row more aggressively.
#96642 by @TMisiukiewicz (callstack), merged 2026-07-24T09:09Z. Modifies src/components/Search/hooks/useSearchSnapshot.ts (the hook that stamps shouldAnimateInHighlight per row) by gating reportAttributesDerivedValue out of the getSections deps for non-chat/task types. This changes when the snapshot data object / getSections recomputes on the expenses view, i.e. it alters row-identity churn on refocus. This is a memoization change and would generally reduce recomputes, so I rank it below [Split #94595] Batch C - Remove useOnyx deps from Search #95618.
I explicitly ruled out the two highlight PRs that first looked suspicious:
src/hooks/useSearchHighlightAndScroll.ts (the indexOfNewItem <= 0 early-return that doesn't reset triggeredByHookRef) has had no substantive change since May and is in production, so it is a latent contributor, not the regression source.
Verification
Affected feature files that changed staging-only (from gh api repos/Expensify/App/compare/production...staging): src/components/Search/hooks/useSearchSnapshot.ts, src/components/Search/SearchList/ListItem/TransactionListItem/index.tsx, TransactionListItemNarrow.tsx.
Confirmed [Split #94595] Batch C - Remove useOnyx deps from Search #95618 modifies TransactionListItem/index.tsx (removes the deps arg on submitterLogin and parentReportAction selectors) — this is the parent component of TransactionListItemWide, which owns the useAnimatedHighlightStyle fade gated on shouldHighlight: item?.shouldAnimateInHighlight.
Both merge dates (2026-07-24) fall inside the 9.4.45-0 checklist (dated 2026-07-27) and both appear in the production...staging commit set.
Root Cause
The newest (index 0) expense row carries shouldAnimateInHighlight = true and, per the pre-existing useSearchHighlightAndScroll.ts index≤0 early-return, its highlight machinery is never reset. On desktop web the Search subtree is suspended by react-freeze when navigating to Inbox and thawed on return, and the Search API re-fires on refocus (replacing the snapshot). The staging-only selector-stability regression in #95618 (deps-array removal) makes the transaction row re-render with new selector references during that thaw+refetch, remounting TransactionListItemWide while shouldHighlight is still true — so the opacity 0→1 fade replays on the first row only, producing the flicker. #96642's getSections recompute-gating change is a plausible secondary contributor to the same row-identity churn.
@yusufdeveloper2903 can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal. https://www.upwork.com/jobs/~022082212781202898180
Activity
applause-bot commentedon Jul 27, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/1b316999ca99c78fa379430275670bbebd27169747f745314574044acd751d3e
melvin-bot commentedon Jul 27, 2026
Triggered auto assignment to @marcochavezf (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Jul 27, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jul 27, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
MelvinBot commentedon Jul 27, 2026
Proposal
What is the root cause of that problem?
The "flicker" is the new-expense highlight animation replaying on the first (newest) row when the Search screen re-renders on navigation back.
Expenses default-sort
date desc, so the expense you just created is at index 0 — the first row. Two things combine to make only that row flash when you return from Inbox:react-freeze. Leaving to Inbox freezes the Search subtree; coming back thaws and re-renders it. This is why the bug is web-only (Chrome/Safari) and doesn't repro on native.Search/index.tsx:373-413), which pulsessnapshot.search.isLoadingtrue→false and replaces the snapshot data object.useSearchSnapshotre-runs its projection and re-stampsshouldAnimateInHighlight, and the top row re-renders/remounts while the highlight animation (useAnimatedHighlightStyle, gated ondidScreenTransitionEnd) is eligible to replay.The reason it's the first row specifically: in
useSearchHighlightAndScroll.ts:309-317, the new-item handler returns early for index ≤ 0 without resettingtriggeredByHookRef, so the highlight machinery is left "armed" only for the top row. Rows below index 0 get the reset; row 0 doesn't.Supporting evidence & data flow
useSearchSnapshot.ts:325-342(shouldAnimateInHighlight = isBaseKeyMatch || isAnyTransactionMatch).shouldHighlight=truereplays a full opacity 0→1 fade:TransactionListItemWide.tsx:145-151vs the latchedTransactionListItemNarrow.tsx:86-108.isLoadingoptimistic/finally pulse on every refetch:Search.ts:692-748. The full-page skeleton is ruled out —isDataLoadedstays true on a warm refocus (index.tsx:338-343), so this is a per-row artifact, not a skeleton swap.Flow: create expenses → top row highlighted once, but its reset is skipped (index 0) → navigate to Inbox (Search freezes) → navigate back (Search thaws + refetch replaces snapshot data) → top row re-renders while still "armed" → highlight fade replays → flicker.
This is staging-only / not in production, so it's a recent regression (v9.4.45-0). Git history was unavailable in this checkout — a bisect on
useSearchHighlightAndScroll.ts,useSearchSnapshot.ts, and the freeze wrapper around the 9.4.45 window would pinpoint the introducing PR.What changes do you think we should make in order to solve the problem?
Primary (smallest, first-row-specific): in
useSearchHighlightAndScroll.ts:309-317, also resettriggeredByHookRef.current = falsein theindexOfNewItem <= 0early-return branch, so the top row can't stay "armed" across an Inbox round-trip.Defense-in-depth: give the Wide row the same mount-latch behavior as the Narrow row (or pass
skipInitialFadeonce the highlight has already been consumed) inTransactionListItemWide.tsx:145-151, so a react-freeze thaw/remount never replays a stale highlight.Before implementing, confirm the exact trigger with an in-browser trace (log
shouldAnimateInHighlightflips inuseSearchSnapshotand the enter effect inuseAnimatedHighlightStylewhile reproducing Inbox→Spend). This disambiguates "highlight replay" from "pure snapshot-churn remount," which changes which of the two fixes is sufficient.What alternative solutions did you explore? (Optional)
Skipping/short-circuiting the focus-refetch when snapshot data is unchanged (avoids the row-identity churn entirely), or memoizing row identity so the first row doesn't remount on refocus. These are broader and riskier than the targeted reset above.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/97154)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
MelvinBot commentedon Jul 27, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #95618 - "[Split #94595] Batch C - Remove useOnyx deps from Search" by @fabioh8010 (Medium confidence)
Related Issues: none
Recommendation: REVERT
Two staging-only Search-performance refactors landed on 2026-07-24 (this 9.4.45-0 window) and both perturb the exact re-render/snapshot machinery that gates the first-row highlight animation. #95618 is the more likely trigger because it removes the
useOnyxdependency arrays from the transaction-row selectors, making their results recompute to new references on every render and amplifying the top row's re-render when Search thaws fromreact-freezeand refetches on refocus — replaying the highlight fade. Revert #95618 first and re-test; if the flicker persists, revert #96642 next.Assigned: @fabioh8010 (PR author), @hoangzinh and @mountiny (approving reviewers) from the highest-confidence causing PR (#95618)
Labels: No change.
DeployBlockerCashkept (this is a frontend bug that blocks the App deploy).DeployBlockerwas not present, so nothing to remove. Never removing both / keeping the App blocker since an App PR caused it.📋 Detailed Analysis
Evidence
The bug is web-only (Chrome/Safari, not native) and staging-only (not production) — a regression newly introduced in the 9.4.45-0 window. Web-only + "first row re-renders and the highlight fade replays" points at the interaction between the desktop-web
react-freezesuspend/thaw on the Search screen and the per-row highlight (useAnimatedHighlightStyle, gated onitem.shouldAnimateInHighlight).I bisected via the GitHub API (local App checkout is a shallow clone). The
production...stagingcompare shows exactly two staging-only PRs touching the Search highlight/snapshot/row path:#95618 by @fabioh8010, merged 2026-07-24T17:00Z. Removes the
useOnyxdependency arrays from Search row selectors, including insrc/components/Search/SearchList/ListItem/TransactionListItem/index.tsx— the parent of the highlight-carryingTransactionListItemWide. Selectors likepersonalDetailsLoginSelector(...)and the inlineparentReportActionselector build a fresh object each call; without the deps array their memoization is weakened, so they return new references and re-render the row more aggressively.#96642 by @TMisiukiewicz (callstack), merged 2026-07-24T09:09Z. Modifies
src/components/Search/hooks/useSearchSnapshot.ts(the hook that stampsshouldAnimateInHighlightper row) by gatingreportAttributesDerivedValueout of thegetSectionsdeps for non-chat/task types. This changes when the snapshot data object /getSectionsrecomputes on the expenses view, i.e. it alters row-identity churn on refocus. This is a memoization change and would generally reduce recomputes, so I rank it below [Split #94595] Batch C - Remove useOnyx deps from Search #95618.I explicitly ruled out the two highlight PRs that first looked suspicious:
useNewTransactions.ts/Search/index.tsxchanges are already in production, so it cannot be this staging-only regression.src/hooks/useSearchHighlightAndScroll.ts(theindexOfNewItem <= 0early-return that doesn't resettriggeredByHookRef) has had no substantive change since May and is in production, so it is a latent contributor, not the regression source.Verification
gh api repos/Expensify/App/compare/production...staging):src/components/Search/hooks/useSearchSnapshot.ts,src/components/Search/SearchList/ListItem/TransactionListItem/index.tsx,TransactionListItemNarrow.tsx.TransactionListItem/index.tsx(removes the deps arg onsubmitterLoginandparentReportActionselectors) — this is the parent component ofTransactionListItemWide, which owns theuseAnimatedHighlightStylefade gated onshouldHighlight: item?.shouldAnimateInHighlight.useSearchSnapshot.ts(the file that stampsshouldAnimateInHighlight).production...stagingcommit set.Root Cause
The newest (index 0) expense row carries
shouldAnimateInHighlight = trueand, per the pre-existinguseSearchHighlightAndScroll.tsindex≤0 early-return, its highlight machinery is never reset. On desktop web the Search subtree is suspended byreact-freezewhen navigating to Inbox and thawed on return, and the Search API re-fires on refocus (replacing the snapshot). The staging-only selector-stability regression in #95618 (deps-array removal) makes the transaction row re-render with new selector references during that thaw+refetch, remountingTransactionListItemWidewhileshouldHighlightis still true — so the opacity 0→1 fade replays on the first row only, producing the flicker. #96642'sgetSectionsrecompute-gating change is a plausible secondary contributor to the same row-identity churn.51 remaining items
melvin-bot commentedon Aug 10, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Aug 10, 2026
Payment Summary
Resolving PRs:
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Aug 13, 2026
Payment Summary
Contributor: @yusufdeveloper2903 paid $250 via Upwork
Contributor+: @hoangzinh due $250 via NewDot
@yusufdeveloper2903 can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal.
https://www.upwork.com/jobs/~022082212781202898180
^ Test case created. Thx
yusufdeveloper2903 commentedon Aug 13, 2026
@mallenexpensify Thanks! I've accepted the job offer on Upwork
mallenexpensify commentedon Aug 13, 2026
@yusufdeveloper2903 paid, summary updated above. Thx.
laurenreidexpensify commentedon Aug 25, 2026
$250 approved @hoangzinh