-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: optimize plugin update changelog feature, refactor to reuse Rea… #4337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Soulter
merged 2 commits into
AstrBotDevs:master
from
clown145:feature/plugin-update-changelog
Jan 6, 2026
Merged
feat: optimize plugin update changelog feature, refactor to reuse Rea… #4337
Soulter
merged 2 commits into
AstrBotDevs:master
from
clown145:feature/plugin-update-changelog
Jan 6, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…dmeDialog and support independent view entry
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - 我发现了 1 个问题,并留下了一些整体性的反馈:
- 在 ReadmeDialog 中,
error分支现在渲染的是通用的「空状态」文案,而不是实际的错误信息,这会让调试真实故障(网络/服务器错误)变得更困难;建议保留并单独展示后端/异常信息,与「无内容」的空状态区分开来。 - 新增的
/api/plugin/changelog接口在没有 changelog 文件时会返回错误,UI 会把它当作通用失败来处理;可能更清晰的做法是返回ok,但内容为空或带上一个明确的标记,以便前端可以渲染专门的「暂无更新日志」状态,而不是错误。 - ExtensionCard 中的「查看更新日志」/
viewChangelog项目前对所有已安装插件都显示,而不管是否真的存在 changelog;你可能需要根据条件展示这一操作(例如仅在has_update为 true 或探测成功之后)以避免用户每次点开都只看到一个「缺少更新日志」的状态。
给 AI Agent 的提示词
Please address the comments from this code review:
## Overall Comments
- In ReadmeDialog, the `error` branch now renders the generic empty-state copy instead of the actual error message, which makes debugging real failures (network/server errors) harder; consider preserving and displaying the backend/exception message separately from the “no content” empty state.
- The new `/api/plugin/changelog` endpoint returns an error when no changelog file exists, which the UI treats as a generic failure; it may be clearer to return `ok` with empty content or a specific flag so the frontend can render a dedicated “no changelog available” state instead of an error.
- The “查看更新日志”/`viewChangelog` entry in ExtensionCard is shown for all installed plugins regardless of whether a changelog actually exists; you might want to conditionally show this action (e.g. only when `has_update` is true or after a successful probe) to avoid users opening a dialog that always shows a missing-changelog state.
## Individual Comments
### Comment 1
<location> `dashboard/src/components/shared/ReadmeDialog.vue:170-179` </location>
<code_context>
<!-- 最多一行 -->
- <div class="text-caption"
- style="color: gray; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 84px;">
+ <div
+ class="text-caption"
+ style="
</code_context>
<issue_to_address>
**issue (bug_risk):** Error state no longer surfaces the backend error message and is indistinguishable from the empty state.
In the `v-else-if="error"` branch, the `error` string is ignored and we always show `modeConfig.emptyTitle` / `modeConfig.emptySubtitle` with a warning icon. This hides useful failure details (e.g. network or permission errors) and makes the view nearly identical to the empty state. Please either surface `error` as the main message with mode-specific copy as secondary context, or give the error state a clearly distinct visual treatment from the empty state.
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- In ReadmeDialog, the
errorbranch now renders the generic empty-state copy instead of the actual error message, which makes debugging real failures (network/server errors) harder; consider preserving and displaying the backend/exception message separately from the “no content” empty state. - The new
/api/plugin/changelogendpoint returns an error when no changelog file exists, which the UI treats as a generic failure; it may be clearer to returnokwith empty content or a specific flag so the frontend can render a dedicated “no changelog available” state instead of an error. - The “查看更新日志”/
viewChangelogentry in ExtensionCard is shown for all installed plugins regardless of whether a changelog actually exists; you might want to conditionally show this action (e.g. only whenhas_updateis true or after a successful probe) to avoid users opening a dialog that always shows a missing-changelog state.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In ReadmeDialog, the `error` branch now renders the generic empty-state copy instead of the actual error message, which makes debugging real failures (network/server errors) harder; consider preserving and displaying the backend/exception message separately from the “no content” empty state.
- The new `/api/plugin/changelog` endpoint returns an error when no changelog file exists, which the UI treats as a generic failure; it may be clearer to return `ok` with empty content or a specific flag so the frontend can render a dedicated “no changelog available” state instead of an error.
- The “查看更新日志”/`viewChangelog` entry in ExtensionCard is shown for all installed plugins regardless of whether a changelog actually exists; you might want to conditionally show this action (e.g. only when `has_update` is true or after a successful probe) to avoid users opening a dialog that always shows a missing-changelog state.
## Individual Comments
### Comment 1
<location> `dashboard/src/components/shared/ReadmeDialog.vue:170-179` </location>
<code_context>
<!-- 最多一行 -->
- <div class="text-caption"
- style="color: gray; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 84px;">
+ <div
+ class="text-caption"
+ style="
</code_context>
<issue_to_address>
**issue (bug_risk):** Error state no longer surfaces the backend error message and is indistinguishable from the empty state.
In the `v-else-if="error"` branch, the `error` string is ignored and we always show `modeConfig.emptyTitle` / `modeConfig.emptySubtitle` with a warning icon. This hides useful failure details (e.g. network or permission errors) and makes the view nearly identical to the empty state. Please either surface `error` as the main message with mode-specific copy as secondary context, or give the error state a clearly distinct visual treatment from the empty state.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
|
建议在插件开发规范中推荐 CHANGELOG.md 的折叠布局逻辑 优化建议:由于 Dashboard 的更新日志弹窗空间有限,为了让用户在更新完成后能迅速获取“当前版本”的关键变化,建议在插件编写规范中加入如下建议:
这种做法可以极大提升弹窗展示的直观性,避免用户在历史数据中盲目滚动。 |
Soulter
approved these changes
Jan 6, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature:plugin
The bug / feature is about AstrBot plugin system.
lgtm
This PR has been approved by a maintainer
size:XL
This PR changes 500-999 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat: optimize plugin update changelog feature, refactor to reuse ReadmeDialog and support independent view entry
为插件系统添加了更新日志展示功能,让用户在更新插件后能及时了解改动内容。
Modifications / 改动点
后端 (Backend):
plugin.py中实现了/api/plugin/changelog接口,支持从插件根目录读取本地CHANGELOG.md(及其变体文件名)。前端 (Frontend):
ReadmeDialog.vue,通过新增的mode属性支持readme和changelog两种展示模式,减少冗余代码。ExtensionCard.vue的更多操作菜单中新增了“查看更新日志”选项,支持随时查看。This is NOT a breaking change. / 这不是一个破坏性变更。
Screenshots or Test Results / 运行截图或测试结果
CHANGELOG.md内容。Checklist / 检查清单
requirements.txt和pyproject.toml文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations inrequirements.txtandpyproject.toml.Summary by Sourcery
为扩展系统添加插件更新日志支持,并重构 Readme 对话框,以便在 README 和更新日志视图之间复用。
新功能:
增强改进:
Original summary in English
Summary by Sourcery
Add plugin changelog support to the extension system and refactor the Readme dialog for reuse across README and changelog views.
New Features:
Enhancements: