Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix: address CodeRabbit review comments

coderstoryb214973bad02
diff --git a/src/components/config-plugin.tsx b/src/components/config-plugin.tsx
index 1572c5af..22b66fb0 100644
--- a/src/components/config-plugin.tsx
+++ b/src/components/config-plugin.tsx
@@ -189,11 +189,12 @@ export function ConfigPlugin() {
silence(e, 'plugin remove: dialog cancelled')
return
}
+ setBusy({ id, action: 'remove' })
try {
await remove.mutateAsync(id)
}
catch (e) {
- silence(e, 'plugin upgrade: error already shown by mutation onError')
+ silence(e, 'plugin remove: error already shown by mutation onError')
}
finally {
setBusy(null)
@@ -211,7 +212,7 @@ export function ConfigPlugin() {
await disable.mutateAsync(id)
}
catch (e) {
- silence(e, 'plugin upgrade: error already shown by mutation onError')
+ silence(e, 'plugin disable: error already shown by mutation onError')
}
finally {
setBusy(null)
@@ -228,7 +229,7 @@ export function ConfigPlugin() {
await enable.mutateAsync(id)
}
catch (e) {
- silence(e, 'plugin upgrade: error already shown by mutation onError')
+ silence(e, 'plugin enable: error already shown by mutation onError')
}
finally {
setBusy(null)
@@ -264,7 +265,7 @@ export function ConfigPlugin() {
await snapshot.mutateAsync(id)
}
catch (e) {
- silence(e, 'plugin upgrade: error already shown by mutation onError')
+ silence(e, 'plugin snapshot: error already shown by mutation onError')
}
finally {
setBusy(null)
@@ -290,6 +291,7 @@ export function ConfigPlugin() {
silence(e, 'plugin restore: dialog cancelled')
return
}
+ setBusy({ id, action: 'restore' })
try {
await restore.mutateAsync(id)
// 还原期间后端已停止服务:复用 config-backup 的「重启服务」toast 交互
@@ -306,7 +308,7 @@ export function ConfigPlugin() {
})
}
catch (e) {
- silence(e, 'plugin upgrade: error already shown by mutation onError')
+ silence(e, 'plugin restore: error already shown by mutation onError')
}
finally {
setBusy(null)
@@ -336,7 +338,7 @@ export function ConfigPlugin() {
await deleteSnapshot.mutateAsync(id)
}
catch (e) {
- silence(e, 'plugin upgrade: error already shown by mutation onError')
+ silence(e, 'plugin delete-snapshot: error already shown by mutation onError')
}
finally {
setBusy(null)
diff --git a/src/components/config-profile.tsx b/src/components/config-profile.tsx
index 402fe455..18588ef5 100644
--- a/src/components/config-profile.tsx
+++ b/src/components/config-profile.tsx
@@ -99,6 +99,8 @@ export function ConfigProfile() {
silence(e, 'profile activate: dialog cancelled')
return
}
+ try {
+ await activateProfile(id)
const key = toast(t('profiles.activate_toast', { name: target.name }), {
variant: 'accent',
description: t('profiles.activate_restart_hint'),
@@ -164,6 +166,9 @@ export function ConfigProfile() {
silence(e, 'profile remove: dialog cancelled')
return
}
+ try {
+ // 删除成功后列表已移除该档案,UI 本身就有变化,不再弹成功 toast
+ await removeProfile(id)
}
catch (err) {
console.error('[ConfigProfile] remove failed:', err)
diff --git a/src/utils/silence.ts b/src/utils/silence.ts
index 53e20c59..68d9c25f 100644
--- a/src/utils/silence.ts
+++ b/src/utils/silence.ts
@@ -5,11 +5,11 @@
* already handled elsewhere (e.g., by an error boundary, mutation onError, or
* app error state).
*
- * In dev mode, logs to console.debug with the reason for visibility.
+ * In dev mode, logs to console.warn with the reason for visibility.
* In production, does nothing (truly silent).
*/
export function silence(error: unknown, reason?: string): void {
if (import.meta.env.DEV) {
- console.debug(reason ? `[silenced] ${reason}` : '[silenced]', error)
+ console.warn(reason ? `[silenced] ${reason}` : '[silenced]', error)
}
}