fix: keep dirty committed files visible when hiding Committed - #254
fix: keep dirty committed files visible when hiding Committed#254Ziinc wants to merge 3 commits into
Conversation
The Review Committed Show toggle was hiding every committed file, including paths that still have working-copy changes. Stop stripping overlapping paths from workspace_diff, and only hide committed-only files when Show is off. Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
| showCommittedChanges: boolean, | ||
| alwaysVisiblePaths: ReadonlySet<string>, | ||
| ): boolean { | ||
| return showCommittedChanges || alwaysVisiblePaths.has(path); |
There was a problem hiding this comment.
Shared Show-visibility rule used by the sidebar, diff pane, search, and hunk loader.
- Show on → all committed files
- Show off → only paths in the always-visible set (WC-dirty ∪ conflicted)
- Permalink:
treq/src/components/changes-diff-viewer/utils.ts
Lines 102 to 118 in 2399ea5
| .map_err(|e| format!("Failed to get workspace diff: {}", e))?; | ||
|
|
||
| // Keep overlapping paths in both lists. Review's Committed Show toggle hides | ||
| // clean committed-only files; dirty committed files must remain visible. |
There was a problem hiding this comment.
Removed the committed_files.retain(...) that dropped paths also present in the WC.
- Frontend Show already decides what to hide; backend dedupe made dirty committed files impossible to keep visible
- Overlap is intentional: Review shows committed tip vs WC separately for the same path
- Permalink:
treq/src-tauri/src/core/workspaces.rs
Lines 2442 to 2449 in 2399ea5
| (fileDiff) => | ||
| showCommittedChanges || conflictedHint.has(fileDiff.path), | ||
| showCommittedChanges || | ||
| alwaysVisibleCommitted.has(fileDiff.path), |
There was a problem hiding this comment.
Hunk map must match the visible committed rows when Show flips.
- Previously only conflicted hunks survived hide; dirty overlapping hunks disappeared too
uncommittedPaths ∪ conflictedHintkeeps the committed tip hunk for files still under active edit- Permalink:
treq/src/components/changes-diff-viewer/hooks/useFileLoading.ts
Lines 140 to 151 in 2399ea5
| const showFiles = showCommittedChanges && !isCollapsed; | ||
| const visibleFiles = showCommittedChanges | ||
| ? files | ||
| : files.filter((file) => alwaysVisiblePaths?.has(file.path)); |
There was a problem hiding this comment.
Sidebar list now filters instead of blanking the whole section when Show is off.
- Header + count stay so the toggle remains reachable
- Dirty/conflicted rows remain selectable while clean committed-only rows hide
- Permalink:
treq/src/components/CommittedChangesSection.tsx
Lines 44 to 48 in 2399ea5
Summary
Hiding Review Committed via the Show toggle was removing every committed file, including paths that still have working-copy changes.
Fix
workspace_diffkeeps overlapping paths in bothcommitted_filesanduncommitted_files(no longer strips dirty committed files).Tests
review-committed-dirty-toggleApp QA
Show on — shared in Changes and Committed
Show off — committed-only hidden, shared stays
To show artifacts inline, enable in settings.