11import { useChannelsContext } from '@core/component/ChannelsProvider' ;
2+ import { ClippedPanel } from '@core/component/ClippedPanel' ;
3+ import { ToggleSwitch } from '@core/component/FormControls/ToggleSwitch' ;
24import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown' ;
35import { ENABLE_SEARCH_PAGINATION } from '@core/constant/featureFlags' ;
46import type { CommandWithInfo } from '@core/hotkey/getCommands' ;
5- import { cornerClip } from '@core/util/clipPath' ;
67import { createFreshSearch } from '@core/util/freshSort' ;
78import { Popover } from '@kobalte/core' ;
89import { Command as CommandK , useCommandState } from 'cmdk-solid' ;
@@ -45,6 +46,7 @@ import {
4546 konsoleOpen ,
4647 lastCommandTime ,
4748 rawQuery ,
49+ setKonsoleMode ,
4850 setLastCommandTime ,
4951 setRawQuery ,
5052 toggleKonsoleVisibility ,
@@ -97,32 +99,10 @@ export function KommandMenu() {
9799 < Popover . Portal >
98100 < CommandWindow >
99101 < Popover . Content >
100- < div class = "bg-dialog mt-[25vh] border-2 border-accent w-6xl max-w-[90vw] max-h-[75vh] overflow-hidden" >
101- < div
102- class = "left-0 absolute bg-accent py-1.5 pr-10 pl-2 font-mono font-black text-menu text-xs -translate-y-full"
103- style = { { 'clip-path' : cornerClip ( 0 , '1.5rem' , 0 , 0 ) } }
104- >
105- < svg
106- fill = "none"
107- viewBox = "0 0 127 16"
108- xmlns = "http://www.w3.org/2000/svg"
109- xmlns :xlink = "http://www.w3.org/1999/xlink"
110- class = "h-2"
111- >
112- < clipPath id = "a" >
113- < path d = "m.599609 0h125.8v16h-125.8z" />
114- </ clipPath >
115- < g clip-path = "url(#a)" fill = "currentColor" >
116- < path d = "m108.249 0c-2.397 0-4.381 1.94809-4.381 4.30241v7.37539c0 2.3543 1.984 4.3024 4.381 4.3024h13.769c2.398 0 4.382-1.9481 4.382-4.3024v-7.37539c0-2.35432-1.984-4.30241-4.382-4.30241zm0 3.68767h13.769c.368 0 .626.25328.626.61455v7.37538c0 .3612-.258.6145-.626.6145h-13.769c-.368 0-.626-.2533-.626-.6145v-7.37519c0-.36126.258-.61474.626-.61474z" />
117- < path d = "m78.8333 0v15.98h3.7552v-4.917h11.6697l2.5034 4.917h4.1994l-2.6237-5.1522c1.7427-.5698 3.0277-2.1784 3.0277-4.067v-2.45839c0-2.35432-1.984-4.30241-4.3815-4.30241zm3.7552 3.68767h14.395c.3679 0 .6258.25328.6258.61455v2.45838c0 .36127-.2579.61455-.6258.61455h-14.395z" />
118- < path d = "m58.1792 0c-2.3972 0-4.381 1.94809-4.381 4.30241v7.37539c0 2.3543 1.9838 4.3024 4.381 4.3024h18.1505v-3.6877h-18.1505c-.3679 0-.6258-.2533-.6258-.6145v-7.37559c0-.36126.2579-.61454.6258-.61454h18.1505v-3.68787z" />
119- < path d = "m33.1443.0200268c-2.3974 0-4.381 1.9480932-4.381 4.3024132v11.67776h3.7552v-4.9374h15.0209v4.9374h3.7552v-11.67776c0-2.35432-1.9836-4.3024132-4.381-4.3024132zm0 3.6876732h13.7693c.3678 0 .6258.25328.6258.61454v3.05271h-15.0209v-3.05271c0-.36126.2579-.61454.6258-.61454z" />
120- < path d = "m.599609 0v15.98h3.755211v-12.29233h2.35626c.19253 0 .38028.05969.53603.17082.15595.11093.27211.26761.33189.44746l3.8762 11.67425h3.9495l3.888-11.70783c.0564-.16983.1659-.31787.3131-.42291.1473-.10505.3245-.16159.5064-.16159h2.3931v12.29233h3.7552v-15.9802h-8.873c-.1819 0-.3591.0567425-.5064.161588-.1472.105043-.2568.253084-.3131.422918l-3.138 9.447894-3.1379-9.447894c-.0563-.169834-.1659-.317875-.31326-.422918-.14715-.1050419-.3245-.161588-.50644-.161588z" />
121- </ g >
122- </ svg >
123- </ div >
124-
125- < KommandMenuInner commandKRef = { commandKRef } />
102+ < div class = "bg-dialog mt-[25vh] w-6xl max-w-[90vw] max-h-[75vh] overflow-hidden" >
103+ < ClippedPanel tl active >
104+ < KommandMenuInner commandKRef = { commandKRef } />
105+ </ ClippedPanel >
126106 </ div >
127107 </ Popover . Content >
128108 </ CommandWindow >
@@ -335,34 +315,42 @@ export function KommandMenuInner(props: {
335315 return (
336316 < CommandK
337317 label = "Global CommandK Menu"
338- class = "flex flex-col gap-px bg-accent w-full"
318+ class = "flex flex-col gap-px w-full"
339319 value = { currentValue ( ) }
340320 shouldFilter = { false }
341321 onValueChange = { ( value ) => {
342322 if ( isLoadingMore ( ) ) return ;
343323 setCurrentValue ( value ) ;
344324 } }
345325 >
346- < div
347- class = "flex items-center gap-2 bg-menu p-3"
348- style = { { 'clip-path' : cornerClip ( 0 , 0 , '0.25rem' , '0.25rem' ) } }
349- >
350- < span class = "text-accent" > ❯</ span >
326+ < div class = "flex items-center gap-2 bg-panel px-2 h-[40px] border-b border-edge-muted" >
327+ < span class = "pl-2 pointer-events-none" > ❯</ span >
351328 < CommandK . Input
352- value = { rawQuery ( ) }
353- placeholder = "Search files..."
354- class = "flex-1 border-0 outline-none! focus:outline-none ring-0! focus:ring-0 font-mono placeholder:text-edge text-accent-270"
329+ class = "flex-1 border-0 outline-none! focus:outline-none ring-0! focus:ring-0 font-mono"
355330 onValueChange = { setRawQuery }
331+ placeholder = "Search"
332+ value = { rawQuery ( ) }
333+ autofocus
334+ />
335+ < ToggleSwitch
336+ onChange = { ( val ) => {
337+ if ( val ) {
338+ setKonsoleMode ( 'FULL_TEXT_SEARCH' ) ;
339+ } else {
340+ setKonsoleMode ( 'ENTITY_SEARCH' ) ;
341+ }
342+ } }
343+ checked = { isFullTextSearch ( ) }
344+ // switchRootClass='subtle'
345+ label = "Full Text Search"
346+ size = "SM"
356347 />
357348 </ div >
358- < div
359- class = "bg-menu"
360- style = { { 'clip-path' : cornerClip ( '0.25rem' , '0.25rem' , 0 , 0 ) } }
361- >
349+ < div class = "bg-panel" >
362350 < KonsoleFilter />
363351 < CommandK . List class = "scrollbar-hidden" >
364352 < CommandK . Empty >
365- < div class = "px-2 pb-2 text-ink-muted" >
353+ < div class = "px-2 text-ink-muted min-h-[40px] " >
366354 { currentKonsoleMode ( ) === 'FULL_TEXT_SEARCH' &&
367355 cleanQuery ( ) . length < 3
368356 ? 'Enter 3 or more characters to search all documents.'
@@ -375,7 +363,7 @@ export function KommandMenuInner(props: {
375363 < VList
376364 data = { filteredItems ( ) }
377365 style = { { height : containerHeight ( ) } }
378- class = "scrollbar-hidden pb-2 bg-dialog "
366+ class = "scrollbar-hidden pb-2 bg-panel "
379367 >
380368 { ( item , index ) => (
381369 < CommandKItemWrapper index = { index ( ) } item = { item } />
0 commit comments