Skip to content

Conversation

@clown145
Copy link
Contributor

@clown145 clown145 commented Jan 2, 2026

Motivation / 改动点描述

优化插件页面的更新体验。目前的更新按钮依赖插件市场数据加载逻辑,存在延迟且在未检测到新版本时无法操作。此改动允许用户随时点击更新按钮,并在无新版本时通过弹窗确认进行“强制重新安装”,方便用户手动拉取远程仓库的最新修改。

Modifications / 改动点

  • ExtensionPage.vue:

    • 移除了列表视图更新按钮的显示限制(常亮)。
    • 修改 updateExtension 逻辑:无新版本时弹出强制更新确认对话框。
    • 添加了强制更新确认对话框组件。
  • ExtensionCard.vue:

    • 移除了卡片菜单中更新选项的禁用限制。
    • 根据是否有新版本动态显示“更新到 vX.X.X”或“重新安装”。
  • i18n: 添加了中英文对应的翻译文本(强制更新提示、重新安装按钮文本)。

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

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

验证步骤 (Verification Steps):

  1. 进入“插件管理”页面。
  2. 列表视图中,确认所有已安装插件的“更新”按钮始终可见。
  3. 对于无新版本的插件:点击“更新”应弹出确认框,确认后执行更新。
  4. 卡片视图中,确认菜单项在无新版本时显示“重新安装”且可点击。
  5. 确认点击“重新安装”后也能正常弹出强制更新确认对话框。

运行截图:
chrome_HetL2yeuLV


Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
  • 👀 我的更改经过了良好的测试,并已在上方提供了“验证步骤”。
  • 🤓 我确保没有引入新依赖库。
  • 😮 我的更改没有引入恶意代码。

Summary by Sourcery

允许用户在任何时间触发扩展更新,并在未检测到新版本时,增加强制重新安装的确认流程。

新功能:

  • 即使未检测到新版本,也允许触发扩展更新,并在强制重新安装时显示确认对话框。
  • 根据扩展更新的可用性,在卡片操作标签中区分“更新到新版本”和“重新安装当前版本”。

增强项:

  • 在扩展列表和卡片视图中保持更新操作可见且可点击,以改进插件更新体验。
Original summary in English

Summary by Sourcery

Enable users to trigger extension updates at any time and add a flow for confirming forced reinstalls when no new version is detected.

New Features:

  • Allow triggering extension updates even when no new version has been detected, with a confirmation dialog for forced reinstall.
  • Differentiate card action labels between updating to a new version and reinstalling the current version based on extension update availability.

Enhancements:

  • Keep the update action visible and clickable in the extensions list and card views to improve the plugin update experience.

@auto-assign auto-assign bot requested review from Fridemn and anka-afk January 2, 2026 09:29
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 2, 2026
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 - 我发现了 1 个问题,并留下了一些整体性的反馈:

  • 建议在强制更新确认弹窗的文案中加入目标扩展的名称,这样用户可以清楚知道即将重新安装的是哪个插件。
  • confirmForceUpdate 触发 updateExtension 时,更新按钮仍然是可点击状态;你可能需要防止重复点击(例如复用现有的 loading 状态),以避免为同一个扩展排队多个强制更新请求。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- Consider including the target extension’s name in the force update confirmation dialog text so users are clear which plugin is about to be reinstalled.
- When `confirmForceUpdate` triggers `updateExtension`, the update button remains enabled; you may want to guard against duplicate clicks (e.g., by reusing the existing loading state) to avoid queuing multiple forced updates for the same extension.

## Individual Comments

### Comment 1
<location> `dashboard/src/views/ExtensionPage.vue:1133-1134` </location>
<code_context>

-                          <v-btn icon size="small" @click="updateExtension(item.name)"
-                            :v-show="item.has_update">
+                          <v-btn icon size="small" @click="updateExtension(item.name)">
                             <v-icon>mdi-update</v-icon>
                             <v-tooltip activator="parent" location="top">{{ tm('tooltips.update') }}</v-tooltip>
                           </v-btn>
</code_context>

