-
Notifications
You must be signed in to change notification settings - Fork 72
feat: add line comment support for diff views #373 #540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add line comment support for diff views #373 #540
Conversation
|
@kallimat is attempting to deploy a commit to the General Action Team on Vercel. A member of the Team first needs to authorize it. |
b5cba9a to
15edae6
Compare
3fb3243 to
f69606a
Compare
f69606a to
24fce8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| const { activeTerminalId } = useTaskTerminals(task.id, task.path); | ||
|
|
||
| // Line comments for agent context injection | ||
| const { formatted: commentsContext } = useTaskComments(task.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments injected twice on first task interaction
The ChatInterface uses formatted from useTaskComments, which includes ALL comments (both sent and unsent). When the initial injection runs, it sends these comments to the agent but does NOT mark them as sent. Meanwhile, CommentsPopover auto-selects unsent comments for injection. On the user's first message, the same comments are injected again via pendingInjectionManager, resulting in duplicate comment delivery. Using formattedUnsent instead of formatted would prevent this duplication.
Additional Locations (1)
| if (pendingText && isEnterPress) { | ||
| // Append pending text to the existing input and keep the prior working behavior. | ||
| const stripped = filtered.replace(/[\r\n]+$/g, ''); | ||
| const injectedData = stripped + pendingText + '\r\r'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double carriage return may cause duplicate submission
When injecting pending comments, the code appends \r\r (two carriage returns) to the data sent to the terminal. This would submit the command and then immediately send a second Enter keystroke on an empty line. Other injection methods in the codebase (like sendNow in usePendingInjection) correctly use a single \r. The extra carriage return could cause issues with CLI tools that interpret empty commands specially or submit unintended blank input.
| { | ||
| "idx": 3, | ||
| "version": "6", | ||
| "when": 1735570000000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration timestamp is chronologically out of order
Migration 0003_add_line_comments has timestamp 1735570000000 (December 2024), which is chronologically before migration 0002_lyrical_impossible_man with timestamp 1765592430354 (November 2025). While Drizzle uses the idx field for ordering, this inconsistency could cause confusion during debugging or issues if migration ordering logic ever changes to use timestamps.
Summary
Closes #373
Changes
CommentsPopovercomponent for viewing comments per taskCommentWidgetandCommentInputcomponents for the diff viewerMonacoCommentManagerfor managing comments in Monaco diff editorsuseLineComments,useDiffEditorComments,useTaskCommentCounts,usePendingInjectionChatInterfaceandTerminalSessionManagerfor sending comments to agentsTest plan
Note
Introduces end-to-end line comment capability for diffs, from storage to UI and agent handoff.
line_commentstable + index and relations;DatabaseServiceCRUD, sent tracking; IPC handlers and preload APIs for create/get/update/delete/markSent.MonacoCommentManagerwithCommentWidget/CommentInputto add/edit/delete comments in Monaco diff editors; styling updates and glyph-margin affordances.useLineComments,useDiffEditorComments,useTaskCommentCounts,usePendingInjection; sharedformatCommentsForAgent.ProviderBaraddsCommentsPopoverto review/select comments;ChatInterfaceprepends formatted comments to injected context;TerminalSessionManagerprepends pending comments on Enter and marks them sent.TaskScopeContext;ChangesDiffModal,AllChangesDiffModal,FileChangesPanel,RightSidebarupdated to use scopedtaskId/taskPathand show comment counts.Written by Cursor Bugbot for commit 62c2fe0. This will update automatically on new commits. Configure here.