fix(dashboard): apply labels mapping for list options in config renderer#6844
fix(dashboard): apply labels mapping for list options in config renderer#6844Foolllll-J wants to merge 1 commit intoAstrBotDevs:masterfrom
Conversation
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Now that
listoptions usegetSelectItems(itemMeta)withitem-title/item-value, consider reusing the same mapping helper for the genericv-selectbranch below to keep option shaping consistent across types. - Double-check that
modelValueforlistfields remains aligned with the newitem-value="value"mapping (especially for multi-select), and thatgetSelectItemsgracefully handles both raw values and pre-shaped{ title, value }options to avoid double-mapping.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Now that `list` options use `getSelectItems(itemMeta)` with `item-title`/`item-value`, consider reusing the same mapping helper for the generic `v-select` branch below to keep option shaping consistent across types.
- Double-check that `modelValue` for `list` fields remains aligned with the new `item-value="value"` mapping (especially for multi-select), and that `getSelectItems` gracefully handles both raw values and pre-shaped `{ title, value }` options to avoid double-mapping.
## Individual Comments
### Comment 1
<location path="dashboard/src/components/shared/ConfigItemRenderer.vue" line_range="89-98" />
<code_context>
</div>
- <v-combobox
+ <v-select
v-else-if="itemMeta?.type === 'list' && itemMeta?.options"
:model-value="modelValue"
</code_context>
<issue_to_address>
**question (bug_risk):** Switch from v-combobox to v-select removes ability to enter arbitrary values
This change removes free-form input: `v-select` only allows choosing from predefined items, while `v-combobox` also accepted arbitrary text. For `type === 'list'` configs, this could break cases where users rely on adding values not in `options`. If free-form entry is still required, consider keeping `v-combobox` or adding explicit support for custom values; otherwise, please confirm no existing configs depend on non-predefined entries.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| <v-select | ||
| v-else-if="itemMeta?.type === 'list' && itemMeta?.options" | ||
| :model-value="modelValue" | ||
| @update:model-value="emitUpdate" | ||
| :items="itemMeta.options" | ||
| :items="getSelectItems(itemMeta)" | ||
| item-title="title" | ||
| item-value="value" | ||
| :disabled="itemMeta?.readonly" | ||
| density="compact" | ||
| variant="outlined" |
There was a problem hiding this comment.
question (bug_risk): Switch from v-combobox to v-select removes ability to enter arbitrary values
This change removes free-form input: v-select only allows choosing from predefined items, while v-combobox also accepted arbitrary text. For type === 'list' configs, this could break cases where users rely on adding values not in options. If free-form entry is still required, consider keeping v-combobox or adding explicit support for custom values; otherwise, please confirm no existing configs depend on non-predefined entries.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the display of Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
本次 PR 成功修复了配置页面中 list 类型(多选)选项无法正确显示 label 的问题。通过将 v-combobox 替换为 v-select 并正确地提供了 items、item-title 和 item-value,确保了标签的正确显示,同时限制了用户只能从预定义列表中选择,增强了数据规范性。代码改动正确且有效。
另外,我注意到一个相关的潜在问题:在 ConfigItemRenderer.vue 的 105-115 行,用于单选列表的 v-select 组件也调用了 getSelectItems,但缺少 item-title 和 item-value 属性,这可能在有 labels 的情况下导致显示错误。建议在后续 PR 中修复此问题以保证一致性。
修复配置页面中
list类型选项显示异常的问题。此前会显示
value,而不是_conf_schema.json中配置的label,导致可读性较差。Modifications / 改动点
title/value映射渲染list选项。label而不是原始value。dashboard/src/components/shared/ConfigItemRenderer.vueScreenshots or Test Results / 运行截图或测试结果
修改后:

修改前:

Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Fix the dashboard config renderer so list-type options correctly use mapped titles/values for display and selection.
Bug Fixes: