Skip to content

feat: add search input field #18409

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? No Sign in to your account

Merged
merged 2 commits into from
Apr 22, 2025

Conversation

441126098
Copy link
Contributor

@441126098 441126098 commented Apr 19, 2025

Summary

Add a search input box to the variable selection popup in the text editor.Refactor blur event handling mechanism in editor component.

Resolves #17364 Resolves #18100

Screenshots

Before After
image imageimage

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there awas 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

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. ☕️ typescript Pull request that update TypeScript code. 💪 enhancement New feature or request labels Apr 19, 2025
@crazywoola crazywoola requested review from Copilot and zxhlyh April 19, 2025 15:41
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a search input field to the variable selection popup and refactors the blur event handling mechanism in the editor component. It updates the VarReferenceVars component to support onClose and onBlur callbacks, modifies the on-blur-or-focus block to ignore blur events triggered by interacting with the search input, and adjusts the component picker to integrate these new behaviors.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx Added search input with onKeyDown and onBlur handlers for dismissal via Escape key or blur events.
web/app/components/base/prompt-editor/plugins/on-blur-or-focus-block.tsx Refactored the blur command to guard against triggering onBlur for search input interactions.
web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx Updated usage of VarReferenceVars to pass the new onClose and onBlur callbacks.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 22, 2025
@crazywoola crazywoola merged commit 94e22ba into langgenius:main Apr 22, 2025
5 checks passed
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
💪 enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files. ☕️ typescript Pull request that update TypeScript code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Variable selectors support matching via partial strings Search field in variable selector popover
2 participants