fix: clear conflict UI after resolve commit - #240
Conversation
There was a problem hiding this comment.
Stopped unioning the status hint with diff.conflicted_files.
- After resolve+commit,
getWorkspaceDiffalready returns[], but the hint could still hold pre-resolve paths for a frame and re-inject synthetic committed conflict rows:treq/src/components/changes-diff-viewer/hooks/useFileLoading.ts
Lines 109 to 113 in 9fcc1da
diff.conflicted_filesremains enough for the “Committed hidden but conflicted tip still visible” case — that list is populated even when committed rows are filtered.
There was a problem hiding this comment.
Await status/sidebar refetches before reloading Review files after commit.
invalidateQueriesalone racedloadChangedFiles()against a still-stale hint;refetchQueriesmakes the clear land in the same turn as the resolve commit:treq/src/components/changes-diff-viewer/hooks/useFileActions.ts
Lines 317 to 336 in 9fcc1da
- Sidebar conflict indicators depend on
workspace-statuses, so that key is refetched here too.
There was a problem hiding this comment.
Derived conflictedFiles from the live workspace-status query instead of mirroring into useState.
- The old
useEffectcopy lagged one render behind resolve+commit refetches, so Review’s Conflicts section and the Code-tab alert could stay visible after the backend had already cleared them:treq/src/components/ShowWorkspace.tsx
Lines 380 to 405 in 9fcc1da
- Deriving from query data also clears the stale-state window on workspace switch (same root cause as the old “don’t reset conflictedFiles on id change” gap).
There was a problem hiding this comment.
App-qa coverage for 12 conflict-origin permutations of “resolve + commit clears Review Conflicts + sidebar indicator”.
- Includes merge (
newCommitWithParents), rebase, add/add, multi-file, nested path, committed-tip, line-delete/modify, remote sync, stacked child, keep-workspace/keep-main content, and sequential second conflict - Each case asserts DOM clear then captures before/after PNGs for visual QA
There was a problem hiding this comment.
Backend regression coverage for the same clear contract the UI depends on.
- Merge, rebase (add/add), and committed-tip-only conflicts all assert
workspace_status+list_workspace_statusesflip tohas_conflicts=falseafter write-resolved-content +commit_workspace - Locks the jj-lib
MergedTree::conflicts()source of truth against sticky sidebar/status bits after a fixing commit
Derive conflicted files from workspace-status query data and treat getWorkspaceDiff conflicted_files as authoritative so Review / sidebar conflict indicators do not linger after a fixing commit. Cover merge, rebase, multi-file, remote-sync, and related permutations with Rust and app-qa specs. Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Fix delete/modify and sequential remount setups, format the screenshot spec, and drop an unused import after the full 12-permutation suite passed. Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Drop the 10 permutations that passed on the first screenshot run. Retain line-delete/modify (replacement for the broken delete/modify setup) and sequential resolve — the only cases that failed initially. Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
d670d9c to
b426ddd
Compare
Summary
Conflicts could linger in the Review tab Conflicts section and workspace sidebar after a commit that resolved them. The UI copied
conflicted_filesinto local state (one render behind status refetches) anduseFileLoadingunioned that stale hint with a fresh emptygetWorkspaceDiffresult.Changes
conflictedFilesdirectly from theworkspace-statusquerydiff.conflicted_filesas authoritative in Review file loadingApp QA
2/2 narrowed permutations passed. Before: Conflicts section + sidebar indicator. After: both gone + “Commit created” toast.
Line-delete conflict cleared after commit
Sequential second resolve cleared
Test plan
cargo test --manifest-path src-tauri/Cargo.toml --test core_changes_test test_resolve_and_commit_clearsvitestscreenshot specconflict-clear-after-resolve-commit.spec.tsx(2 failing permutations only)npm run format && npm run lint && npm run checkTo show artifacts inline, enable in settings.