[PR #23685] Feat node search #30356

Closed
opened 2026-02-21 20:47:20 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/23685

State: closed
Merged: Yes


Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Special thanks to @croatialu, @ZeroZ-lab, @HyaCiovo, @MatriQ, @lyzno1

Close https://github.com/langgenius/dify/pull/22574
Close https://github.com/langgenius/dify/issues/22657

This pull request introduces a new "Goto Anything" feature to the application, enabling users to quickly search and navigate between apps, knowledge bases, plugins, and workflow nodes. The implementation includes new context providers, action handlers, and supporting types to make the feature extensible and context-aware. Additionally, the base Input component is refactored to support forwarding refs, improving its usability in forms.

Goto Anything Feature Implementation

  • Added the GotoAnything component to the common layout, making it accessible across the application (web/app/(commonLayout)/layout.tsx). [1] [2]
  • Created a context provider (GotoAnythingProvider and useGotoAnythingContext) to track whether the user is on a workflow page, allowing context-sensitive search results (web/app/components/goto-anything/context.tsx).

Search Actions and Extensibility

  • Implemented modular action handlers for searching apps, knowledge bases, plugins, and workflow nodes, each with its own parser and search logic (web/app/components/goto-anything/actions/app.tsx, knowledge.tsx, plugin.tsx, workflow-nodes.tsx). [1] [2] [3] [4]
  • Centralized action registration and search orchestration in an Actions object, with helper functions for matching and executing searches (web/app/components/goto-anything/actions/index.ts).
  • Defined unified types for search results and actions to ensure type safety and extensibility across all search modules (web/app/components/goto-anything/actions/types.ts).

Component Refactoring

  • Refactored the base Input component to use React.forwardRef, allowing refs to be passed for better form integration and accessibility (web/app/components/base/input/index.tsx). [1] [2] [3]

Screenshots

Before After
... image
... image
... image

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/23685 **State:** closed **Merged:** Yes --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 2. Ensure there is an associated issue and you have been assigned to it > 3. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## Summary **Special thanks to** @croatialu, @ZeroZ-lab, @HyaCiovo, @MatriQ, @lyzno1 Close https://github.com/langgenius/dify/pull/22574 Close https://github.com/langgenius/dify/issues/22657 This pull request introduces a new "Goto Anything" feature to the application, enabling users to quickly search and navigate between apps, knowledge bases, plugins, and workflow nodes. The implementation includes new context providers, action handlers, and supporting types to make the feature extensible and context-aware. Additionally, the base `Input` component is refactored to support forwarding refs, improving its usability in forms. **Goto Anything Feature Implementation** * Added the `GotoAnything` component to the common layout, making it accessible across the application (`web/app/(commonLayout)/layout.tsx`). [[1]](diffhunk://#diff-11f306f8e2a10f58c9ade4641817f8abbddec8538a30f8cb1c58533290e05746R11) [[2]](diffhunk://#diff-11f306f8e2a10f58c9ade4641817f8abbddec8538a30f8cb1c58533290e05746R26) * Created a context provider (`GotoAnythingProvider` and `useGotoAnythingContext`) to track whether the user is on a workflow page, allowing context-sensitive search results (`web/app/components/goto-anything/context.tsx`). **Search Actions and Extensibility** * Implemented modular action handlers for searching apps, knowledge bases, plugins, and workflow nodes, each with its own parser and search logic (`web/app/components/goto-anything/actions/app.tsx`, `knowledge.tsx`, `plugin.tsx`, `workflow-nodes.tsx`). [[1]](diffhunk://#diff-a7f1ff1b10a477b8230ba9d843698527e187665b2a4a8bd564cb772872e813a4R1-R53) [[2]](diffhunk://#diff-0a6c8f9900dbc778ae31539cddcd479ef8dcf4279f7d5f05954bc9d2c46e3f9fR1-R50) [[3]](diffhunk://#diff-5d1479184422506a23aa171e7eed7b152fe53e708419762fd64fe509727fc632R1-R41) [[4]](diffhunk://#diff-9bb7c39c249d950a2b71fa3d437d3fc457d44af0b95289b3b64f75b0059d7de1R1-R43) * Centralized action registration and search orchestration in an `Actions` object, with helper functions for matching and executing searches (`web/app/components/goto-anything/actions/index.ts`). * Defined unified types for search results and actions to ensure type safety and extensibility across all search modules (`web/app/components/goto-anything/actions/types.ts`). **Component Refactoring** * Refactored the base `Input` component to use `React.forwardRef`, allowing refs to be passed for better form integration and accessibility (`web/app/components/base/input/index.tsx`). [[1]](diffhunk://#diff-8e7dc9500c7fe33f490bc98b4a0f355347708792d912195e042e1323fdf08da3L35-R35) [[2]](diffhunk://#diff-8e7dc9500c7fe33f490bc98b4a0f355347708792d912195e042e1323fdf08da3L50-R56) [[3]](diffhunk://#diff-8e7dc9500c7fe33f490bc98b4a0f355347708792d912195e042e1323fdf08da3L95-R98) ## Screenshots | Before | After | |--------|-------| | ... | <img width="1018" height="716" alt="image" src="https://github.com/user-attachments/assets/ad89a289-11b5-473b-a82a-e3d6e6ee9b61" /> | | ... | <img width="1020" height="822" alt="image" src="https://github.com/user-attachments/assets/c4e25416-c1dc-4300-879f-2e2868f34b28" /> | | ... | <img width="1010" height="708" alt="image" src="https://github.com/user-attachments/assets/545cbb84-85cb-4629-a53d-d261c3cb59b0" /> | ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:47:20 -05:00
yindo closed this issue 2026-02-21 20:47:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30356