Boolean create UI (#5906)

* first steps, add to cmd bar etc

* cmdbar working well enough

* mvp

* lint

* fix after rebase

* intersect and union mvps

* add test

* some clean up

* further fix up

* Update src/lang/modifyAst/boolean.ts

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>

* Update src/lang/modifyAst/boolean.ts

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>

* pierre's comments

* tsc

* add comment

---------

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
This commit is contained in:
Kurt Hutten
2025-03-28 14:56:48 +11:00
committed by GitHub
parent 7ca3afff9f
commit d1f811f91d
11 changed files with 793 additions and 16 deletions

View File

@ -7,6 +7,7 @@ import {
} from 'lib/selections'
import { useSelector } from '@xstate/react'
import { commandBarActor, useCommandBarState } from 'machines/commandBarMachine'
import { kclManager } from 'lib/singletons'
const selectionSelector = (snapshot: any) => snapshot?.context.selectionRanges
@ -56,6 +57,12 @@ export default function CommandBarSelectionMixedInput({
}
}, [])
// Set selection filter if needed, and reset it when the component unmounts
useEffect(() => {
arg.selectionFilter && kclManager.setSelectionFilter(arg.selectionFilter)
return () => kclManager.defaultSelectionFilter(selection)
}, [arg.selectionFilter])
function handleChange() {
inputRef.current?.focus()
}