Skip to content

Commit 31b9a8a

Browse files
committed
fix
1 parent 0fdd5da commit 31b9a8a

File tree

4 files changed

+34
-16
lines changed

4 files changed

+34
-16
lines changed

apps/array/src/renderer/features/code-editor/hooks/useEditorExtensions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ export function useEditorExtensions(
4444
if (!fileId) return;
4545

4646
await createComment({
47-
fileId,
47+
prNumber: 0, // TODO: Get actual PR number from context
48+
directoryPath: "", // TODO: Get actual directory path from context
49+
path: fileId || "",
4850
line,
4951
side: "right",
5052
content,
53+
commitId: "", // TODO: Get actual commit ID from context
5154
});
5255
closeComposer();
5356
},

apps/array/src/renderer/features/comments/components/CommentBubble.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ export function CommentBubble({
6868
const trimmed = editContent.trim();
6969
if (!trimmed) return;
7070

71-
await updateComment(comment.id, trimmed);
71+
await updateComment(comment.id, trimmed, ""); // TODO: Get actual directory path from context
7272
setIsEditing(false);
7373
}, [editContent, comment.id, updateComment]);
7474

7575
const handleDelete = useCallback(async () => {
7676
if (window.confirm("Delete this comment? This action cannot be undone.")) {
77-
await deleteComment(comment.id);
77+
await deleteComment(comment.id, ""); // TODO: Get actual directory path from context
7878
}
7979
}, [comment.id, deleteComment]);
8080

apps/array/src/renderer/features/comments/components/CommentThread.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ export function CommentThread({ comment: initialComment }: CommentThreadProps) {
3939

4040
const input: CreateReplyInput = {
4141
parentId: comment.id,
42-
fileId: comment.fileId,
43-
line: comment.line,
44-
side: comment.side,
42+
prNumber: 0, // TODO: Get actual PR number from context
43+
directoryPath: "", // TODO: Get actual directory path from context
4544
content: trimmed,
4645
};
4746

@@ -52,7 +51,7 @@ export function CommentThread({ comment: initialComment }: CommentThreadProps) {
5251

5352
const handleToggleResolved = useCallback(async () => {
5453
if (!comment) return;
55-
await resolveComment(comment.id, !comment.resolved);
54+
await resolveComment(comment.id, !comment.resolved, ""); // TODO: Get actual directory path from context
5655
// Auto-collapse when resolving
5756
if (!comment.resolved) {
5857
setIsCollapsed(true);

apps/array/src/renderer/features/comments/store/commentStore.ts

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,17 @@ interface CommentStore {
4040
// Commands (async, call API then update local state)
4141
createComment: (input: CreateCommentInput) => Promise<Comment>;
4242
createReply: (input: CreateReplyInput) => Promise<Comment>;
43-
updateComment: (commentId: string, content: string) => Promise<void>;
44-
deleteComment: (commentId: string) => Promise<void>;
45-
resolveComment: (commentId: string, resolved: boolean) => Promise<void>;
43+
updateComment: (
44+
commentId: string,
45+
content: string,
46+
directoryPath: string,
47+
) => Promise<void>;
48+
deleteComment: (commentId: string, directoryPath: string) => Promise<void>;
49+
resolveComment: (
50+
commentId: string,
51+
resolved: boolean,
52+
directoryPath: string,
53+
) => Promise<void>;
4654

4755
// Local-only actions (no API call)
4856
toggleShowComments: () => void;
@@ -106,25 +114,33 @@ export const useCommentStore = create<CommentStore>()(
106114
return reply;
107115
},
108116

109-
updateComment: async (commentId: string, content: string) => {
117+
updateComment: async (
118+
commentId: string,
119+
content: string,
120+
directoryPath: string,
121+
) => {
110122
// Call API to update
111-
await commentApi.updateComment(commentId, content);
123+
await commentApi.updateComment(commentId, content, directoryPath);
112124

113125
// Update local state
114126
get()._updateCommentInState(commentId, { content });
115127
},
116128

117-
deleteComment: async (commentId: string) => {
129+
deleteComment: async (commentId: string, directoryPath: string) => {
118130
// Call API to delete
119-
await commentApi.deleteComment(commentId);
131+
await commentApi.deleteComment(commentId, directoryPath);
120132

121133
// Update local state
122134
get()._removeCommentFromState(commentId);
123135
},
124136

125-
resolveComment: async (commentId: string, resolved: boolean) => {
137+
resolveComment: async (
138+
commentId: string,
139+
resolved: boolean,
140+
directoryPath: string,
141+
) => {
126142
// Call API to update resolve status
127-
await commentApi.resolveComment(commentId, resolved);
143+
await commentApi.resolveComment(commentId, resolved, directoryPath);
128144

129145
// Update local state
130146
get()._updateCommentInState(commentId, { resolved });

0 commit comments

Comments
 (0)