File view comments disappear from the file after switching threads and coming back
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
阅读 apps/web/src/components/files/FilePreviewPanel.tsx 第 683 行附近的代码,然后比较 apps/web/src/components/diffs/AnnotatableCodeView.tsx 如何从 composer 草稿存储中恢复批注。在视图挂载时,使用所属区段和行范围恢复当前文件的评论。完成标准是:切换线程并返回文件后,已提交的行内评论仍然可见。
由索引模型根据 Issue 内容生成。
描述
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
- Open a thread in a project and open any file in the right panel's file view.
- Select some lines, type a comment, and submit it. The comment appears inline under those lines, and a chip appears in the composer.
- Switch to another thread.
- Switch back and look at the same file.
- 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
- 主要语言
- TypeScript
- 星标
- 24.8k
- 派生
- 6.4k
- 平均合并
- 8 小时 26 分钟
- 30 天内合并 PR
- 133
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pingdotgg/t3code 的其他 Issue
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
pingdotgg/t3code#33044 · 1 条评论 ·
维护者通常 1 天内回复
-
via-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
duolicious/duolicious#1943 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 80/100
nightly-labs/openbot#6451 ·
维护者通常 1 天内回复
-
complexity: easy good first issue impact: low
难度 2/5 1-3 小时 新手友好度 72/100
ueberdosis/hocuspocus#1211 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 64/100
redhat-developer/rhdh-plugin-export-overlays#4733 · 1 条评论 ·
维护者通常 1 天内回复
-
S-Needs triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复