Skip to content

Conversation

@Soulter
Copy link
Member

@Soulter Soulter commented Dec 30, 2025

fixes: #4254

Motivation

  • Provide a clear, explicit way for users to add a new list entry from the ListConfigItem dialog instead of relying only on Enter key.
  • Ensure the single-item mode label is localized and not a hard-coded string.
  • Keep UX consistent with existing i18n strings in the dashboard.

Description

  • Use t('core.common.list.addMore') for the single-item mode action label instead of a hard-coded string in ListConfigItem.vue.
  • Add an explicit Add button next to the new-item text field that calls addItem() and is disabled when the input is empty in ListConfigItem.vue.
  • Add new i18n key addMore to dashboard/src/i18n/locales/en-US/core/common.json and dashboard/src/i18n/locales/zh-CN/core/common.json.
  • Minor wiring only; no changes to business logic beyond adding the new UI control.

Testing

  • Started the dashboard dev server with npm --prefix dashboard run dev and confirmed Vite reported ready (succeeded).
  • Captured a UI screenshot using a Playwright script (succeeded and produced an artifact screenshot).
  • No unit or integration test suites were executed as part of this change.

Codex Task

Summary by Sourcery

为列表配置对话框添加一个显式的、本地化的控件用于向列表中添加项目,同时使该组件与现有的 i18n 字符串保持一致。

New Features:

  • 在 ListConfigItem 对话框的列表项输入字段旁新增一个 Add 按钮。

Enhancements:

  • 使用现有的 i18n 基础设施,本地化 ListConfigItem 中单项模式操作标签。

Documentation:

  • 在英文和中文的本地化文件中扩展与列表相关的、用于 Add 操作的新的 i18n 键。
Original summary in English

Summary by Sourcery

Add an explicit, localized control for adding items to list configuration dialogs while aligning the component with existing i18n strings.

New Features:

  • Introduce an Add button next to the list item input field in ListConfigItem dialogs.

Enhancements:

  • Localize the single-item mode action label in ListConfigItem using existing i18n infrastructure.

Documentation:

  • Extend English and Chinese locale files with new list-related i18n keys for the Add actions.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Dec 30, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - 我已经留下了一些整体性的反馈:

  • 用于显式“添加”按钮的新文案键 t('core.common.list.addButton') 没有在描述中提及,也没有出现在 i18n 的 diff 代码片段中;请确保它已经实际添加到两个本地化 JSON 文件中,并且命名与其他列表相关的键保持一致。
  • 针对新增的、位于文本输入框旁边的内联“添加”按钮,请再次检查在窄视口下的布局(例如输入框和按钮的换行、拥挤等问题),如有必要,可以考虑增加一点间距,或者使用容器类来保持良好的视觉间距。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- The new `t('core.common.list.addButton')` key used for the explicit Add button isn’t mentioned in the description and isn’t visible in the i18n diff snippet; please ensure it’s actually added to both locale JSON files and named consistently with the other list-related keys.
- With the new inline Add button next to the text field, double-check the layout for narrow viewports (e.g., wrapping or crowding of the field and buttons) and consider adding a small gap or using a container class if necessary to maintain visual spacing.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎帮忙分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English

Hey - I've left some high level feedback:

  • The new t('core.common.list.addButton') key used for the explicit Add button isn’t mentioned in the description and isn’t visible in the i18n diff snippet; please ensure it’s actually added to both locale JSON files and named consistently with the other list-related keys.
  • With the new inline Add button next to the text field, double-check the layout for narrow viewports (e.g., wrapping or crowding of the field and buttons) and consider adding a small gap or using a container class if necessary to maintain visual spacing.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `t('core.common.list.addButton')` key used for the explicit Add button isn’t mentioned in the description and isn’t visible in the i18n diff snippet; please ensure it’s actually added to both locale JSON files and named consistently with the other list-related keys.
- With the new inline Add button next to the text field, double-check the layout for narrow viewports (e.g., wrapping or crowding of the field and buttons) and consider adding a small gap or using a container class if necessary to maintain visual spacing.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dosubot dosubot bot added the area:webui The bug / feature is about webui(dashboard) of astrbot. label Dec 30, 2025
@Soulter Soulter changed the title Add Add button to ListConfigItem with i18n support perf: add Add button to ListConfigItem Dec 30, 2025
@Soulter Soulter merged commit b5a4b80 into master Dec 30, 2025
6 checks passed
@Soulter Soulter deleted the codex/add-add-button-to-listconfigitem branch December 30, 2025 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. codex size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]添加 token 的时候,希望加入一个添加的按钮。

2 participants