@@ -75,7 +75,8 @@ export class Omnibox implements m.ClassComponent<OmniboxAttrs> {
7575 }
7676
7777 private renderPromptOmnibox ( ) : m . Children {
78- const omnibox = AppImpl . instance . omnibox ;
78+ const app = AppImpl . instance ;
79+ const omnibox = app . omnibox ;
7980 const prompt = assertExists ( omnibox . pendingPrompt ) ;
8081
8182 let options : OmniboxOption [ ] | undefined = undefined ;
@@ -111,16 +112,23 @@ export class Omnibox implements m.ClassComponent<OmniboxAttrs> {
111112 } ,
112113 onSubmit : ( value , _alt ) => {
113114 omnibox . resolvePrompt ( value ) ;
115+ if ( app . zenModeEnabled === true ) {
116+ app . hideTopbarInZenMode ( ) ;
117+ }
114118 } ,
115119 onClose : ( ) => {
116120 omnibox . rejectPrompt ( ) ;
121+ if ( app . zenModeEnabled === true ) {
122+ app . hideTopbarInZenMode ( ) ;
123+ }
117124 } ,
118125 } ) ;
119126 }
120127
121128 private renderCommandOmnibox ( ) : m . Children {
122129 // Fuzzy-filter commands by the filter string.
123- const { commands, omnibox} = AppImpl . instance ;
130+ const app = AppImpl . instance ;
131+ const { commands, omnibox} = app ;
124132 const filteredCmds = commands . fuzzyFilterCommands ( omnibox . text ) ;
125133
126134 // Create an array of commands with attached heuristics from the recent
@@ -173,10 +181,16 @@ export class Omnibox implements m.ClassComponent<OmniboxAttrs> {
173181 this . omniboxInputEl . blur ( ) ;
174182 }
175183 omnibox . reset ( ) ;
184+ if ( app . zenModeEnabled === true ) {
185+ app . hideTopbarInZenMode ( ) ;
186+ }
176187 } ,
177188 onSubmit : ( key : string ) => {
178189 this . addRecentCommand ( key ) ;
179190 commands . runCommand ( key ) ;
191+ if ( app . zenModeEnabled === true ) {
192+ app . hideTopbarInZenMode ( ) ;
193+ }
180194 } ,
181195 onGoBack : ( ) => {
182196 omnibox . reset ( ) ;
@@ -210,13 +224,19 @@ export class Omnibox implements m.ClassComponent<OmniboxAttrs> {
210224 const tag = alt ? undefined : 'omnibox_query' ;
211225 if ( trace === undefined ) return ;
212226 addQueryResultsTab ( trace , config , tag ) ;
227+ if ( AppImpl . instance . zenModeEnabled === true ) {
228+ AppImpl . instance . hideTopbarInZenMode ( ) ;
229+ }
213230 } ,
214231 onClose : ( ) => {
215232 AppImpl . instance . omnibox . setText ( '' ) ;
216233 if ( this . omniboxInputEl ) {
217234 this . omniboxInputEl . blur ( ) ;
218235 }
219236 AppImpl . instance . omnibox . reset ( ) ;
237+ if ( AppImpl . instance . zenModeEnabled === true ) {
238+ AppImpl . instance . hideTopbarInZenMode ( ) ;
239+ }
220240 } ,
221241 onGoBack : ( ) => {
222242 AppImpl . instance . omnibox . reset ( ) ;
@@ -249,6 +269,9 @@ export class Omnibox implements m.ClassComponent<OmniboxAttrs> {
249269 if ( this . omniboxInputEl ) {
250270 this . omniboxInputEl . blur ( ) ;
251271 }
272+ if ( AppImpl . instance . zenModeEnabled === true ) {
273+ AppImpl . instance . hideTopbarInZenMode ( ) ;
274+ }
252275 } ,
253276 onSubmit : ( value , _mod , shift ) => {
254277 if ( trace === undefined ) return ; // No trace loaded.
@@ -261,6 +284,9 @@ export class Omnibox implements m.ClassComponent<OmniboxAttrs> {
261284 if ( this . omniboxInputEl ) {
262285 this . omniboxInputEl . blur ( ) ;
263286 }
287+ if ( AppImpl . instance . zenModeEnabled === true ) {
288+ AppImpl . instance . hideTopbarInZenMode ( ) ;
289+ }
264290 } ,
265291 rightContent : trace && this . renderStepThrough ( trace ) ,
266292 } ) ;
0 commit comments