[PR #20473] Feat/15534 support replacing the bot in chat input placeholder with the bots name #29398

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

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

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>.

to close #15534

Summary

This pull request introduces enhancements to the chatbot configuration and user interface, focusing on improved customization and localization. The key changes include adding support for hiding and marking prompt variables as required, passing a customizable bot name to the chat input area, and updating translations to reflect this new functionality.

Chatbot Configuration Enhancements:

  • Updated PromptVariable type in web/models/debug.ts to include hide and required properties, enabling frontend customization for hiding variables and marking them as required.
  • Modified inputsForm in DebugWithMultipleModel to map hide and required properties from PromptVariable.

Chat Input Area Improvements:

  • Added a botName property to the ChatInputAreaProps type in web/app/components/base/chat/chat/chat-input-area/index.tsx, allowing the placeholder text in the chat input to dynamically include the bot's name. [1] [2]
  • Updated the placeholder in ChatInputArea to use the new botName property, enhancing user experience by personalizing the input field.

Localization Updates:

  • Updated the inputPlaceholder translation in multiple language files (e.g., de-DE, en-US, es-ES, etc.) to support dynamic insertion of the bot name using the {{botName}} placeholder. [1] [2] [3] [4] and others)

Integration with Chat Components:

  • Passed the bot name (appData?.site.title || 'Bot') to ChatInputArea in the Chat component and DebugWithMultipleModel component to ensure the bot name is used consistently across the application. [1] [2]

Screenshots

Before After
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/20473 **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>`. to close #15534 ## Summary This pull request introduces enhancements to the chatbot configuration and user interface, focusing on improved customization and localization. The key changes include adding support for hiding and marking prompt variables as required, passing a customizable bot name to the chat input area, and updating translations to reflect this new functionality. ### Chatbot Configuration Enhancements: * Updated `PromptVariable` type in `web/models/debug.ts` to include `hide` and `required` properties, enabling frontend customization for hiding variables and marking them as required. * Modified `inputsForm` in `DebugWithMultipleModel` to map `hide` and `required` properties from `PromptVariable`. ### Chat Input Area Improvements: * Added a `botName` property to the `ChatInputAreaProps` type in `web/app/components/base/chat/chat/chat-input-area/index.tsx`, allowing the placeholder text in the chat input to dynamically include the bot's name. [[1]](diffhunk://#diff-0f2fea1c6856ffaf8e9ad3be67d02e176e4ed92c585847813210b58a642c2767R32) [[2]](diffhunk://#diff-0f2fea1c6856ffaf8e9ad3be67d02e176e4ed92c585847813210b58a642c2767R47) * Updated the placeholder in `ChatInputArea` to use the new `botName` property, enhancing user experience by personalizing the input field. ### Localization Updates: * Updated the `inputPlaceholder` translation in multiple language files (e.g., `de-DE`, `en-US`, `es-ES`, etc.) to support dynamic insertion of the bot name using the `{{botName}}` placeholder. [[1]](diffhunk://#diff-7a9194266549a82aaf21ea87274cc9c268661980f0e668c0e4bfd0efb6219c3cL553-R553) [[2]](diffhunk://#diff-834afc54ad67c45f7cbcaf316e0fddab37b61a7dd741a2abff1a34e4ffdcb620L572-R572) [[3]](diffhunk://#diff-f7c6ddefe609696ace4faad8199532279489f4d909cf6d49520a5670c575cdb4L557-R557) [[4]](diffhunk://#diff-95501ca2adeda02b95aa49958bcbff0be8159993143c4d8a1bfe666f56e7218fL553-R553) and others) ### Integration with Chat Components: * Passed the bot name (`appData?.site.title || 'Bot'`) to `ChatInputArea` in the `Chat` component and `DebugWithMultipleModel` component to ensure the bot name is used consistently across the application. [[1]](diffhunk://#diff-1997e9de3191a3a5147e5a628bb6b4bec22e6af48b4e3907a56d4a7fbcac73c4R306) [[2]](diffhunk://#diff-519d314e38314e3a4be322e9e2e72a53412d2ee9064341c1502d3c204f4fd8daR144) ## Screenshots | Before | After | |--------|-------| | ![image](https://github.com/user-attachments/assets/aa4f568b-a4ee-40af-8f3e-def594e4383a) | ![image](https://github.com/user-attachments/assets/6190f7c2-b6d7-48ea-81f1-7444cf201eaa) | ## 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:45:29 -05:00
yindo closed this issue 2026-02-21 20:45:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#29398