Skip to content

Conversation

@juliuslipp
Copy link
Contributor

@juliuslipp juliuslipp commented Jan 2, 2026

Summary

Closes #373

  • Adds the ability to leave line-level comments on file diffs
  • Comments are stored in the local database and can be sent to agents
  • Includes a comments popover UI in the provider bar to view/manage comments
  • Supports pending injection of comments into agent sessions

Changes

  • New database schema and migrations for line comments
  • New IPC handlers for line comment CRUD operations
  • CommentsPopover component for viewing comments per task
  • CommentWidget and CommentInput components for the diff viewer
  • MonacoCommentManager for managing comments in Monaco diff editors
  • Hooks: useLineComments, useDiffEditorComments, useTaskCommentCounts, usePendingInjection
  • Integration with ChatInterface and TerminalSessionManager for sending comments to agents

Test plan

  • Create a task and make file changes
  • Open the diff view and add comments on specific lines
  • Verify comments appear in the comments popover
  • Send comments to the agent and verify they're injected into the terminal
  • Verify comments persist across app restarts

Note

Introduces end-to-end line comment capability for diffs, from storage to UI and agent handoff.

  • Data/IPC: New line_comments table + index and relations; DatabaseService CRUD, sent tracking; IPC handlers and preload APIs for create/get/update/delete/markSent.
  • Editor UI: MonacoCommentManager with CommentWidget/CommentInput to add/edit/delete comments in Monaco diff editors; styling updates and glyph-margin affordances.
  • Hooks/Utils: useLineComments, useDiffEditorComments, useTaskCommentCounts, usePendingInjection; shared formatCommentsForAgent.
  • App integration: ProviderBar adds CommentsPopover to review/select comments; ChatInterface prepends formatted comments to injected context; TerminalSessionManager prepends pending comments on Enter and marks them sent.
  • Task scoping/refactors: New TaskScopeContext; ChangesDiffModal, AllChangesDiffModal, FileChangesPanel, RightSidebar updated to use scoped taskId/taskPath and show comment counts.

Written by Cursor Bugbot for commit 62c2fe0. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Jan 2, 2026

@kallimat is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@juliuslipp juliuslipp force-pushed the juliuslipp/diff-line-comments-v1 branch from b5cba9a to 15edae6 Compare January 2, 2026 17:55
@juliuslipp juliuslipp changed the title feat: add line comment support for diff views feat: add line comment support for diff views #373 Jan 2, 2026
@juliuslipp juliuslipp force-pushed the juliuslipp/diff-line-comments-v1 branch 3 times, most recently from 3fb3243 to f69606a Compare January 2, 2026 19:07
@juliuslipp juliuslipp force-pushed the juliuslipp/diff-line-comments-v1 branch from f69606a to 24fce8f Compare January 2, 2026 19:17
Copy link

@cursor cursor bot left a 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);
Copy link

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)

Fix in Cursor Fix in Web

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';
Copy link

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.

Fix in Cursor Fix in Web

{
"idx": 3,
"version": "6",
"when": 1735570000000,
Copy link

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.

Fix in Cursor Fix in Web

@arnestrickmann arnestrickmann merged commit 19fd4ed into generalaction:main Jan 3, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat]: Line comments in diff that can be sent to agents

2 participants