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:
@ -6,7 +6,7 @@ import {
|
||||
getSelectionCountByType,
|
||||
getSelectionTypeDisplayText,
|
||||
} from 'lib/selections'
|
||||
import { kclManager } from 'lib/singletons'
|
||||
import { engineCommandManager, kclManager } from 'lib/singletons'
|
||||
import { reportRejection } from 'lib/trap'
|
||||
import { toSync } from 'lib/utils'
|
||||
import { commandBarActor, useCommandBarState } from 'machines/commandBarMachine'
|
||||
@ -112,6 +112,23 @@ function CommandBarSelectionInput({
|
||||
onSubmit(selection)
|
||||
}
|
||||
|
||||
// Clear selection if needed
|
||||
useEffect(() => {
|
||||
arg.clearSelectionFirst &&
|
||||
engineCommandManager.modelingSend({
|
||||
type: 'Set selection',
|
||||
data: {
|
||||
selectionType: 'singleCodeCursor',
|
||||
},
|
||||
})
|
||||
}, [arg.clearSelectionFirst])
|
||||
|
||||
// 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])
|
||||
|
||||
return (
|
||||
<form id="arg-form" onSubmit={handleSubmit}>
|
||||
<label
|
||||
|
Reference in New Issue
Block a user