UX: Add second Search button on mobile (#14404)

UX: Add second Search button on mobile (#14404)

diff --git a/app/assets/javascripts/discourse/app/controllers/full-page-search.js b/app/assets/javascripts/discourse/app/controllers/full-page-search.js
index a5bbf30..48fe538 100644
--- a/app/assets/javascripts/discourse/app/controllers/full-page-search.js
+++ b/app/assets/javascripts/discourse/app/controllers/full-page-search.js
@@ -411,8 +411,8 @@ export default Controller.extend({
       this.selected.clear();
     },
 
-    search(collapseFilters = false) {
-      if (collapseFilters) {
+    search(options = {}) {
+      if (options.collapseFilters) {
         document
           .querySelector("details.advanced-filters")
           ?.removeAttribute("open");
diff --git a/app/assets/javascripts/discourse/app/templates/components/search-advanced-options.hbs b/app/assets/javascripts/discourse/app/templates/components/search-advanced-options.hbs
index 552e57d..dc1a18f 100644
--- a/app/assets/javascripts/discourse/app/templates/components/search-advanced-options.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/search-advanced-options.hbs
@@ -228,4 +228,17 @@
       </div>
     </div>
   </details>
+
+  {{#if site.mobileView}}
+    <div class="second-search-button">
+      {{d-button
+        action=search
+        icon="search"
+        label="search.search_button"
+        class="btn-primary search-cta"
+        ariaLabel="search.search_button"
+        disabled=searchButtonDisabled
+      }}
+    </div>
+  {{/if}}
 </div>
diff --git a/app/assets/javascripts/discourse/app/templates/full-page-search.hbs b/app/assets/javascripts/discourse/app/templates/full-page-search.hbs
index 62c4369..1beb63a 100644
--- a/app/assets/javascripts/discourse/app/templates/full-page-search.hbs
+++ b/app/assets/javascripts/discourse/app/templates/full-page-search.hbs
@@ -16,7 +16,7 @@
         value=searchTerm
         class="full-page-search search no-blur search-query"
         aria-label=(i18n "search.search_term_label")
-        enter=(action "search" true)
+        enter=(action "search" (hash collapseFilters=true))
         hasAutofocus=hasAutofocus
         aria-controls="search-result-count"
       }}
@@ -28,7 +28,7 @@
         onChange=(action (mut search_type))
       }}
       {{d-button
-        action=(action "search" true)
+        action=(action "search" (hash collapseFilters=true))
         icon="search"
         label="search.search_button"
         class="btn-primary search-cta"
@@ -50,6 +50,8 @@
         {{search-advanced-options
           searchTerm=(readonly searchTerm)
           onChangeSearchTerm=(action (mut searchTerm))
+          search=(action "search" (hash collapseFilters=true))
+          searchButtonDisabled=searchButtonDisabled
           expandFilters=expandFilters
         }}
       </div>
diff --git a/app/assets/stylesheets/mobile/search.scss b/app/assets/stylesheets/mobile/search.scss
index af11a99..75f8f43 100644
--- a/app/assets/stylesheets/mobile/search.scss
+++ b/app/assets/stylesheets/mobile/search.scss
@@ -3,4 +3,12 @@
     padding-left: 0;
     padding-right: 0;
   }
+
+  .second-search-button {
+    margin-top: 1em;
+    display: flex;
+    .btn {
+      width: 100%;
+    }
+  }
 }

GitHub sha: 3e3043dbaa6d363e51579f9584b9fca04e66bea9

This commit appears in #14404 which was approved by eviltrout. It was merged by pmusaraj.