discourse/spec/system/user_page
Yuriy Kurant 8b5da219d8
UX: header search mobile support (#31711)
## Requirements

Initially defined in
https://meta.discourse.org/t/software-engineer-frontend-ember-js-yuriy-kurant/353612/14?u=yaran.

1. On mobile devices and tablets, users can open the search input field
by tapping the search icon
2. When opened, the search input takes over the entire header area:
    - Users can tap the sliders icon to navigate to the advanced search page
(/search)
    - Users can tap Cancel to close search input
3. After submitting a search, results area will take over the entire
screen:
    - Users can tap the X icon to clear the search term from the input field
    - Users can tap Cancel to close search results area and return to their
previous page (i.e. search area overlays content)

## Implementation

1. When opened, the search input takes over the entire header area:
    - changed panel width from `90vw` to `100vw`
    - on initial render (when search input is empty), search panel hovers over the header section only (doesn't cover main content below)
    - quick tip and recent searches lists are not displayed on mobile view
2. Tap on the sliders icon navigates to the advanced search page
(`/search`)
3. Tap on the **Cancel** button:
    - closes search menu
    - if the search term is present, it is cleared
4. Tap on the left-hand side **Search** icon triggers a topics search

## Dev notes

1. Added `// TODO` questioning `search` service `noResults` default value of `false`
2. Added animation on toggling header search panel (created `delayed-destroy` custom modifier)
3. Extracted in-context search filters into a standalone component `search-menu/active-filters`:
    - mobile: active filters below search input
    - desktop: active filters inside search input
3. Removed unnecessary top padding when search results are empty
4. Added `data-test-` attrs for Ember tests. Benefits:
    - semantically `data-test-` attrs indicate that these parts of the layout are covered with tests
    - decouples selector dependency on `id/class` names for testing purposes - eliminates risk of broken tests due to `id/class` name changes
2025-04-14 10:27:48 +08:00
..
hide_from_public_spec.rb DEV: Improve UX when user profiles are hidden from public (#26293) 2024-03-21 17:53:52 +00:00
staff_info_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
user_notifications_spec.rb DEV: Plugin-api methods for user-notifications route customizations (#24873) 2023-12-13 15:15:42 -06:00
user_page_search_spec.rb UX: header search mobile support (#31711) 2025-04-14 10:27:48 +08:00
user_preferences_account_spec.rb FIX: Serialize uploaded_avatars_allowed_groups check on current user (#25515) 2024-02-02 09:32:45 +10:00
user_preferences_interface_spec.rb FIX: Set the correct state of the dark mode checkbox user preference (#31214) 2025-02-06 20:31:37 +03:00
user_preferences_navigation_spec.rb FIX: Serialize uploaded_avatars_allowed_groups check on current user (#25515) 2024-02-02 09:32:45 +10:00
user_preferences_profile_spec.rb UX: move "hide profile" checkbox to profile tab (#31095) 2025-01-31 17:04:20 +01:00
user_preferences_security_spec.rb Added button to remove password from account (#32200) 2025-04-09 09:32:51 -05:00
user_profile_info_panel_spec.rb FIX: Render user profile trust level name for TL0 (#22740) 2023-07-21 15:16:34 +08:00
users_directory_spec.rb DEV: Remove flaky test for now (#29249) 2024-10-17 16:58:35 +08:00