DEV: Half-revert search-menu flicker fix (#24975)

This commit is contained in:
Mark VanLandingham 2023-12-19 16:22:30 -06:00 committed by GitHub
parent 94884614d6
commit 6d5dd92ea1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 66 additions and 64 deletions

View File

@ -2,76 +2,78 @@
<SearchMenu::BrowserSearchTip /> <SearchMenu::BrowserSearchTip />
{{else}} {{else}}
<div class="results"> <div class="results">
<PluginOutlet {{#unless @loading}}
@name="search-menu-results-top" <PluginOutlet
@outletArgs={{hash @name="search-menu-results-top"
closeSearchMenu=@closeSearchMenu @outletArgs={{hash
searchTerm=this.search.activeGlobalSearchTerm closeSearchMenu=@closeSearchMenu
inTopicContext=this.search.inTopicContext searchTerm=this.search.activeGlobalSearchTerm
searchTopics=@searchTopics inTopicContext=this.search.inTopicContext
}} searchTopics=@searchTopics
/> }}
{{#if @suggestionKeyword}}
<SearchMenu::Results::Assistant
@suggestionKeyword={{@suggestionKeyword}}
@results={{@suggestionResults}}
@closeSearchMenu={{@closeSearchMenu}}
@searchTermChanged={{@searchTermChanged}}
/> />
{{else if this.termTooShort}} {{#if @suggestionKeyword}}
<div class="no-results">{{i18n "search.too_short"}}</div> <SearchMenu::Results::Assistant
{{else if this.noTopicResults}} @suggestionKeyword={{@suggestionKeyword}}
<div class="no-results">{{i18n "search.no_results"}}</div> @results={{@suggestionResults}}
{{else if this.renderInitialOptions}} @closeSearchMenu={{@closeSearchMenu}}
<SearchMenu::Results::InitialOptions @searchTermChanged={{@searchTermChanged}}
@closeSearchMenu={{@closeSearchMenu}} />
@searchTermChanged={{@searchTermChanged}} {{else if this.termTooShort}}
/> <div class="no-results">{{i18n "search.too_short"}}</div>
{{else}} {{else if this.noTopicResults}}
{{#if (and (not @searchTopics) (not @inPMInboxContext))}} <div class="no-results">{{i18n "search.no_results"}}</div>
{{! render the first couple suggestions before a search has been performed}} {{else if this.renderInitialOptions}}
<SearchMenu::Results::InitialOptions <SearchMenu::Results::InitialOptions
@closeSearchMenu={{@closeSearchMenu}} @closeSearchMenu={{@closeSearchMenu}}
@searchTermChanged={{@searchTermChanged}} @searchTermChanged={{@searchTermChanged}}
/> />
{{/if}} {{else}}
{{#if (and (not @searchTopics) (not @inPMInboxContext))}}
{{! render the first couple suggestions before a search has been performed}}
<SearchMenu::Results::InitialOptions
@closeSearchMenu={{@closeSearchMenu}}
@searchTermChanged={{@searchTermChanged}}
/>
{{/if}}
{{#if (and @searchTopics this.resultTypesWithComponent)}} {{#if (and @searchTopics this.resultTypesWithComponent)}}
{{! render results after a search has been performed }} {{! render results after a search has been performed }}
<SearchMenu::Results::Types <SearchMenu::Results::Types
@resultTypes={{this.resultTypesWithComponent}} @resultTypes={{this.resultTypesWithComponent}}
@topicResultsOnly={{true}} @topicResultsOnly={{true}}
@closeSearchMenu={{@closeSearchMenu}} @closeSearchMenu={{@closeSearchMenu}}
/> />
<SearchMenu::Results::MoreLink <SearchMenu::Results::MoreLink
@updateTypeFilter={{@updateTypeFilter}} @updateTypeFilter={{@updateTypeFilter}}
@triggerSearch={{@triggerSearch}} @triggerSearch={{@triggerSearch}}
@resultTypes={{this.resultTypesWithComponent}} @resultTypes={{this.resultTypesWithComponent}}
@closeSearchMenu={{@closeSearchMenu}} @closeSearchMenu={{@closeSearchMenu}}
@searchTermChanged={{@searchTermChanged}} @searchTermChanged={{@searchTermChanged}}
/> />
{{else if {{else if
(and (and
(not @inPMInboxContext) (not @inPMInboxContext)
(not @searchTopics) (not @searchTopics)
this.resultTypesWithComponent this.resultTypesWithComponent
) )
}} }}
<SearchMenu::Results::Types <SearchMenu::Results::Types
@resultTypes={{this.resultTypesWithComponent}} @resultTypes={{this.resultTypesWithComponent}}
@closeSearchMenu={{@closeSearchMenu}} @closeSearchMenu={{@closeSearchMenu}}
@searchTermChanged={{@searchTermChanged}} @searchTermChanged={{@searchTermChanged}}
/> />
{{/if}}
{{/if}} {{/if}}
{{/if}} <PluginOutlet
<PluginOutlet @name="search-menu-results-bottom"
@name="search-menu-results-bottom" @outletArgs={{hash
@outletArgs={{hash inTopicContext=this.search.inTopicContext
inTopicContext=this.search.inTopicContext searchTermChanged=@searchTermChanged
searchTermChanged=@searchTermChanged searchTopics=@searchTopics
searchTopics=@searchTopics closeSearchMenu=@closeSearchMenu
closeSearchMenu=@closeSearchMenu }}
}} />
/> {{/unless}}
</div> </div>
{{/if}} {{/if}}