Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.98k stars 2.98k forks source link

Redesign search to always show search input(mobile + desktop). #55078

Open SzymczakJ opened 2 weeks ago

SzymczakJ commented 2 weeks ago

Explanation of Change

This PR is mainly about redesigning Search Page but I also made a pretty big refactor and improved performance of Search Page mobile header animation. These are the design changes:

  1. on SearchPage full screen, the SearchRouterInput is always visible, previously the SearchRouterInput was hidden when we were in "canned search" state.
Screenshot 2025-01-23 at 11 56 49
  1. on mobile SearchPage, we remove the button that navigates to SearchRouter

  2. instead of that we put SearchRouterInput in place where SearchTypeMenuNarrow was, focusing this input is making SearchRouterList visible.

    Screenshot 2025-01-23 at 11 59 03 Screenshot 2025-01-23 at 11 59 24
  3. on mobile SearchPage user can still open type menu modal by pressing the button next to SearchRouterInput

These are refactor changes:

  1. Refactor of SearchPageBottomTab.tsx so that it has one render for narrow screen and one render for full screen, for better readability.
  2. Delete SearchTypeMenuNarrow.tsx and decuple it's logic from SearchTypeMenu.tsx, now this logic lives in SearchTypeMenuPopover.tsx with the common parts of SearchTypeMenuPopover and SearchTypeMenu put into SearchUIUtils.
  3. Delete SearchSelectionModeHeader.tsx as it added unnecessary layer that was confusing.

Fixed Issues

$ https://github.com/Expensify/App/issues/52317 PROPOSAL:

Tests

  1. On full screen SearchPage make sure that SearchRouterInput displays in every case.
  2. Test if clicking on canned searches and saved searches works as expected.
  3. Test if writing into SearchRouterInput works as expected.
  4. On mobile, test scrolling SearchPage list and SearchRouterList(after focusing SearchRouterInput).
  5. Test SearchRouterList, if it works as expected(if clicking on recent searches items works as expected etc.).
  6. Test if advanced filters button works as expected.
  7. Test if type menu button(next to SearchRouterInput) works as expected and it's possible to go to canned item or saved item.

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

Same as tests

PR Author Checklist

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
melvin-bot[bot] commented 2 days ago

@rayane-djouah Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

SzymczakJ commented 2 days ago

Ready for review @rayane-djouah I would also like to hear opinion from design team and @luacmartins πŸ˜„

https://github.com/user-attachments/assets/60e6b5d0-41ba-4071-94fb-2eb042e340d7

shawnborton commented 2 days ago

I'll spin up a test build!

luacmartins commented 2 days ago

Kicked off the build https://github.com/Expensify/App/actions/runs/12934975324

github-actions[bot] commented 2 days ago

🚧 @luacmartins has triggered a test build. You can view the workflow run here.

luacmartins commented 2 days ago

@SzymczakJ can you merge main? We have conflicts, but more importantly we fixed some Search bugs that should be reflected on this branch too

luacmartins commented 2 days ago

This is looking really good though!

luacmartins commented 2 days ago

@rayane-djouah this would be a good PR to prioritize next too πŸš€

github-actions[bot] commented 2 days ago
:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube: Android :robot: iOS :apple:
https://ad-hoc-expensify-cash.s3.amazonaws.com/android/55078/index.html https://ad-hoc-expensify-cash.s3.amazonaws.com/ios/55078/index.html
Android iOS
Desktop :computer: Web :spider_web:
https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/55078/NewExpensify.dmg https://55078.pr-testing.expensify.com
Desktop Web

:eyes: View the workflow run that generated this build :eyes:

rayane-djouah commented 1 day ago

Reviewer Checklist

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
shawnborton commented 1 day ago

The router feels kinda excessively tall when you open it on desktop: CleanShot 2025-01-24 at 11 01 30@2x

Can we reduce the height? Curious if @Expensify/design agrees. Maybe like 2/3 of the overall viewport height or something? Or even a fixed amount that feels reasonable.

shawnborton commented 1 day ago

When I type "test" and hit enter, I don't get any results... why doesn't it actually search my query?

https://github.com/user-attachments/assets/b756570f-9ffc-4795-b236-95e5d41914c0

Also notice the really weird jump that forces a quick scrollbar on the LHN. We need to fix that too: CleanShot 2025-01-24 at 11 05 16@2x

shawnborton commented 1 day ago

When I click on the Chats tab in the LHN, shouldn't the router by populated with type:chats? CleanShot 2025-01-24 at 11 06 45@2x

