feat: support chatflow start node custom input field hidden
Summary
This PR introduces hide option for chatflow start node custom input field.
Close https://github.com/langgenius/dify/issues/19336 .
Screenshots
Before
After
required and hide options cannot be selected at the same time.
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.
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) andcd web && npx lint-staged(frontend) to appease the lint gods
LGTM
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?
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.
required and hide have a partial conflict, I plan to adjust it so they cannot be checked simultaneously.
I just updated the PR.
There are two changes worth noting:
- Required and hide cannot be selected at the same time.
- 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? 🤔
very good!!!