Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
revert(web): remove redundant slash picker intent tracking (#40103)
yyhd6336c5d4911
diff --git a/web/app/components/base/prompt-editor/plugins/component-picker-block/__tests__/index.spec.tsx b/web/app/components/base/prompt-editor/plugins/component-picker-block/__tests__/index.spec.tsxindex c8e7ecb2b8f..7e60d194444 100644--- a/web/app/components/base/prompt-editor/plugins/component-picker-block/__tests__/index.spec.tsx+++ b/web/app/components/base/prompt-editor/plugins/component-picker-block/__tests__/index.spec.tsx@@ -228,7 +228,6 @@ async function setEditorText(editor: LexicalEditor,text: string,selectEnd: boolean,- selectionOffset?: number,): Promise<void> {await act(async () => {editor.update(() => {@@ -238,28 +237,11 @@ async function setEditorText(const textNode = $createTextNode(text)paragraph.append(textNode)root.append(paragraph)- if (typeof selectionOffset === 'number') textNode.select(selectionOffset, selectionOffset)- else if (selectEnd) textNode.selectEnd()+ if (selectEnd) textNode.selectEnd()})})}-function markSlashTyped(editable: HTMLElement) {- editable.dispatchEvent(- new InputEvent('beforeinput', {- bubbles: true,- cancelable: true,- inputType: 'insertText',- data: '/',- }),- )-}--async function insertSlashTrigger(editor: LexicalEditor, editable: HTMLElement): Promise<void> {- markSlashTyped(editable)- await setEditorText(editor, '/', true)-}-function readEditorText(editor: LexicalEditor): string {return editor.getEditorState().read(() => $getRoot().getTextContent())}@@ -660,44 +642,6 @@ describe('ComponentPicker (component-picker-block/index.tsx)', () => {})})- it('opens the slash menu when the user types / but not when clicking after an existing slash', async () => {- const captures: Captures = { editor: null, eventEmitter: null }- const urlPrompt = 'Use https://dict.youdao.com/dictvoice?audio=word&type=0'-- render(- <MinimalEditor- triggerString="/"- workflowVariableBlock={makeWorkflowVariableBlock({}, [- makeWorkflowVarNode('node-1', 'Node 1', [makeWorkflowNodeVar('output', VarType.string)]),- ])}- agentOutputBlock={{- show: true,- outputs: [],- onChange: vi.fn(),- }}- captures={captures}- />,- )-- const editor = await waitForEditor(captures)- const editable = screen.getByTestId(CONTENT_EDITABLE_TEST_ID)-- await insertSlashTrigger(editor, editable)- await flushNextTick()-- expect(await screen.findByText('output')).toBeInTheDocument()-- await setEditorText(editor, urlPrompt, false, urlPrompt.indexOf('://') + 2)- await flushNextTick()-- fireEvent.pointerDown(editable)- fireEvent.click(editable)- await flushNextTick()-- expect(screen.queryByText('output')).not.toBeInTheDocument()- expect(screen.queryByText('workflow.nodes.agent.outputVars.newOutput')).not.toBeInTheDocument()- })-it('clears slash trigger state after creating an agent output from the footer action', async () => {const captures: Captures = { editor: null, eventEmitter: null }@@ -718,9 +662,8 @@ describe('ComponentPicker (component-picker-block/index.tsx)', () => {const editor = await waitForEditor(captures)const dispatchSpy = vi.spyOn(editor, 'dispatchCommand')- const editable = screen.getByTestId(CONTENT_EDITABLE_TEST_ID)- await insertSlashTrigger(editor, editable)+ await setEditorText(editor, '/', true)await flushNextTick()const newOutputAction = await screen.findByText('workflow.nodes.agent.outputVars.newOutput')@@ -734,6 +677,7 @@ describe('ComponentPicker (component-picker-block/index.tsx)', () => {).not.toBeInTheDocument()})+ const editable = screen.getByTestId(CONTENT_EDITABLE_TEST_ID)fireEvent.focus(editable)await flushNextTick()@@ -1084,8 +1028,7 @@ describe('ComponentPicker (component-picker-block/index.tsx)', () => {)const editor = await waitForEditor(captures)- const editable = screen.getByTestId(CONTENT_EDITABLE_TEST_ID)- await insertSlashTrigger(editor, editable)+ await setEditorText(editor, '/', true)expect(await screen.findByText('payload')).toBeInTheDocument()vi.useFakeTimers()diff --git a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsxindex 56a7ed63d10..97d4184f8ee 100644--- a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx+++ b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx@@ -83,7 +83,6 @@ const ComponentPicker = ({})const [editor] = useLexicalComposerContext()const triggerMatchRef = useRef<MenuTextMatch | null>(null)- const slashTypedRef = useRef(false)const baseCheckForTriggerMatch = useBasicTypeaheadTriggerMatch(triggerString, {minLength: 0,maxLength: 75,@@ -92,22 +91,10 @@ const ComponentPicker = ({const checkForTriggerMatch = useCallback((text: string, editor: LexicalEditor) => {const match = baseCheckForTriggerMatch(text, editor)- if (- match &&- triggerString === '/' &&- match.matchingString.length === 0 &&- !slashTypedRef.current- ) {- triggerMatchRef.current = null- return null- }- if (match && triggerString === '/' && match.matchingString.length === 0)- slashTypedRef.current = false-triggerMatchRef.current = matchreturn match},- [baseCheckForTriggerMatch, triggerString],+ [baseCheckForTriggerMatch],)const [queryString, setQueryString] = useState<string | null>(null)@@ -153,27 +140,7 @@ const ComponentPicker = ({if (blurTimerRef.current) clearTimeout(blurTimerRef.current)unregister()}- }, [editor, clearBlurTimer, triggerString])-- useEffect(() => {- const rootElement = editor.getRootElement()- if (!rootElement || triggerString !== '/') return-- const handleBeforeInput = (event: InputEvent) => {- if (event.inputType === 'insertText' && event.data === '/') slashTypedRef.current = true- }-- const handlePointerDown = () => {- slashTypedRef.current = false- }-- rootElement.addEventListener('beforeinput', handleBeforeInput)- rootElement.addEventListener('pointerdown', handlePointerDown)- return () => {- rootElement.removeEventListener('beforeinput', handleBeforeInput)- rootElement.removeEventListener('pointerdown', handlePointerDown)- }- }, [editor, triggerString])+ }, [editor, clearBlurTimer])eventEmitter?.useSubscription((v: EventEmitterValue) => {if (