feat: Add tiptap editor for task descriptions in slide-over panel
- Add updateTask tRPC mutation (name, description fields) - Replace static description with TiptapEditor in TaskSlideOver - Auto-detect existing markdown descriptions and convert to tiptap JSON - Debounced auto-save with flush on close/unmount - Saving indicator in header
This commit is contained in:
@@ -143,6 +143,25 @@ export function taskProcedures(publicProcedure: ProcedureBuilder) {
|
||||
return tasks.filter((t) => t.category !== 'detail');
|
||||
}),
|
||||
|
||||
updateTask: publicProcedure
|
||||
.input(z.object({
|
||||
id: z.string().min(1),
|
||||
name: z.string().min(1).optional(),
|
||||
description: z.string().nullable().optional(),
|
||||
}))
|
||||
.mutation(async ({ ctx, input }) => {
|
||||
const taskRepository = requireTaskRepository(ctx);
|
||||
const existing = await taskRepository.findById(input.id);
|
||||
if (!existing) {
|
||||
throw new TRPCError({
|
||||
code: 'NOT_FOUND',
|
||||
message: `Task '${input.id}' not found`,
|
||||
});
|
||||
}
|
||||
const { id, ...data } = input;
|
||||
return taskRepository.update(id, data);
|
||||
}),
|
||||
|
||||
deleteTask: publicProcedure
|
||||
.input(z.object({ id: z.string().min(1) }))
|
||||
.mutation(async ({ ctx, input }) => {
|
||||
|
||||
Reference in New Issue
Block a user