Skip to content

Conversation

@tooplick
Copy link
Contributor

@tooplick tooplick commented Jan 24, 2026

…t accidental clicks #4300

修复了issue #4300 添加了更新所有插件二次确认

Modifications / 改动点

  • dashboard/src/views/ExtensionPage.vue: 添加确认对话框变量、方法和模板,修改按钮点击事件

  • dashboard/src/i18n/locales/zh-CN/features/extension.json: 添加中文国际化文本

  • dashboard/src/i18n/locales/en-US/features/extension.json: 添加英文国际化文本

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

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

点击"更新全部插件"按钮后弹出确认对话框,可选择取消或确认更新。

屏幕截图 2026-01-24 151336

Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了"验证步骤"和"运行截图"。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ 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.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Summary by Sourcery

在扩展仪表盘中,在触发“更新所有插件”操作之前添加确认对话框。

新功能:

  • 在扩展页面更新所有插件之前,加入会弹出的确认对话框。

增强改进:

  • 将全局插件更新按钮接入新的确认流程,以防止误触发批量更新。
  • 为新的“全部更新”确认对话框新增本地化文案,支持英文和中文。
Original summary in English

Summary by Sourcery

Add a confirmation dialog before triggering the "update all plugins" action on the extensions dashboard.

New Features:

  • Introduce a confirmation dialog that appears before updating all plugins from the extensions page.

Enhancements:

  • Wire the global plugins update button to the new confirmation flow to prevent accidental bulk updates.
  • Add localized text entries for the new update-all confirmation dialog in both English and Chinese.

Summary by Sourcery

在扩展页触发「更新所有插件」操作前新增确认流程,以防止意外批量更新。

新功能:

  • 引入确认对话框,在从扩展页更新所有插件之前弹出。

增强优化:

  • 将全局「更新所有插件」按钮连接到新的确认对话框流程,而不是立即执行更新。
  • 为更新全部的确认对话框新增本地化文本条目,支持英文和中文。
Original summary in English

Summary by Sourcery

Add a confirmation flow before triggering the "update all plugins" action on the extensions page to prevent accidental bulk updates.

New Features:

  • Introduce a confirmation dialog that appears before updating all plugins from the extensions page.

Enhancements:

  • Wire the global "update all plugins" button to the new confirmation dialog flow instead of updating immediately.
  • Add localized text entries for the update-all confirmation dialog in both English and Chinese.
Original summary in English

Summary by Sourcery

在扩展页触发「更新所有插件」操作前新增确认流程,以防止意外批量更新。

新功能:

  • 引入确认对话框,在从扩展页更新所有插件之前弹出。

增强优化:

  • 将全局「更新所有插件」按钮连接到新的确认对话框流程,而不是立即执行更新。
  • 为更新全部的确认对话框新增本地化文本条目,支持英文和中文。
Original summary in English

Summary by Sourcery

Add a confirmation flow before triggering the "update all plugins" action on the extensions page to prevent accidental bulk updates.

New Features:

  • Introduce a confirmation dialog that appears before updating all plugins from the extensions page.

Enhancements:

  • Wire the global "update all plugins" button to the new confirmation dialog flow instead of updating immediately.
  • Add localized text entries for the update-all confirmation dialog in both English and Chinese.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 24, 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 - 我在这里给了一些总体反馈:

  • 建议将新的 updateAllConfirmDialog 状态和处理函数与现有对话框模式(例如 forceUpdateDialog 及其确认/取消方法)对齐,这样可以保持对话框管理的一致性并让维护更容易。
  • 目前 confirmUpdateAll 即使在对话框打开期间 updatableExtensions 变为空时,仍然会触发 updateAllExtensions();如果这不是你期望的行为,你可能需要在这里重新检查一次 updatableExtensions.length,并在为空时不执行任何操作(no-op)或相应地关闭对话框。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- Consider aligning the new `updateAllConfirmDialog` state and handlers with the existing dialog patterns (e.g., `forceUpdateDialog` and its confirm/cancel methods) to keep dialog management consistent and easier to maintain.
- Right now `confirmUpdateAll` will trigger `updateAllExtensions()` even if `updatableExtensions` becomes empty while the dialog is open; if that’s not desired, you might want to re-check `updatableExtensions.length` there and no-op or close the dialog accordingly.

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

