dify icon indicating copy to clipboard operation
dify copied to clipboard

feat: support chatflow start node custom input field hidden

Open ModyQyW opened this issue 8 months ago • 5 comments

Summary

This PR introduces hide option for chatflow start node custom input field.

Close https://github.com/langgenius/dify/issues/19336 .

Screenshots

Before

image image image image image image

After

required and hide options cannot be selected at the same time.

image image image image image image image image

With hide option enabled, input fields are hidden. Developers need to ensure the availability of the field, otherwise the workflow may not function properly.

If all input fields enable hide option, the InputsForm will not be displayed and the user can directly initiate a conversation.

If not all inputs enable hide option, the InputsForm only display input fields with hide disabled and the user still needs to perform necessary input and click confirm.

image image image image

I only update en-US i18n. It seems that we have a auto-gen script that will update others.

Feel free to tell me your thoughts. Thank you! 🙏

Checklist

[!IMPORTANT]
Please review the checklist below before submitting your pull request.

  • [ ] This change requires a documentation update, included: Dify Document
  • [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

ModyQyW avatar May 14 '25 08:05 ModyQyW

LGTM

lexmin0412 avatar May 14 '25 09:05 lexmin0412

I want to know what problem the developer hides the variable to solve? Because this means that the variable is not visible to the user and cannot be initialized. How can it be used in workflow/chatflow applications?

Yevanchen avatar May 15 '25 03:05 Yevanchen

I want to know what problem the developer hides the variable to solve? Because this means that the variable is not visible to the user and cannot be initialized. How can it be used in workflow/chatflow applications?

The starting point of hide should be that there is some information that needs to be passed from a third-party system into dify, but which the user does not need to manually fill in, does not need to care about, or is not expected to modify. This is what is being referred to https://github.com/langgenius/dify/issues/19336.

ModyQyW avatar May 15 '25 04:05 ModyQyW

required and hide have a partial conflict, I plan to adjust it so they cannot be checked simultaneously.

ModyQyW avatar May 15 '25 04:05 ModyQyW

I just updated the PR.

There are two changes worth noting:

  1. Required and hide cannot be selected at the same time.
  2. The display logic for preview, chat, and chatbot is now consistent. 2.1. If all input fields have hide set to true, the input form will not be displayed. 2.2. If some input fields have hide set to true, only the input fields where hide is not true will be displayed.

Maybe a backend validation is required? 🤔

ModyQyW avatar May 16 '25 06:05 ModyQyW

very good!!!

kanjoe888 avatar May 21 '25 13:05 kanjoe888