Skip to content
Source
Sign inSign up
pingdotgg/t3code

Comment on diff to give agent context #1003

Closedmaskdotdev(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/1003/headopened View on GitHub

Showing 22 changed files with 93 additions and 10 deletions (loading 20).

x
0 of 22 viewed, 22 left
92 additions and 10 deletionsapps/web/src/components/chat/ChatComposer.tsxModified
View file
@@ -55,6 +55,10 @@
insertInlineTerminalContextPlaceholder,
removeInlineTerminalContextPlaceholder,
} from "../../lib/terminalContext";
+import {
+ removeInlineDiffContextCommentPlaceholder,
+ type DiffContextCommentDraft,
+} from "../../lib/diffContextComments";
import {
shouldUseCompactComposerPrimaryActions,
shouldUseCompactComposerFooter,
@@ -160,6 +164,23 @@
): boolean =>
contexts.length === ids.length && contexts.every((context, index) => context.id === ids[index]);
​
+const syncDiffContextCommentsByIds = (
+ comments: ReadonlyArray<DiffContextCommentDraft>,
+ ids: ReadonlyArray<string>,
+): DiffContextCommentDraft[] => {
+ const commentsById = new Map(comments.map((comment) => [comment.id, comment]));
+ return ids.flatMap((id) => {
+ const comment = commentsById.get(id);
+ return comment ? [comment] : [];
+ });
+};
+​
+const diffContextCommentIdListsEqual = (
+ comments: ReadonlyArray<DiffContextCommentDraft>,
+ ids: ReadonlyArray<string>,