Hey - I've left some high level feedback:

  • Consider aligning the new updateAllConfirmDialog state and handlers with the existing dialog patterns (e.g., forceUpdateDialog and its confirm/cancel methods) to keep dialog management consistent and easier to maintain.
  • Right now confirmUpdateAll will trigger updateAllExtensions() even if updatableExtensions becomes empty while the dialog is open; if that’s not desired, you might want to re-check updatableExtensions.length there and no-op or close the dialog accordingly.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider aligning the new `updateAllConfirmDialog` state and handlers with the existing dialog patterns (e.g., `forceUpdateDialog` and its confirm/cancel methods) to keep dialog management consistent and easier to maintain.
- Right now `confirmUpdateAll` will trigger `updateAllExtensions()` even if `updatableExtensions` becomes empty while the dialog is open; if that’s not desired, you might want to re-check `updatableExtensions.length` there and no-op or close the dialog accordingly.

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 24, 2026
@tooplick tooplick force-pushed the feature/update-all-confirmation branch from 7c5ee06 to e033eed Compare January 24, 2026 07:16
@tooplick
Copy link
Contributor Author

@sourcery-ai review

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 个问题,并给出了一些总体反馈:

  • ExtensionPage.vueupdateAllConfirmDialog 的使用以及对应对话框模板附近存在未解决的合并冲突标记(<<<<<<<, =======, >>>>>>>),需要在合并前清理。
  • updateAllConfirmDialog 的状态结构应与其他对话框保持一致(例如 forceUpdateDialog.show),并在脚本和模板中统一使用,而不是混用 .show 和直接 v-model="updateAllConfirmDialog" 的模式。
  • confirmUpdateAll 中,你已经在继续处理之前重新检查了 updatableExtensions.length;建议将这个防护逻辑集中放在 updateAllExtensions() 本身中,这样未来其他调用方也能受益于这个安全检查。
给 AI Agent 的提示
请根据这次代码评审中的评论进行修改:

## 总体评论
-`ExtensionPage.vue``updateAllConfirmDialog` 的使用以及对应对话框模板附近存在未解决的合并冲突标记(`<<<<<<<`, `=======`, `>>>>>>>`),需要在合并前清理。
- `updateAllConfirmDialog` 的状态结构应与其他对话框保持一致(例如 `forceUpdateDialog.show`),并在脚本和模板中统一使用,而不是混用 `.show` 和直接 `v-model="updateAllConfirmDialog"` 的模式。
-`confirmUpdateAll` 中,你已经在继续处理之前重新检查了 `updatableExtensions.length`;建议将这个防护逻辑集中放在 `updateAllExtensions()` 本身中,这样未来其他调用方也能受益于这个安全检查。

## 逐条评论

### 评论 1
<location> `dashboard/src/views/ExtensionPage.vue:482-486` </location>
<code_context>
+// 显示更新全部插件确认对话框
+const showUpdateAllConfirm = () => {
+  if (updatableExtensions.value.length === 0) return;
+<<<<<<< HEAD
+  updateAllConfirmDialog.show = true;
+=======
+  updateAllConfirmDialog.value = true;
+>>>>>>> 7c5ee0641efeadd82812eaae2086d72f470ac690
+};
+
</code_context>

<issue_to_address>
**issue (bug_risk):** 需要解决 `showUpdateAllConfirm` / `confirmUpdateAll` 代码块中的未解决合并冲突标记。

