Skip to content

feat: default value option for select input fields#21192

Merged
crazywoola merged 6 commits intolanggenius:mainfrom
antonko:feat/21072-default-value-select-field
Jul 28, 2025
Merged

feat: default value option for select input fields#21192
crazywoola merged 6 commits intolanggenius:mainfrom
antonko:feat/21072-default-value-select-field

Conversation

@antonko
Copy link
Copy Markdown
Contributor

@antonko antonko commented Jun 18, 2025

Summary

Added default value support for select input fields in app variable configuration. This allows developers to set pre-selected options for users, improving UX when most users make the same choice.

Changes:

  • Added UI for selecting default value in config modal for select fields
  • Updated chat components to handle default values correctly
  • Added translations for new interface elements across all supported languages

Technical notes:

  • No backend changes required as the default field already existed in data types
  • Frontend types also didn't require changes

Fixes #21072

Screenshots

Before After
image Снимок экрана 2025-06-19 013431

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

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. 💪 enhancement New feature or request 📚 documentation Improvements or additions to documentation labels Jun 18, 2025
@crazywoola crazywoola self-assigned this Jul 8, 2025
@crazywoola crazywoola mentioned this pull request Jul 8, 2025
5 tasks
@crazywoola
Copy link
Copy Markdown
Member

crazywoola commented Jul 9, 2025

image

image

I have tried this, however it seems that it doesn't work as expected.

  • Options more than 5 will become invisible
  • Both debug and app in explore page didn't receive the default value.

@crazywoola
Copy link
Copy Markdown
Member

crazywoola commented Jul 15, 2025

image

I have tested it in shared application and explore, it works well, however it seems you missed the debug area.

@antonko
Copy link
Copy Markdown
Contributor Author

antonko commented Jul 16, 2025

I have tested it in shared application and explore, it works well, however it seems you missed the debug area.

@crazywoola
Thanks for pointing this out — I might have missed that detail. I’ll double‑check everything and push an update shortly

@crazywoola
Copy link
Copy Markdown
Member

Hey @antonko Just check in to see if there are new progresses. :)

@crazywoola crazywoola force-pushed the feat/21072-default-value-select-field branch from 073ed54 to d367d64 Compare July 28, 2025 03:33
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 28, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 28, 2025
@crazywoola crazywoola merged commit 1575711 into langgenius:main Jul 28, 2025
6 checks passed
@jyokotori
Copy link
Copy Markdown

When I set a default value that is not the first option in a dropdown menu, the interface visually highlights the first item when starting a run.

I’m not sure if this is a bug or just a UI inconsistency, but it might be misleading for users who think the first option is always selected.

Sorry if this is a false alarm!
image

@dosubot dosubot bot mentioned this pull request Aug 4, 2025
6 tasks
@DavideDelbianco
Copy link
Copy Markdown
Contributor

@crazywoola you reported that the default value wasn't being picked up by the form
And the issue is still there in 1.7.1 #23376

image I have tested it in shared application and explore, it works well, however it seems you missed the debug area.

@AuditAIH
Copy link
Copy Markdown
Contributor

AuditAIH commented Aug 13, 2025

@antonko image

@antonko
Copy link
Copy Markdown
Contributor Author

antonko commented Aug 13, 2025

@AuditAIH I’m not sure this is really necessary, as it feels a bit redundant to me.

tutkun pushed a commit to tutkun/dify that referenced this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation Improvements or additions to documentation 💪 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add default value for input field

5 participants