File view comments disappear from the file after switching threads and coming back

Open Beginner friendly
#33,369 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript
Domain
frontend

Research direction

Read apps/web/src/components/files/FilePreviewPanel.tsx around line 683, then compare how apps/web/src/components/diffs/AnnotatableCodeView.tsx restores annotations from the composer draft store. Restore file comments for the current file using their section and line range when the view mounts. Done means submitted inline comments remain visible after switching threads and returning to the file.

Written by the indexing model from the issue text.

Description

via-triage
What happened

After adding a line comment in the file view, it shows inline under the commented lines. After switching to another thread and back, the inline comments are gone from the file. They still exist as chips in the chat composer, but the file no longer shows which lines were commented, so you can't see what you've already said about the file.

Diagnosis

EditableFileSurface keeps inline comments in local React state that starts empty: useState<FileCommentLineAnnotation[]>([]) (apps/web/src/components/files/FilePreviewPanel.tsx:683 at v0.1.7). Submitting a comment writes it to the composer draft store (addReviewComment) and to that local state, but nothing rebuilds the local state from the store when the view mounts. Switching threads unmounts the view, so the inline comments are lost even though reviewComments in the draft store still has them.

The diff view already handles this: AnnotatableCodeView reads getComposerDraft(target)?.reviewComments and rebuilds the stored annotations (apps/web/src/components/diffs/AnnotatableCodeView.tsx:125-157). The file view could do the same for comments whose sectionId is file:<path>, using startIndex/endIndex for the line range. Current main has the same useState([]) initializer.

Steps to reproduce
  1. Open a thread in a project and open any file in the right panel's file view.
  2. Select some lines, type a comment, and submit it. The comment appears inline under those lines, and a chip appears in the composer.
  3. Switch to another thread.
  4. Switch back and look at the same file.
  5. Expected: the inline comment is still shown. Actual: it's gone, and only the composer chip remains.
Version

0.1.7 (T3 Code Desktop)

Environment

macOS 15 (Darwin 24.6.0), arm64. Desktop app against its local server.

Evidence
Source reading at v0.1.7 and `main`, as described above. No logs are involved, since this is client-side UI state.
Related issues

None found.

Fix applied or workaround

The composer chips (<file> L<a> to L<b>) still list every submitted comment, and the comments are still sent with the next message.

Filed by

Diagnosed and written by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, via T3 Code triage

Dominant language
TypeScript
Stars
24.8k
Forks
6.4k
Avg merge
8h 26m
Merged PRs (30d)
133

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pingdotgg/t3code

All issues in pingdotgg/t3code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.