feat(dashboard): show source badge for skills in skills list by mantoujun12 · Pull Request #10339 · AstrBotDevs/AstrBot · GitHub
Skip to content

feat(dashboard): show source badge for skills in skills list - #10339

Merged
Soulter merged 1 commit into
AstrBotDevs:masterfrom
mantoujun12:feat/skills-source-badge
Oct 3, 2026
Merged

Soulter merged 1 commit into
AstrBotDevs:masterfrom
mantoujun12:feat/skills-source-badge

Conversation

@mantoujun12

@mantoujun12 mantoujun12 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes #10334.

In the "Plugins -> Skills" list, standalone skills (data/skills/...) and plugin-provided skills (data/plugins/<plugin>/skills/...) look identical: only the name, description, and file path are shown, so users have to read the path to tell where a skill comes from. This is confusing when a plugin is disabled or misbehaving, because its skills become unavailable and can easily be mistaken for standalone skills. The backend already returns the origin fields (source_type, source_label, plugin_name, plugin_display_name, plugin_active) and PersonaCapabilitiesEditor.vue already uses them, but SkillsSection.vue only used source_type for behavior control and never displayed the origin.

Modifications / 改动点

Only dashboard/src/components/extension/SkillsSection.vue is modified.

  • Add a source chip to every skill card in the Local Skills list: plugin skills show Plugin: {name} (preferring plugin_display_name, then source_label, then plugin_name), both shows Local + Sandbox, sandbox_only shows Sandbox Preset Skill, and everything else shows Local Skill.

  • Reuse the existing skills.sourcePlugin / skills.sourceBoth / skills.sourceSandboxOnly / skills.sourceLocalOnly i18n keys, which already exist in all four locales (en-US, ja-JP, ru-RU, zh-CN). No new translation keys are added.

  • Narrow the existing "Preset" chip condition to skill.preset, so it no longer duplicates the new sandbox-preset source label.

  • The disabled / read-only behavior and the existing "Plugin disabled" chip are intentionally unchanged.

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

Verification steps: open the Dashboard, go to Plugins -> Skills (Local mode); confirm a source chip is shown on every card (plugin skills show Plugin: <display name> and additionally Preset for built-in plugins, standalone skills show Local Skill, sandbox-preset skills show Sandbox Preset Skill); disable a plugin and confirm Plugin: <name> still shows next to Plugin disabled; switch the Dashboard language and confirm the chip text is localized.

Screenshots:

image image

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 checked the affected WebUI instructions and screenshots in docs/zh and docs/en against the changed navigation, page structure, and labels, and updated them in this PR (or explained why no documentation update is needed). For renamed, moved, or merged entry points, I included an old entry → new entry mapping in the documentation and changelog. / 我已对照变化后的 WebUI 入口、页面结构和术语,核对并在本 PR 中更新 docs/zh 和 docs/en 的相关操作说明与截图(或说明无需更新文档的原因)。入口改名、移动或合并时,已在文档和 changelog 中补充 旧入口 → 新入口 对照。

    • No docs update needed: this change only adds a source label to the existing skill cards, and does not change navigation, page structure, terminology, or entry points.
  • 🤓 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.txt and pyproject.toml. / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txt 和 pyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code. / 我的更改没有引入恶意代码。

Summary by Sourcery

Display each skill’s origin directly in the Dashboard skills list.

New Features:

  • Add localized source badges to skill cards so users can distinguish plugin-provided, local, combined, and sandbox preset skills.

Enhancements:

  • Preserve existing preset and plugin-disabled indicators while avoiding duplicate preset labeling.

Display the origin of each skill in the Local Skills list so users can
tell independently installed skills apart from plugin-provided and
sandbox-preset ones without reading the file path.

- Add a source chip in the skill card title area:
  - plugin skills show "Plugin: {name}", preferring the plugin display
    name and falling back to the source label / plugin name
  - local-only, local + sandbox and sandbox-preset skills get their own
    labels
- Reuse the existing skills.sourcePlugin/sourceBoth/sourceSandboxOnly/
  sourceLocalOnly i18n keys that are already present in all four locales.
- Narrow the existing "preset" chip condition to skill.preset so it no
  longer duplicates the sandbox-preset source label.
- Keep the disabled and read-only behavior unchanged.

@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

Approved.


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

@Soulter
Soulter merged commit 44b5c1b into AstrBotDevs:master Oct 3, 2026
23 checks passed
@mantoujun12
mantoujun12 deleted the feat/skills-source-badge branch October 3, 2026 17:14
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] Skill 页面为插件提供的 Skill 增加来源标识

2 participants