Skip to content

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

fix(turnrewind): recovery-state hint says 'interrupted files' not 'files below'

yingtianlan7c673eef1ee4
diff --git a/packages/dsh-tauri-turnrewind-ts/src/client/components/command-view.ts b/packages/dsh-tauri-turnrewind-ts/src/client/components/command-view.ts
index 74dfb4cb..545dd0e8 100644
--- a/packages/dsh-tauri-turnrewind-ts/src/client/components/command-view.ts
+++ b/packages/dsh-tauri-turnrewind-ts/src/client/components/command-view.ts
@@ -302,6 +302,11 @@ export function UndoCommandView(props: CommandViewProps): React.ReactElement {
: tr('cancelAction')
// plan 提交即置 applying:提示行不等轮询返回就切到等待态。
const pendingWait = submitting || submitted === 'confirm' || planStatus === 'applying'
+ // P2-11 恢复面板可达性:/undo 错误里命中恢复围栏时,卡片直接给出
+ // 「打开恢复面板」入口——弹窗种子逻辑会让历史提示不再重弹,如果只在
+ // 弹窗里放入口,被围的用户可能永远到不了面板。
+ const underRecovery = (state === 'error' && text.includes('TURNREWIND_RECOVERY_REQUIRED'))
+ || Boolean(submitError?.includes('TURNREWIND_RECOVERY_REQUIRED'))
const hint = submitError
? `${tr('confirmFailed')}${submitError}`
: resultText || (planStatus === 'applied' || pendingWait
@@ -310,18 +315,15 @@ export function UndoCommandView(props: CommandViewProps): React.ReactElement {
? tr('planExpiredHint')
: planStatus === 'gone'
? tr('planGoneHint')
- : planStatus === 'cancelled' || submitted === 'cancel' ? tr('cancelled') : tr('previewHint'))
+ : planStatus === 'cancelled' || submitted === 'cancel'
+ ? tr('cancelled')
+ : underRecovery ? tr('recoveryHint') : tr('previewHint'))
// 执行结果(成功/失败)靠左展示;「已提交,等待执行结果」与预览提示一样
// 贴 footer 右缘——等执行结果落地(resultText/applied)再切到左侧。
const hintLeft = Boolean(resultText || submitError || planStatus === 'applied')
const hintCls = `${TURNREWIND_CLASS_PREFIX}-card-hint${submitError
? ` ${TURNREWIND_CLASS_PREFIX}-card-hint-error`
: resultText || planStatus === 'applied' ? ` ${TURNREWIND_CLASS_PREFIX}-card-hint-ok` : ''}${hintLeft ? '' : ` ${TURNREWIND_CLASS_PREFIX}-card-hint-right`}`
- // P2-11 恢复面板可达性:/undo 错误里命中恢复围栏时,卡片直接给出
- // 「打开恢复面板」入口——弹窗种子逻辑会让历史提示不再重弹,如果只在
- // 弹窗里放入口,被围的用户可能永远到不了面板。
- const underRecovery = (state === 'error' && text.includes('TURNREWIND_RECOVERY_REQUIRED'))
- || Boolean(submitError?.includes('TURNREWIND_RECOVERY_REQUIRED'))
const showFooter = actionable || submitting || resultText !== null || submitError !== null || submitted !== null || planStatus === 'applied' || planStatus === 'expired' || planStatus === 'cancelled' || underRecovery
// 取消/过期折叠为无边框细行。
diff --git a/packages/dsh-tauri-turnrewind-ts/src/client/locales/index.ts b/packages/dsh-tauri-turnrewind-ts/src/client/locales/index.ts
index 1d80e0ee..22d9a204 100644
--- a/packages/dsh-tauri-turnrewind-ts/src/client/locales/index.ts
+++ b/packages/dsh-tauri-turnrewind-ts/src/client/locales/index.ts
@@ -23,6 +23,7 @@ export type LocaleKey
| 'planExpiredHint'
| 'planGoneHint'
| 'previewHint'
+ | 'recoveryHint'
| 'sessionMissing'
| 'recoveryTitle'
| 'recoveryIntro'
@@ -54,6 +55,7 @@ const DICT_ZH: Record<LocaleKey, string> = {
planExpiredHint: '该计划已过期,重新执行 /undo 可生成新预览',
planGoneHint: '该计划不存在(可能已被清理或来自旧版本数据)',
previewHint: '执行将恢复下方文件到本轮改动前',
+ recoveryHint: '执行将恢复被打断的文件到本轮改动前',
sessionMissing: '无法确定该卡片所属的会话,请刷新页面后重试',
recoveryTitle: 'Turn 撤销恢复',
recoveryIntro: '以下工作区有被中断的撤销操作,文件状态未知,已暂停新的撤销。请先自行检查工作区文件,然后选择保留历史解锁,或清除该工作区的 rewind 数据。',
@@ -86,6 +88,7 @@ const DICT_EN: Record<LocaleKey, string> = {
planExpiredHint: 'This plan has expired; run /undo again for a fresh preview',
planGoneHint: 'This plan no longer exists (it may have been purged or comes from older data)',
previewHint: 'Applying restores the files below to their state before this turn',
+ recoveryHint: 'Applying restores the interrupted files to their state before this turn',
sessionMissing: 'Cannot determine the session this card belongs to; refresh the page and try again',
recoveryTitle: 'Turn Rewind Recovery',
recoveryIntro: 'These workspaces had an interrupted undo; the file state is unknown and new rewind work is paused. Inspect the workspace files yourself, then either keep the history acknowledged or clear the workspace\'s rewind data.',