这些冲突标记会导致代码无法编译。请选择 `updateAllConfirmDialog.show``updateAllConfirmDialog.value` 其中之一作为正确实现,移除另一个,并删除所有 `<<<<<<<``=======``>>>>>>>` 行。
</issue_to_address>

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

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

  • There are unresolved merge conflict markers (<<<<<<<, =======, >>>>>>>) in ExtensionPage.vue around updateAllConfirmDialog usage and the dialog template that need to be cleaned up before merging.
  • The state shape for updateAllConfirmDialog should be made consistent with other dialogs (e.g., forceUpdateDialog.show) and used uniformly in both script and template, instead of mixing .show and direct v-model="updateAllConfirmDialog" patterns.
  • In confirmUpdateAll, you already re-check updatableExtensions.length before proceeding; consider centralizing this guard in updateAllExtensions() itself so future callers also benefit from the safety check.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- There are unresolved merge conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`) in `ExtensionPage.vue` around `updateAllConfirmDialog` usage and the dialog template that need to be cleaned up before merging.
- The state shape for `updateAllConfirmDialog` should be made consistent with other dialogs (e.g., `forceUpdateDialog.show`) and used uniformly in both script and template, instead of mixing `.show` and direct `v-model="updateAllConfirmDialog"` patterns.
- In `confirmUpdateAll`, you already re-check `updatableExtensions.length` before proceeding; consider centralizing this guard in `updateAllExtensions()` itself so future callers also benefit from the safety check.

## Individual Comments

### Comment 1
<location> `dashboard/src/views/ExtensionPage.vue:482-486` </location>
<code_context>
+// 显示更新全部插件确认对话框
+const showUpdateAllConfirm = () => {
+  if (updatableExtensions.value.length === 0) return;
+<<<<<<< HEAD
+  updateAllConfirmDialog.show = true;
+=======
+  updateAllConfirmDialog.value = true;
+>>>>>>> 7c5ee0641efeadd82812eaae2086d72f470ac690
+};
+
</code_context>

<issue_to_address>
**issue (bug_risk):** Unresolved merge conflict markers need to be resolved in the `showUpdateAllConfirm` / `confirmUpdateAll` block.

These conflict markers will prevent the code from compiling. Please choose either `updateAllConfirmDialog.show` or `updateAllConfirmDialog.value` as the correct implementation, remove the other, and delete all `<<<<<<<`, `=======`, and `>>>>>>>` lines.
</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.

@tooplick tooplick force-pushed the feature/update-all-confirmation branch from 234d1b6 to 9832e5e Compare January 24, 2026 07:24
@tooplick
Copy link
Contributor Author

@sourcery-ai review

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 - 我在这里给出了一些整体性的反馈:

  • 可以考虑复用或抽象出一个已有的通用确认对话框模式(如果你在其他破坏性操作,比如卸载/强制更新,已经有类似的模式),这样“全部更新”的确认对话框就能保持一致,并避免重复实现对话框逻辑。
  • confirmUpdateAll 触发 updateAllExtensions 时,你可能还需要把 updatingAll 状态也接入到对话框按钮中(例如:禁用按钮/显示加载中),这样在更新已经进行中的情况下,用户就无法通过确认对话框再次触发批量更新。
给 AI Agents 的提示
Please address the comments from this code review:

## Overall Comments
- Consider reusing or abstracting an existing generic confirmation dialog pattern (if you have one for other destructive actions like uninstall/force-update) so the update-all confirmation stays consistent and avoids duplicating dialog logic.
- When `confirmUpdateAll` triggers `updateAllExtensions`, you might want to wire the `updatingAll` state into the dialog buttons as well (e.g., disable/ show loading), so users can’t double-trigger the bulk update from the confirmation dialog while an update is already in progress.

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

Hey - I've left some high level feedback:

  • Consider reusing or abstracting an existing generic confirmation dialog pattern (if you have one for other destructive actions like uninstall/force-update) so the update-all confirmation stays consistent and avoids duplicating dialog logic.
  • When confirmUpdateAll triggers updateAllExtensions, you might want to wire the updatingAll state into the dialog buttons as well (e.g., disable/ show loading), so users can’t double-trigger the bulk update from the confirmation dialog while an update is already in progress.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider reusing or abstracting an existing generic confirmation dialog pattern (if you have one for other destructive actions like uninstall/force-update) so the update-all confirmation stays consistent and avoids duplicating dialog logic.
- When `confirmUpdateAll` triggers `updateAllExtensions`, you might want to wire the `updatingAll` state into the dialog buttons as well (e.g., disable/ show loading), so users can’t double-trigger the bulk update from the confirmation dialog while an update is already in progress.

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.

@tooplick
Copy link
Contributor Author

我觉得可以不用管这个Sourcery AI了,很小的改动

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 24, 2026
@Soulter Soulter merged commit 127e8c3 into AstrBotDevs:master Jan 24, 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