FIX: Do not query backend when searching "in this topic" (#14649)

FIX: Do not query backend when searching “in this topic” (#14649)

diff --git a/app/assets/javascripts/discourse/app/widgets/search-menu.js b/app/assets/javascripts/discourse/app/widgets/search-menu.js
index ef0426f..9977794 100644
--- a/app/assets/javascripts/discourse/app/widgets/search-menu.js
+++ b/app/assets/javascripts/discourse/app/widgets/search-menu.js
@@ -428,7 +428,6 @@ export default createWidget("search-menu", {
 
   triggerSearch() {
     searchData.noResults = false;
-
     if (SearchHelper.includesTopics()) {
       if (this.state.inTopicContext) {
         this.searchService().set("highlightTerm", searchData.term);
@@ -438,7 +437,9 @@ export default createWidget("search-menu", {
       SearchHelper.perform(this);
     } else {
       searchData.loading = false;
-      discourseDebounce(SearchHelper, SearchHelper.perform, this, 400);
+      if (!this.state.inTopicContext) {
+        discourseDebounce(SearchHelper, SearchHelper.perform, this, 400);
+      }
     }
   },
 
diff --git a/app/assets/stylesheets/common/base/search-menu.scss b/app/assets/stylesheets/common/base/search-menu.scss
index 9b9a609..8d678db 100644
--- a/app/assets/stylesheets/common/base/search-menu.scss
+++ b/app/assets/stylesheets/common/base/search-menu.scss
@@ -36,8 +36,9 @@ $search-pad-horizontal: 0.5em;
       }
     }
 
-    .btn {
+    .btn.search-context {
       margin: 2px;
+      margin-right: 0;
     }
     &:focus-within {
       @include default-focus;

GitHub sha: a1daf9fe53a66e2d2cdf9757ab4812fb9a2b2787

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