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
[HOLD 79160] Reports - Category row auto expands with empty expense after creating expense #80673
Version Number: 9.3.10-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#80333 Email or phone of affected tester (no customers):jsoidjnosdiodsjnosjnois@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.1 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Create a new account.
Create a workspace.
Go to Reports > Top categories.
Open FAB > Create expense > Manual.
Create a manual expense with date from last month and any category.
Expand the category row.
Open FAB > Create expense > Manual.
Create a manual expense with date from last month and DIFFERENT category.
Expected Result:
The new category row will expand and show the expense.
Actual Result:
The new category row expands and does not show the expense.
The same issue happens on Top spenders.
Please re-state the problem that we are trying to solve in this issue.
When viewing Reports > Top categories (or Top spenders), creating a new expense with a different category causes the new category row to expand but show empty content instead of displaying the newly created expense.
What is the root cause of that problem?
The root cause is in TransactionGroupListItem.tsx. When a new transaction is created that belongs to a category group, the component receives a newTransactionID prop indicating which transaction is new. However, the row does not automatically expand when this happens.
Looking at the code in /Users/user/Documents/GitHub/App/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx:
Line 103: The isExpanded state is initialized as false:
const[isExpanded,setIsExpanded]=useState(false);
Lines 190-195: The effect that fetches transaction data only runs when BOTH newTransactionID exists AND isExpanded is true:
Lines 107-139: The transactions array relies on transactionsSnapshot?.data which is populated by searchTransactions():
consttransactions=useMemo(()=>{if(isExpenseReportType){returngroupItem.transactions;}if(!transactionsSnapshot?.data){return[];// Returns empty if snapshot not loaded}// ... process data},[...]);
The problem flow:
User creates a new expense with a different category
The newTransactionID prop is passed to the matching TransactionGroupListItem
The item's shouldAnimateInHighlight flag is set to true (for visual highlighting)
But isExpanded remains false since the row was never expanded before
The effect at lines 190-195 exits early because isExpanded is false
searchTransactions() is never called
transactionsSnapshot remains undefined
When the row visually appears expanded (via animation/highlighting), transactions is an empty array
The user sees an empty expanded row
There is no logic to automatically expand the row when newTransactionID is detected.
What changes do you think we should make in order to solve the problem?
Add an effect in TransactionGroupListItem.tsx that automatically expands the row and triggers a search when a newTransactionID is detected for non-expense-report types (category groups, spender groups, etc.).
The fix should be added after line 195 in /Users/user/Documents/GitHub/App/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx:
// Auto-expand and fetch transactions when a new transaction is detected for this groupuseEffect(()=>{if(!newTransactionID||isExpenseReportType||isExpanded){return;}// Expand the row to show the new transactionsetIsExpanded(true);// Trigger search to load the transaction dataif(groupItem.transactionsQueryJSON){searchTransactions();}},[newTransactionID,isExpenseReportType,isExpanded,groupItem.transactionsQueryJSON,searchTransactions]);
This effect:
Only triggers when newTransactionID is present (a new transaction matches this group)
Skips expense report types (they already have transactions in groupItem.transactions)
Skips if already expanded (prevents re-triggering)
Expands the row via setIsExpanded(true)
Calls searchTransactions() to fetch the transaction data
After this fix:
When a new expense is created with a different category, the category row will automatically expand
The searchTransactions() call will populate transactionsSnapshot with the transaction data
The user will see the newly created expense displayed in the expanded row
What alternative solutions did you explore? (Optional)
⚠️@yatin-italy Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
Grouped search rows do not get a stable keyForList. In SearchList, the fallback key is the list index when keyForList is missing. When the data updates (e.g., a new category group is inserted because of a new expense), React reuses the existing row component instance by index. That causes the isExpanded state from the previously expanded row to “move” to a different group.
The new row looks expanded but its transactions snapshot was never fetched (no explicit expand action for that group), so it renders empty. This only shows up when another row is expanded because that’s when there is state to be reused across rows.
What changes do you think we should make in order to solve the problem?
Assign stable keys to grouped items so React doesn’t reuse expansion state across different groups.:
Activity
melvin-bot commentedon Jan 27, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (
External)melvin-bot commentedon Jan 27, 2026
Triggered auto assignment to @JmillsExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.MobileMage commentedon Jan 27, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When viewing Reports > Top categories (or Top spenders), creating a new expense with a different category causes the new category row to expand but show empty content instead of displaying the newly created expense.
What is the root cause of that problem?
The root cause is in
TransactionGroupListItem.tsx. When a new transaction is created that belongs to a category group, the component receives anewTransactionIDprop indicating which transaction is new. However, the row does not automatically expand when this happens.Looking at the code in
/Users/user/Documents/GitHub/App/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx:Line 103: The
isExpandedstate is initialized asfalse:Lines 190-195: The effect that fetches transaction data only runs when BOTH
newTransactionIDexists ANDisExpandedis true:Lines 107-139: The
transactionsarray relies ontransactionsSnapshot?.datawhich is populated bysearchTransactions():The problem flow:
newTransactionIDprop is passed to the matchingTransactionGroupListItemshouldAnimateInHighlightflag is set to true (for visual highlighting)isExpandedremainsfalsesince the row was never expanded beforeisExpandedis falsesearchTransactions()is never calledtransactionsSnapshotremains undefinedtransactionsis an empty arrayThere is no logic to automatically expand the row when
newTransactionIDis detected.What changes do you think we should make in order to solve the problem?
Add an effect in
TransactionGroupListItem.tsxthat automatically expands the row and triggers a search when anewTransactionIDis detected for non-expense-report types (category groups, spender groups, etc.).The fix should be added after line 195 in
/Users/user/Documents/GitHub/App/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx:This effect:
newTransactionIDis present (a new transaction matches this group)groupItem.transactions)setIsExpanded(true)searchTransactions()to fetch the transaction dataAfter this fix:
searchTransactions()call will populatetransactionsSnapshotwith the transaction dataWhat alternative solutions did you explore? (Optional)
github-actions commentedon Jan 27, 2026
M00rish commentedon Jan 28, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-01-28 01:18:55 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Reports - Category row auto expands with empty expense after creating expense
What is the root cause of that problem?
App/src/libs/SearchUIUtils.ts
Lines 2206 to 2212 in a9488e7
Grouped search rows do not get a stable keyForList. In SearchList, the fallback key is the list index when keyForList is missing. When the data updates (e.g., a new category group is inserted because of a new expense), React reuses the existing row component instance by index. That causes the isExpanded state from the previously expanded row to “move” to a different group.
The new row looks expanded but its transactions snapshot was never fetched (no explicit expand action for that group), so it renders empty. This only shows up when another row is expanded because that’s when there is state to be reused across rows.
What changes do you think we should make in order to solve the problem?
Assign stable keys to grouped items so React doesn’t reuse expansion state across different groups.:
And in
TransactionGroupListItem.tsxadd:Or extend already existing useEffect
What alternative solutions did you explore? (Optional)
N/A
6 remaining items
nkdengineer commentedon Feb 3, 2026
@ZhenjaHorbach This PR was merged. Please help to check again
JmillsExpensify commentedon Feb 4, 2026
Things are in progress
ZhenjaHorbach commentedon Feb 11, 2026
@nkdengineer
Are you still able to reproduce?
Looks like we have a bit different UI now
melvin-bot commentedon Feb 19, 2026
@ZhenjaHorbach Still overdue 6 days?! Let's take care of this!
ZhenjaHorbach commentedon Feb 20, 2026
I suppose we can close this issue
Since now we have a different UI
ZhenjaHorbach commentedon Feb 20, 2026
@neil-marcellini
Let's close this issue!
JmillsExpensify commentedon Feb 21, 2026
Works for me!