<issue_to_address>
**suggestion:** Consider aligning the button label/icon with the new reinstall/force-update behavior.

This now calls `updateExtension` even when `item.has_update` is false, potentially triggering a reinstall flow while the icon/tooltip still suggest a normal update. Consider adjusting the icon and tooltip based on `item.has_update` (as with the card menu text) so users can tell when they’re updating vs reinstalling.

Suggested implementation:

```
                          <v-btn icon size="small" @click="updateExtension(item.name)">
                            <v-icon>{{ item.has_update ? 'mdi-update' : 'mdi-restart' }}</v-icon>
                            <v-tooltip activator="parent" location="top">
                              {{ item.has_update ? tm('tooltips.update') : tm('tooltips.reinstall') }}
                            </v-tooltip>
                          </v-btn>

```

1. Ensure there is a corresponding `tooltips.reinstall` key in your i18n messages; if your existing card menu uses a different key for the reinstall/force-update label, reuse that same key instead of `tooltips.reinstall` for consistency.
2. If your design uses a different icon for reinstall/force-update elsewhere (e.g. `mdi-reload` or `mdi-refresh`), swap `'mdi-restart'` for the icon name you already use so the visual language stays consistent across the UI.
</issue_to_address>

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

Hey - I've found 1 issue, and left some high level feedback:

  • Consider including the target extension’s name in the force update confirmation dialog text so users are clear which plugin is about to be reinstalled.
  • When confirmForceUpdate triggers updateExtension, the update button remains enabled; you may want to guard against duplicate clicks (e.g., by reusing the existing loading state) to avoid queuing multiple forced updates for the same extension.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider including the target extension’s name in the force update confirmation dialog text so users are clear which plugin is about to be reinstalled.
- When `confirmForceUpdate` triggers `updateExtension`, the update button remains enabled; you may want to guard against duplicate clicks (e.g., by reusing the existing loading state) to avoid queuing multiple forced updates for the same extension.

## Individual Comments

### Comment 1
<location> `dashboard/src/views/ExtensionPage.vue:1133-1134` </location>
<code_context>

-                          <v-btn icon size="small" @click="updateExtension(item.name)"
-                            :v-show="item.has_update">
+                          <v-btn icon size="small" @click="updateExtension(item.name)">
                             <v-icon>mdi-update</v-icon>
                             <v-tooltip activator="parent" location="top">{{ tm('tooltips.update') }}</v-tooltip>
                           </v-btn>
</code_context>

<issue_to_address>
**suggestion:** Consider aligning the button label/icon with the new reinstall/force-update behavior.

This now calls `updateExtension` even when `item.has_update` is false, potentially triggering a reinstall flow while the icon/tooltip still suggest a normal update. Consider adjusting the icon and tooltip based on `item.has_update` (as with the card menu text) so users can tell when they’re updating vs reinstalling.

Suggested implementation:

```
                          <v-btn icon size="small" @click="updateExtension(item.name)">
                            <v-icon>{{ item.has_update ? 'mdi-update' : 'mdi-restart' }}</v-icon>
                            <v-tooltip activator="parent" location="top">
                              {{ item.has_update ? tm('tooltips.update') : tm('tooltips.reinstall') }}
                            </v-tooltip>
                          </v-btn>

```

1. Ensure there is a corresponding `tooltips.reinstall` key in your i18n messages; if your existing card menu uses a different key for the reinstall/force-update label, reuse that same key instead of `tooltips.reinstall` for consistency.
2. If your design uses a different icon for reinstall/force-update elsewhere (e.g. `mdi-reload` or `mdi-refresh`), swap `'mdi-restart'` for the icon name you already use so the visual language stays consistent across the UI.
</issue_to_address>

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 Jan 2, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 3, 2026
@Soulter Soulter changed the title feat(dashboard): 优化插件更新按钮,支持强制更新 feat(webui): supports force update plugins Jan 3, 2026
@Soulter Soulter merged commit 442b540 into AstrBotDevs:master Jan 3, 2026
6 checks passed
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. lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants