Add update method to ReviewCommentRepository, updateReviewComment tRPC procedure, and inline edit UI in CommentThread. Edit button appears on user-authored comments (not agent comments) when unresolved. Uses the existing CommentForm with a new initialValue prop.
28 lines
880 B
TypeScript
28 lines
880 B
TypeScript
/**
|
|
* Review Comment Repository Port Interface
|
|
*
|
|
* Port for persisting inline review comments on phase diffs.
|
|
*/
|
|
|
|
import type { ReviewComment } from '../schema.js';
|
|
|
|
export interface CreateReviewCommentData {
|
|
phaseId: string;
|
|
filePath: string;
|
|
lineNumber: number;
|
|
lineType: 'added' | 'removed' | 'context';
|
|
body: string;
|
|
author?: string;
|
|
parentCommentId?: string; // for replies
|
|
}
|
|
|
|
export interface ReviewCommentRepository {
|
|
create(data: CreateReviewCommentData): Promise<ReviewComment>;
|
|
createReply(parentCommentId: string, body: string, author?: string): Promise<ReviewComment>;
|
|
findByPhaseId(phaseId: string): Promise<ReviewComment[]>;
|
|
update(id: string, body: string): Promise<ReviewComment | null>;
|
|
resolve(id: string): Promise<ReviewComment | null>;
|
|
unresolve(id: string): Promise<ReviewComment | null>;
|
|
delete(id: string): Promise<void>;
|
|
}
|