Skip to content

feat: allow clearing persona config selection - #10171

Open
iuiu-py wants to merge 1 commit into
AstrBotDevs:masterfrom
iuiu-py:feat/persona-selector-clear
Open

iuiu-py wants to merge 1 commit into
AstrBotDevs:masterfrom
iuiu-py:feat/persona-selector-clear

Conversation

@iuiu-py

@iuiu-py iuiu-py commented Sep 21, 2026

Copy link
Copy Markdown

Motivation

When a plugin schema uses select_persona, selecting a persona leaves no way to return to the empty value. Users therefore cannot clear an explicit override even though the schema documents that an empty persona falls back to the configured persona source.

Fixes #9407

Changes

  • Added opt-in clearable support to BaseFolderItemSelector.
  • Enabled clearing for generic select_persona fields through ConfigItemRenderer.
  • Added localized clear-selection labels for en-US, zh-CN, ja-JP, and ru-RU.
  • Kept the control hidden when no persona is selected and scoped the behavior to persona config selectors.

Testing

  • Ran cd dashboard && npx pnpm@10 run typecheck.
  • Parsed all four updated locale JSON files successfully.
  • Ran git diff --check; the remote branch tree was verified against the local commit tree before opening this PR.

Summary by Sourcery

Enable users to clear selected personas from generic persona configuration fields.

New Features:

  • Allow persona configuration selectors to clear an explicitly selected persona and return to the empty fallback value.

Bug Fixes:

  • Restore the documented ability to remove an explicit persona override from generic select_persona fields.

Enhancements:

  • Add opt-in clear-selection support to reusable folder item and persona selectors while keeping it limited to populated persona configuration selections.
  • Add localized clear-selection labels for English, Chinese, Japanese, and Russian.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. Clearing the selector writes an empty persona value into the configuration, so existing selections can be lost and reverting the code would not restore them. The affected configuration is bounded and can be repaired by selecting a persona again.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 建议 插件配置 人格选择器 提供 清空当前选择 的 选项

1 participant