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
Search - Status bar is not preserved and selection is cleared when going from Inbox to Search #47670
Version Number: v9.0.22-5 Reproducible in staging?: Y Reproducible in production?: N Email or phone of affected tester (no customers):applausetester+kh1681@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Precondition:
Account has expenses in Outstanding or Paid tabs.
Launch New Expensify app.
Go to Search.
Go to Outstanding.
Long press on the expense > Select.
Go to Inbox.
Go back to Search.
Expected Result:
App will open Outstanding tab with the selection preserved when going from Search to Inbox and back to Search.
Actual Result:
App opens All tab with the selection cleared when going from Search to Inbox and back to Search.
👋 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.
Please re-state the problem that we are trying to solve in this issue.
The status bar selected item isn't preserved after switching to another bottom tab. This only happens on the small screen.
What is the root cause of that problem?
When we press the search bottom tab, we call getCurrentSearchParams to get the search params from the existing search bottom tab or central pane in the nav stack, then pass it to the new search screen.
This works well on large screen, but not on small screen.
When we go to the search page, the nav stack looks like this:
small: [BottomTab: [Home, SearchBottomTab], SearchCentralPane]
large: [BottomTab: [Home, SearchBottomTab], Report, SearchCentralPane]
Both the search bottom tab and central pane holds the search query (q) params. When we change the status to paid, for example, the query params is only updated to the search central pane.
On the large screen, when we go back to home, the nav stack becomes:
[BottomTab: [Home, SearchBottomTab, Home], Report, SearchCentralPane, Report]
SearchCentralPane is still in the stack with the status query params, so, when we switch back to the search page, getCurrentSearchParams will return the query params with the previous status selected.
But on the small screen, going back to home will pop the search central pane out.
small: [BottomTab: [Home, SearchBottomTab, Home]]
// If the layout is small we need to pop everything from the central pane so the bottom tab navigator is visible.
root.dispatch({
type: 'POP_TO_TOP',
target: rootState.key,
});
So, when we switch back to the search page, getCurrentSearchParams will return the query params from SearchBottomTab which contains the old status query.
What changes do you think we should make in order to solve the problem?
We need to update the bottom tab params too when selecting the status.
I'm also interested in whether this is really a bug? the act of navigating to another screen changes a lot of things and we do reset some things in Search.
Also I don't think anyone was expecting that the selection state persists.
I think the idea is to always reset the user. They can use saved searches (coming in v2.3) to navigate to any custom filters they have if they want to.
Activity
melvin-bot commentedon Aug 19, 2024
Triggered auto assignment to @alexpensify (
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.melvin-bot commentedon Aug 19, 2024
Triggered auto assignment to @marcaaron (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.IuliiaHerets commentedon Aug 19, 2024
We think that this bug might be related to #wave-collect - Release 1
github-actions commentedon Aug 19, 2024
👋 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:
rayane-d commentedon Aug 19, 2024
@luacmartins Is this a bug?
marcaaron commentedon Aug 19, 2024
Not deploy blocker worthy IMO.
bernhardoj commentedon Aug 20, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The status bar selected item isn't preserved after switching to another bottom tab. This only happens on the small screen.
What is the root cause of that problem?
When we press the search bottom tab, we call
getCurrentSearchParamsto get the search params from the existing search bottom tab or central pane in the nav stack, then pass it to the new search screen.App/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar.tsx
Lines 91 to 95 in 44a7516
App/src/libs/SearchUtils.ts
Lines 297 to 312 in 44a7516
This works well on large screen, but not on small screen.
When we go to the search page, the nav stack looks like this:
small: [BottomTab: [Home, SearchBottomTab], SearchCentralPane]
large: [BottomTab: [Home, SearchBottomTab], Report, SearchCentralPane]
Both the search bottom tab and central pane holds the search query (q) params. When we change the status to paid, for example, the query params is only updated to the search central pane.
App/src/components/Search/SearchStatusBar.tsx
Line 137 in 44a7516
On the large screen, when we go back to home, the nav stack becomes:
[BottomTab: [Home, SearchBottomTab, Home], Report, SearchCentralPane, Report]
SearchCentralPaneis still in the stack with the status query params, so, when we switch back to the search page,getCurrentSearchParamswill return the query params with the previous status selected.But on the small screen, going back to home will pop the search central pane out.
small: [BottomTab: [Home, SearchBottomTab, Home]]
App/src/libs/Navigation/linkTo/index.ts
Lines 180 to 184 in 44a7516
So, when we switch back to the search page,
getCurrentSearchParamswill return the query params fromSearchBottomTabwhich contains the old status query.What changes do you think we should make in order to solve the problem?
We need to update the bottom tab params too when selecting the status.
App/src/components/Search/SearchStatusBar.tsx
Line 137 in 44a7516
We need to update
getTopmostBottomTabRouteto return the bottom tab key too.App/src/libs/Navigation/getTopmostBottomTabRoute.ts
Line 18 in 44a7516
Kicu commentedon Aug 20, 2024
I'm also interested in whether this is really a bug? the act of navigating to another screen changes a lot of things and we do reset some things in Search.
Also I don't think anyone was expecting that the selection state persists.
luacmartins commentedon Aug 20, 2024
This is intended. Closing this issue.
bernhardoj commentedon Aug 20, 2024
Maybe we can at least persists the selected status bar so it's consistent between web and small screen.
web.mp4
luacmartins commentedon Aug 20, 2024
I think the idea is to always reset the user. They can use saved searches (coming in v2.3) to navigate to any custom filters they have if they want to.