Skip to content

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

fix(turnrewind): parse padded created paths in the TS command card

yingtianlanee90b29c6fbc
diff --git a/packages/dsh-tauri-turnrewind-ts/src/client/utils/parse.ts b/packages/dsh-tauri-turnrewind-ts/src/client/utils/parse.ts
index 38aa9ff6..c3e5b78c 100644
--- a/packages/dsh-tauri-turnrewind-ts/src/client/utils/parse.ts
+++ b/packages/dsh-tauri-turnrewind-ts/src/client/utils/parse.ts
@@ -33,7 +33,11 @@ export function parseUndoOutput(raw: string | undefined): ParsedUndoOutput {
// branch (which would misclassify them as conflicts).
const listed = /^ {2,}(modified|created|deleted) (.*\S)\s*$/.exec(line)
if (listed && !inDiffs) {
- let path = listed[2]!
+ // Host aligns `change.padEnd(8)`: `created`/`deleted` therefore leave
+ // extra separator spaces before the path. Trim only the formatting
+ // prefix so `my notes.txt` matches its diff separator instead of
+ // falling into the synthetic conflict fallback.
+ let path = listed[2]!.trimStart()
let conflict = false
if (/\s{2,}\[conflict\]$/.test(path)) {
conflict = true
diff --git a/packages/dsh-tauri-turnrewind-ts/test/client-view.test.js b/packages/dsh-tauri-turnrewind-ts/test/client-view.test.js
index 683ae994..0f270ad7 100644
--- a/packages/dsh-tauri-turnrewind-ts/test/client-view.test.js
+++ b/packages/dsh-tauri-turnrewind-ts/test/client-view.test.js
@@ -76,7 +76,8 @@ it('parseUndoOutput keeps paths with spaces and plan flags out of the conflict f
const parsed = client.parseUndoOutput([
'Undo preflight: turn s:1; 3 file(s) (modified 2, created 1, deleted 0); 1 conflict(s).',
' modified my notes.txt',
- ' created reports/q3 summary.md',
+ // Host formats change.padEnd(8) plus one separator: created has two spaces.
+ ' created reports/q3 summary.md',
' modified assets/logo.png [conflict]',
' modified assets/hero.png [too large]',
'',