discourse/app/assets/stylesheets/common/base
Isaac Janzen a2b038ffe7
DEV: Upgrade search-menu to glimmer (#20482)
# Top level view
This PR is the first version of converting the search menu and its logic from (deprecated) widgets to glimmer components. The changes are hidden behind a group based feature flag. This will give us the ability to test the new implementation in a production setting before fully committing to the new search menu.

# What has changed
The majority of the logic from the widget implementation has been updated to fit within the context of a glimmer component, but it has not fundamentally changed. Instead of having a single widget - [search-menu.js](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/widgets/search-menu.js) - that built the bulk of the search menu logic, we split the logic into (20+) bite size components. This greatly increases the readability and makes extending a component in the search menu much more straightforward.

That being said, certain pieces needed to be rewritten from scratch as they did not translate from widget -> glimmer, or there was a general code upgraded needed. There are a few of these changes worth noting:

### Search Service
**Search Term** -> In the widget implementation we had a overly complex way of managing the current search term. We tracked the search term across multiple different states (`term`, `opts.term`, `searchData.term`) causing headaches. This PR introduces a single source of truth: 
```js
this.search.activeGlobalSearchTerm
```
This tracked value is available anywhere the `search` service is injected. In the case the search term should be needs to be updated you can call 
```js
this.search.activeGlobalSearchTerm = "foo"
```
 
**event listeners** -> In the widget implementation we defined event listeners **only** on the search input to handle things such as 
- keyboard navigation / shortcuts
- closing the search menu
- performing a search with "enter"

Having this in one place caused a lot of bloat in our logic as we had to handle multiple different cases in one location. Do _x_ if it is this element, but do _y_ if it is another. This PR updates the event listeners to be attached to individual components, allowing for a more fine tuned set of actions per element. To not duplicate logic across multiple components, we have condensed shared logic to actions on the search service to be reused. For example - `this.search.handleArrowUpOrDown` - to handle keyboard navigation.

### Search Context
We have unique logic based on the current search context (topic / tag / category / user / etc). This context is set within a models route file. We have updated the search service with a tracked value `searchContext` that can be utilized and updated from any component where the search service is injected.

```js
# before
this.searchService.set("searchContext", user.searchContext);

# after
this.searchService.searchContext = user.searchContext;
```

# Views
<img width="434" alt="Screenshot 2023-06-15 at 11 01 01 AM" src="https://github.com/discourse/discourse/assets/50783505/ef57e8e6-4e7b-4ba0-a770-8f2ed6310569">

<img width="418" alt="Screenshot 2023-06-15 at 11 04 11 AM" src="https://github.com/discourse/discourse/assets/50783505/2c1e0b38-d12c-4339-a1d5-04f0c1932b08">

<img width="413" alt="Screenshot 2023-06-15 at 11 04 34 AM" src="https://github.com/discourse/discourse/assets/50783505/b871d164-88cb-405e-9b78-d326a6f63686">

<img width="419" alt="Screenshot 2023-06-15 at 11 07 51 AM" src="https://github.com/discourse/discourse/assets/50783505/c7309a19-f541-47f4-94ef-10fa65658d8c">

<img width="424" alt="Screenshot 2023-06-15 at 11 04 48 AM" src="https://github.com/discourse/discourse/assets/50783505/f3dba06e-b029-431c-b3d0-36727b9e6dce">

<img width="415" alt="Screenshot 2023-06-15 at 11 08 57 AM" src="https://github.com/discourse/discourse/assets/50783505/ad4e7250-040c-4d06-bf06-99652f4c7b7c">
2023-06-16 09:24:07 -05:00
..
_index.scss FEATURE: image grid in posts (experimental) (#21513) 2023-06-07 14:15:57 -04:00
_topic-list.scss UX: stack group inbox label horizontally (#22130) 2023-06-15 18:35:36 +05:30
about.scss
activation.scss DEV: Use more css vars (#18561) 2022-10-12 16:05:42 +02:00
alert.scss UX: highlight vars updates (#20346) 2023-02-21 10:15:49 +01:00
bbcode.scss
cat_reorder.scss UX: Increase width & center category reorder input (#10928) 2020-10-15 14:42:42 +11:00
category-list.scss FIX: add category colors back to categories pages (#21977) 2023-06-07 12:57:10 -04:00
code_highlighting.scss UX: update hljs-builtin-name highlight (#16859) 2022-05-18 15:55:40 +02:00
colorpicker.scss FEATURE: Use native color-picker (#15748) 2022-02-01 11:18:13 -03:00
compose.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
composer-user-selector.scss DEV: Use css var font sizes (#18518) 2022-10-12 15:31:59 +02:00
crawler_layout.scss UX: Style edits (#19927) 2023-02-15 11:02:16 -06:00
d-icon.scss FEATURE: automatic dark mode (#10341) 2020-08-03 22:57:10 -04:00
d-image-grid.scss UX: Better alignment for experimental grids (#22066) 2023-06-13 09:25:46 -04:00
d-popover.scss FIX: various mobile chat improvements (#22132) 2023-06-16 11:36:43 +02:00
dialog.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
directory.scss UX: improve directory user fields on small screens (#20765) 2023-03-21 14:09:02 -04:00
discourse.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
edit-category.scss DEV: Apply form template to categories (#20337) 2023-02-23 11:18:14 -08:00
edit-topic-timer-modal.scss UX: Normalize sizing for inputs, buttons, dropdowns (#14226) 2021-09-09 11:01:56 -04:00
ember-select.scss FEATURE: automatic dark mode (#10341) 2020-08-03 22:57:10 -04:00
emoji.scss UX: improve emoji alignment for text (#19815) 2023-01-30 14:07:08 +01:00
empty-state.scss DEV: Use css var font sizes (#18518) 2022-10-12 15:31:59 +02:00
exception.scss DEV: Use css var font sizes (#18518) 2022-10-12 15:31:59 +02:00
explain-reviewable.scss FEATURE: automatic dark mode (#10341) 2020-08-03 22:57:10 -04:00
faqs.scss DEV: Use css var font sizes (#18518) 2022-10-12 15:31:59 +02:00
group.scss UX: style improvements to new user tables (#20530) 2023-03-06 09:30:48 -05:00
groups.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
header.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
history.scss UX: Fix post history raw view (#21830) 2023-05-31 05:29:04 +08:00
lightbox.scss UX: remove rounded border on hover lightbox (#22080) 2023-06-13 13:31:28 +02:00
login.scss DEV: Don't render header on invites page (#22138) 2023-06-16 09:42:00 +08:00
magnific-popup.scss UX: force long filenames to wrap in lightbox (#22091) 2023-06-13 13:34:14 -04:00
menu-panel.scss DEV: Upgrade search-menu to glimmer (#20482) 2023-06-16 09:24:07 -05:00
modal.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
new-user.scss DEV: Refactor GroupNotificationsButton into userPrivateMessages.group route (#21930) 2023-06-07 06:22:50 +08:00
not-found.scss DEV: Use more css vars (#18561) 2022-10-12 16:05:42 +02:00
onebox.scss UX: Fix user onebox layout (#21284) 2023-04-28 09:50:49 -04:00
personal-message.scss FEATURE: control topic width with variables (#18743) 2022-10-25 14:45:37 -04:00
popup-menu.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
redirection.scss DEV: Use more css vars (#18561) 2022-10-12 16:05:42 +02:00
request_access.scss DEV: Use css var font sizes (#18518) 2022-10-12 15:31:59 +02:00
request-group-membership-form.scss
reviewables.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
rtl.scss FEATURE: Serve RTL versions of admin and plugins CSS bundles for RTL locales (#21876) 2023-06-01 05:27:11 +03:00
search-menu.scss UX: fix spacing between assign tags (#20967) 2023-04-04 17:26:06 -04:00
search.scss FIX: Failing system spec for rate limited search (#20046) 2023-01-27 12:14:29 -08:00
share_link.scss UX: Move post date under title in share-modal (#16455) 2022-04-27 16:36:08 +03:00
shared-drafts.scss FEATURE: automatic dark mode (#10341) 2020-08-03 22:57:10 -04:00
sidebar-custom-section.scss UX: show tooltip for global nav section icon (#21974) 2023-06-08 12:57:44 -04:00
sidebar-footer.scss FIX: restore sidebar footer background (#21956) 2023-06-06 14:46:08 -04:00
sidebar-more-section-links.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
sidebar-section-link.scss UX: remove sidebar background color (#21775) 2023-06-06 09:24:56 -04:00
sidebar-section.scss UX: show tooltip for global nav section icon (#21974) 2023-06-08 12:57:44 -04:00
sidebar.scss UX: remove sidebar background color (#21775) 2023-06-06 09:24:56 -04:00
static-login.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
tagging.scss UX: improve tags spacing (#21585) 2023-05-23 09:52:15 +08:00
tooltip.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
topic-admin-menu.scss A11Y: Use button in d-modal-cancel component (#17938) 2022-08-17 09:39:28 +08:00
topic-post.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
topic.scss REFACTOR: move shadow vars to css custom props (#22094) 2023-06-13 16:38:31 -04:00
upload.scss FEATURE: automatic dark mode (#10341) 2020-08-03 22:57:10 -04:00
user-badges.scss UX: User badges tweaks (#20408) 2023-02-23 03:21:26 +01:00
user-tips.scss UX: Make user tips more visible (#22012) 2023-06-12 21:08:49 +03:00
user.scss UX: fix color scheme setting reset position (#21365) 2023-05-03 13:37:23 -04:00