feat: surface orphaned comments on removed files#279
Merged
tomasz-tomczyk merged 10 commits intomainfrom Apr 16, 2026
Merged
Conversation
When a file is added on a branch, receives review comments, and is then deleted, the comments become invisible because the file vanishes from the session. This spec designs phantom file sections that restore those comments with outdated styling and full resolve/edit/delete support. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Orphaned field to FileEntry and SessionFileInfo. After restoring comments for existing files in loadCritJSON, detect paths in the review file that have comments but no matching session file, and create phantom FileEntry objects with Status:"removed" and Orphaned:true. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract restoreOrphanedComments() helper that reads the review file and creates phantom FileEntry objects for paths with comments not in the session. Called from handleRoundCompleteGit and handleRoundCompleteFiles after file list refresh and carry-forward, ensuring orphaned comments survive across rounds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deduplicates the orphan-detection logic between loadCritJSON and restoreOrphanedComments, bringing cyclomatic complexity below the gocyclo threshold. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Skip content/diff fetches for orphaned files, only load comments - Show phantom file sections with "Removed" badge and placeholder body - Render all comments (file + line-scoped) in file-comments container - Add "Outdated" badge and muted border/background to orphaned comments - Disable "Add file-level comment" button on orphaned files - Add "removed" status icon in file tree (gray with x) - CSS variables in all 4 theme blocks for removed/outdated styling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a helpers.go file to the word-diff git instance, seeds comments on it, then deletes the file and signals round-complete. The orphaned comments should appear as a phantom section with "Removed" badge and outdated styling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The left border treatment was foreign to the existing design system. Instead, outdated comments now use reduced opacity (0.6, 0.85 on hover) matching how resolved counts are dimmed. The "Outdated" badge uses the same plain mono-text style as round badges. Removed unused --outdated-* CSS variables from all 4 theme blocks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ClearAllComments (DELETE /api/comments) now filters out orphaned FileEntry objects, preventing empty phantom sections from lingering after E2E test cleanup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 17, 2026
tomasz-tomczyk
added a commit
that referenced
this pull request
Apr 21, 2026
* feat: render outdated comments inline when lines leave diff hunks When a reviewer comments on a diff line and the agent undoes that change, the file stays in the diff but the commented lines disappear from hunks. The comment existed in file.comments but had no inline anchor — invisible except in the All Comments panel. - Add appendOutdatedDiffComments() that detects unrendered comments after hunk rendering and shows them at the bottom of the diff section - Uses existing outdated-comment/outdated-badge CSS classes (same as orphaned file comments from PR #279) - Called from both renderDiffUnified and renderDiffSplit - Full CRUD support: edit, delete, resolve all work on outdated comments Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add CSS for outdated-diff-comments container, remove unnecessary round-complete - Add border-top and padding for .outdated-diff-comments section to visually separate it from diff hunks - Remove unnecessary round-complete call in E2E test beforeEach (follows project convention — only clearAllComments needed) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use addComment helper, add guard against vacuous test passes - Replace inline request.post calls with addComment from ./helpers (5 occurrences) - Add expect(keys.size).toBeGreaterThan(0) guard in findNonHunkLine to prevent vacuous passes if diff API response shape doesn't match Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove unrelated changes from other branch Restore threading.spec.ts and activeReplyForms code that were accidentally included from the fix/reply-form-font-size branch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ChangedFiles(). Now the backend detects orphaned paths in the review file and creates phantomFileEntryobjects withOrphaned: true.loadCritJSON) and between rounds (restoreOrphanedCommentsinhandleRoundCompleteGit/Files).Test plan
make test-diffincludes orphaned comment scenario on the word-diff instancegolangci-lintclean,gofmtclean, CSS variable checker clean🤖 Generated with Claude Code