feat: task comments/discussion system
- New task_comments table (separate from progress notes) - Backend: GET/POST/DELETE /api/tasks/:id/comments with session + bearer auth - TaskComments component on TaskPage (full-page view) with markdown support, author avatars, delete own comments, 30s polling - CompactComments in TaskDetailPanel (side panel) with last 3 + expand - Comment API functions in frontend lib/api.ts
This commit is contained in:
@@ -103,6 +103,20 @@ export const tasks = pgTable("tasks", {
|
||||
export type Task = typeof tasks.$inferSelect;
|
||||
export type NewTask = typeof tasks.$inferInsert;
|
||||
|
||||
// ─── Comments ───
|
||||
|
||||
export const taskComments = pgTable("task_comments", {
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
taskId: uuid("task_id").notNull().references(() => tasks.id, { onDelete: "cascade" }),
|
||||
authorId: text("author_id"), // BetterAuth user ID, or "hammer" for API, null for anonymous
|
||||
authorName: text("author_name").notNull(),
|
||||
content: text("content").notNull(),
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
|
||||
});
|
||||
|
||||
export type TaskComment = typeof taskComments.$inferSelect;
|
||||
export type NewTaskComment = typeof taskComments.$inferInsert;
|
||||
|
||||
// ─── BetterAuth tables ───
|
||||
|
||||
export const users = pgTable("users", {
|
||||
|
||||
Reference in New Issue
Block a user