Same for all of the others.

shawnborton commented 1 day ago

On mobile, the transition with the input and Cancel link feels slightly sluggish? Like it feels like it's just slightly after my clicking...

https://github.com/user-attachments/assets/8139cdf7-1f7b-4c94-8d58-7e46acfa1ae4

shawnborton commented 1 day ago

On the search input, the placeholder color is too light: CleanShot 2025-01-24 at 11 13 25@2x

It should be our textSupporting color, which is #76847E

Kicu commented 1 day ago

This: https://github.com/Expensify/App/pull/55078#issuecomment-2612136303

https://github.com/Expensify/App/pull/55078#issuecomment-2612136303

Is a regression that I found a few days ago and mentioned it here: https://github.com/Expensify/App/pull/54807#issuecomment-2587516329

Forgot to follow up. We can either ask the person responsible for PR to fix, or maybe @SzymczakJ can try to fix inside this PR to speed things up. However fixing outside of PR would also make sense, as this bug was not introduced by Jakub's refactor.

SzymczakJ commented 1 day ago
  1. Regarding @Kicu comment, I'm fine with fixing this behaviour in this PR(this seems an easy bug), so the whole SearchPage tests well

  2. Regarding @shawnborton comment:

When I click on the Chats tab in the LHN, shouldn't the router by populated with type:chats?

Right now, I'm not showing the query in TextInput in case when it's one of the "canned queries", this might have been overlooked in the designs but they also point to the same bahaviour. What do you think about such aproach?

  1. The sluggish transition on mobile is a big problem for us, but I'm afraid that it's caused by overall bad performance of SearchPage and Expensify's SelectionList. I will try to address this problem in next PRs, but such changes would be too big to merge the fix in this PR(I don't even know how to fix it yet 😭)
dannymcclain commented 1 day ago

Thanks for the detailed review Shawn! You mentioned all the things I noticed and moreβ€”I agree with all your comments.

shawnborton commented 1 day ago

What do you think about such aproach?

I think it makes sense to populate the canned searches with the appropriate filter. I could see not populating anything for expenses though since that's the default that we use.

luacmartins commented 1 day ago

Is a regression that I found a few days ago and mentioned it here: https://github.com/Expensify/App/pull/54807#issuecomment-2587516329

I believe this regression was fixed here. It's also already fixed on this branch after the latest merge with main.

luacmartins commented 1 day ago

I could see not populating anything for expenses though since that's the default that we use.

I'd vote that we either do it for all of the canned searches or none of them. IMO I like the current approach the most since the user interacts with the LHN and not the Search bar in those scenarios, so seeing the Search bar update feels a bit odd to me. That being said, I do find it odd that when I have Chats selected and search for something, it brings me back to Expenses

https://github.com/user-attachments/assets/cc90a772-d36c-4fe8-aba3-e5c3c23eef3c

shawnborton commented 1 day ago

Hmm but the LHN items are literally just shortcuts to existing search queries, and thus I think we should populate the query bar with them.

The argument for not putting it on Expenses is basically like how Gmail handles the Inbox. When you are on the Inbox in Gmail, no query is needed - it's the default set of results. However, if you go to Sent or Drafts, the query bar is updated.

dannymcclain commented 1 day ago

Hmm but the LHN items are literally just shortcuts to existing search queries, and thus I think we should populate the query bar with them. The argument for not putting it on Expenses is basically like how Gmail handles the Inbox. When you are on the Inbox in Gmail, no query is needed - it's the default set of results. However, if you go to Sent or Drafts, the query bar is updated.

Yeah I feel the same. I think updating the query bar reinforces and very subtly educates the user how the product works.

luacmartins commented 23 hours ago

I'm cool with that too, not super passionate. So to align on this we'd:

  1. Expenses > All doesn't show the query in the Search bar
  2. Any other queries (even canned ones) would update the Search bar value

Is that right?

luacmartins commented 22 hours ago

I'm reassigning C+ since @rayane-djouah will have limited availability next week.

ikevin127 commented 22 hours ago

@luacmartins I can finish this one today but first, is this ready for review right now (no more changes) or are we waiting on some changes based on recent discussion with design team summarized in https://github.com/Expensify/App/pull/55078#issuecomment-2613193620 ?

luacmartins commented 21 hours ago

I think we still have the changes below:

  1. Reduce the dropdown size on desktop
  2. Updating the Search bar with the query when we're not at the Expenses > All filter
ikevin127 commented 21 hours ago

Cool, then @SzymczakJ please let me know when the PR is ready for review! πŸ‘