feat: Persist review comments to database
Review comments on phase diffs now survive page reloads and phase switches. Adds review_comments table (migration 0028), repository port/adapter (13th repo), tRPC procedures (listReviewComments, createReviewComment, resolveReviewComment, unresolveReviewComment), and replaces useState-based comments in ReviewTab with tRPC queries and mutations.
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
DrizzleLogChunkRepository,
|
||||
DrizzleConversationRepository,
|
||||
DrizzleChatSessionRepository,
|
||||
DrizzleReviewCommentRepository,
|
||||
} from './db/index.js';
|
||||
import type { InitiativeRepository } from './db/repositories/initiative-repository.js';
|
||||
import type { PhaseRepository } from './db/repositories/phase-repository.js';
|
||||
@@ -34,6 +35,7 @@ import type { ChangeSetRepository } from './db/repositories/change-set-repositor
|
||||
import type { LogChunkRepository } from './db/repositories/log-chunk-repository.js';
|
||||
import type { ConversationRepository } from './db/repositories/conversation-repository.js';
|
||||
import type { ChatSessionRepository } from './db/repositories/chat-session-repository.js';
|
||||
import type { ReviewCommentRepository } from './db/repositories/review-comment-repository.js';
|
||||
import type { EventBus } from './events/index.js';
|
||||
import { createEventBus } from './events/index.js';
|
||||
import { ProcessManager, ProcessRegistry } from './process/index.js';
|
||||
@@ -58,7 +60,7 @@ import type { ServerContextDeps } from './server/index.js';
|
||||
// =============================================================================
|
||||
|
||||
/**
|
||||
* All 12 repository ports.
|
||||
* All 13 repository ports.
|
||||
*/
|
||||
export interface Repositories {
|
||||
initiativeRepository: InitiativeRepository;
|
||||
@@ -73,10 +75,11 @@ export interface Repositories {
|
||||
logChunkRepository: LogChunkRepository;
|
||||
conversationRepository: ConversationRepository;
|
||||
chatSessionRepository: ChatSessionRepository;
|
||||
reviewCommentRepository: ReviewCommentRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create all 12 Drizzle repository adapters from a database instance.
|
||||
* Create all 13 Drizzle repository adapters from a database instance.
|
||||
* Reusable by both the production server and the test harness.
|
||||
*/
|
||||
export function createRepositories(db: DrizzleDatabase): Repositories {
|
||||
@@ -93,6 +96,7 @@ export function createRepositories(db: DrizzleDatabase): Repositories {
|
||||
logChunkRepository: new DrizzleLogChunkRepository(db),
|
||||
conversationRepository: new DrizzleConversationRepository(db),
|
||||
chatSessionRepository: new DrizzleChatSessionRepository(db),
|
||||
reviewCommentRepository: new DrizzleReviewCommentRepository(db),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user