mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-01 13:34:33 +00:00
feat(agentic kanban): phase 1 not-agentic kanban board (#330)
* feat(kanban): implement AI-native kanban database models, services, and REST APIs * feat(webui): implement team kanban board and task management * style(webui): increase kanban dialog widths and form container * fix(webui): ensure kanban dialogs override sm:max-w-lg base class * style(webui): set edit task dialog max width to 5xl * chore: untrack kanban plan markdown files * feat(webui): update kanban page layout to 2 columns and refine task activity UI * fix(webui): constrain kanban column and board heights for vertical scrolling * feat(kanban): unify task status transition into updateTask API and allow unconstrained human task transitions * fix(webui): add optimistic updates to kanban drag-and-drop to eliminate flash * refactor(webui): remove client-side search box from kanban header * feat(kanban): redesign task dialog comments area and add attachment support * refactor(webui): remove top status action bar from task info dialog * fix(webui): narrow query cache predicate and add defensive guards for kanban drag optimistic update * feat(kanban): add drag-and-drop task reordering with fractional indexing (#331) * feat(kanban): add drag-and-drop task reordering with fractional indexing * fix(kanban): improve card drop zones, snap indicators, and column highlight * fix(kanban): enable card droppables only during active drag * fix(kanban): refine hover styles and drop indicators for column boundaries * fix(kanban): unify bottom drop indicator and fix top indicator clipping * fix(kanban): ensure full column highlight and full coverage drop target * minor change * feat(kanban): allow agent tasks free drag-and-drop and enforce status change permissions (#332) * refactor(kanban): rename task_type_agentic translation keys to task_type_agent * feat(kanban): refactor task type enum to isAgentTask boolean (#333) * refactor(kanban): remove phase 2 agent execution logic and streamline phase 1 kanban * feat(kanban): add notifications and audit logging for kanban (#334) * feat(kanban): redesign config area layout and add parent tasks multi-selector (#335) * feat(webui): redesign kanban task dialog config area * feat(kanban): simplify task dependencies with parent tasks multi-selector * refactor(kanban): remove unused links routes and legacy dependency methods * feat(kanban): connect assets and kanban tasks with many-to-many relationship (#336) * feat(kanban): connect assets and kanban tasks with many-to-many relationship * feat(kanban): improve asset picker layout, infinite scrolling, and breadcrumb icon styling * fix(kanban): ensure asset picker scrollarea is scrollable with min-h-0 and shrink-0 flex styling * fix(kanban): hide recently deleted in folder tree picker and adjust header padding * fix(kanban): use lucide files icon instead of paperclip for linked assets * feat(kanban): improve task deletion, goal sidebar interaction, and card styling (#337) * feat(kanban): improve task deletion, goal sidebar interaction, and card styling * feat(kanban): move agent task badge after priority and update to orange style * feat(kanban): add status Compare-And-Swap (CAS) to prevent drag-and-drop race conditions (#338) * feat(kanban): add status Compare-And-Swap (CAS) to prevent drag-and-drop race conditions * style(kanban): rotate kanban icon 180 degrees in sidebar and top nav * style(kanban): remove rotate-180 from SquareKanban icons * feat(kanban): add unassigned goal record and fix all tasks count (#339) * feat(kanban): add unassigned goal record and fix all tasks count * feat(kanban): toggle task count with three-dot action button on goal card hover * fix(ci): pin bun version to 1.3.14 across CI and Docker (#340) * fix(webui): truncate goal name to max 2 lines in kanban sidebar (#341)
This commit is contained in:
@@ -53,6 +53,16 @@ export enum AuditAction {
|
||||
quota_policy_create = 'quota_policy_create',
|
||||
quota_policy_update = 'quota_policy_update',
|
||||
quota_policy_delete = 'quota_policy_delete',
|
||||
kanban_goal_create = 'kanban_goal_create',
|
||||
kanban_goal_update = 'kanban_goal_update',
|
||||
kanban_goal_delete = 'kanban_goal_delete',
|
||||
kanban_task_create = 'kanban_task_create',
|
||||
kanban_task_update = 'kanban_task_update',
|
||||
kanban_task_delete = 'kanban_task_delete',
|
||||
kanban_comment_create = 'kanban_comment_create',
|
||||
kanban_comment_delete = 'kanban_comment_delete',
|
||||
kanban_dependency_add = 'kanban_dependency_add',
|
||||
kanban_dependency_remove = 'kanban_dependency_remove',
|
||||
}
|
||||
|
||||
export const auditLogSchema = z.object({
|
||||
|
||||
@@ -23,3 +23,4 @@ export * from './chat'
|
||||
export * from './auditLog'
|
||||
export * from './watermark'
|
||||
export * from './quota'
|
||||
export * from './kanban'
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
import { z } from 'zod'
|
||||
import { kanbanUserInfoSchema } from './event'
|
||||
|
||||
export const kanbanAttachmentPayloadSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
key: z.string(),
|
||||
sizeByte: z.number(),
|
||||
contentType: z.string().nullable().optional(),
|
||||
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
||||
})
|
||||
export type KanbanAttachmentPayload = z.infer<typeof kanbanAttachmentPayloadSchema>
|
||||
|
||||
export const kanbanAttachmentInfoSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
sizeByte: z.number(),
|
||||
contentType: z.string().nullable().optional(),
|
||||
url: z.string(),
|
||||
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
||||
})
|
||||
export type KanbanAttachmentInfo = z.infer<typeof kanbanAttachmentInfoSchema>
|
||||
|
||||
export const postKanbanAttachmentResponseSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
key: z.string(),
|
||||
sizeByte: z.number(),
|
||||
contentType: z.string().nullable().optional(),
|
||||
uploadUrl: z.string(),
|
||||
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
||||
})
|
||||
export type PostKanbanAttachmentResponse = z.infer<typeof postKanbanAttachmentResponseSchema>
|
||||
|
||||
export const createKanbanCommentSchema = z
|
||||
.object({
|
||||
body: z.string().default(''),
|
||||
attachments: z.array(kanbanAttachmentPayloadSchema).optional(),
|
||||
})
|
||||
.refine(
|
||||
(data) => data.body.trim().length > 0 || (data.attachments && data.attachments.length > 0),
|
||||
{
|
||||
message: 'Comment body or attachments required',
|
||||
},
|
||||
)
|
||||
export type CreateKanbanCommentRequest = z.infer<typeof createKanbanCommentSchema>
|
||||
|
||||
export const kanbanCommentInfoSchema = z.object({
|
||||
id: z.string(),
|
||||
taskId: z.string(),
|
||||
author: kanbanUserInfoSchema,
|
||||
body: z.string(),
|
||||
attachments: z.array(kanbanAttachmentInfoSchema).default([]),
|
||||
createdAt: z.union([z.string(), z.date()]),
|
||||
updatedAt: z.union([z.string(), z.date()]),
|
||||
})
|
||||
export type KanbanCommentInfo = z.infer<typeof kanbanCommentInfoSchema>
|
||||
|
||||
export const listKanbanCommentsResponseSchema = z.object({
|
||||
data: z.array(kanbanCommentInfoSchema),
|
||||
})
|
||||
export type ListKanbanCommentsResponse = z.infer<typeof listKanbanCommentsResponseSchema>
|
||||
@@ -0,0 +1,46 @@
|
||||
import { z } from 'zod'
|
||||
import { KanbanTaskEventType, KanbanTaskStatus } from '@shumai/db/enums'
|
||||
|
||||
export const kanbanUserInfoSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
image: z.string().optional(),
|
||||
})
|
||||
export type KanbanUserInfo = z.infer<typeof kanbanUserInfoSchema>
|
||||
|
||||
export const kanbanEventPayloadSchema = z
|
||||
.object({
|
||||
summary: z.string().optional(),
|
||||
blockReason: z.string().optional(),
|
||||
blockKind: z.string().optional(),
|
||||
reason: z.string().optional(),
|
||||
assets: z
|
||||
.array(
|
||||
z.object({
|
||||
id: z.string(),
|
||||
type: z.string().optional(),
|
||||
name: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
})
|
||||
.passthrough()
|
||||
export type KanbanEventPayload = z.infer<typeof kanbanEventPayloadSchema>
|
||||
|
||||
export const kanbanEventInfoSchema = z.object({
|
||||
id: z.string(),
|
||||
taskId: z.string(),
|
||||
actor: kanbanUserInfoSchema.nullable().optional(),
|
||||
type: z.nativeEnum(KanbanTaskEventType),
|
||||
fromStatus: z.nativeEnum(KanbanTaskStatus).nullable().optional(),
|
||||
toStatus: z.nativeEnum(KanbanTaskStatus).nullable().optional(),
|
||||
data: kanbanEventPayloadSchema.nullable().optional(),
|
||||
createdAt: z.union([z.string(), z.date()]),
|
||||
})
|
||||
export type KanbanEventInfo = z.infer<typeof kanbanEventInfoSchema>
|
||||
|
||||
export const listKanbanEventsResponseSchema = z.object({
|
||||
data: z.array(kanbanEventInfoSchema),
|
||||
})
|
||||
export type ListKanbanEventsResponse = z.infer<typeof listKanbanEventsResponseSchema>
|
||||
@@ -0,0 +1,37 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const UNASSIGNED_GOAL_ID = 'unassigned'
|
||||
|
||||
export const createKanbanGoalSchema = z.object({
|
||||
title: z.string().min(1),
|
||||
description: z.string().optional(),
|
||||
})
|
||||
export type CreateKanbanGoalRequest = z.infer<typeof createKanbanGoalSchema>
|
||||
|
||||
export const updateKanbanGoalSchema = z.object({
|
||||
title: z.string().min(1).optional(),
|
||||
description: z.string().nullable().optional(),
|
||||
})
|
||||
export type UpdateKanbanGoalRequest = z.infer<typeof updateKanbanGoalSchema>
|
||||
|
||||
export const kanbanGoalInfoSchema = z.object({
|
||||
id: z.string(),
|
||||
title: z.string(),
|
||||
description: z.string().nullable().optional(),
|
||||
teamId: z.string(),
|
||||
creatorId: z.string().nullable().optional(),
|
||||
taskCount: z.number().optional(),
|
||||
createdAt: z.union([z.string(), z.date()]),
|
||||
updatedAt: z.union([z.string(), z.date()]),
|
||||
})
|
||||
export type KanbanGoalInfo = z.infer<typeof kanbanGoalInfoSchema>
|
||||
|
||||
export const listKanbanGoalsRequestSchema = z.object({
|
||||
// Filter or search params can be added here
|
||||
})
|
||||
export type ListKanbanGoalsRequest = z.infer<typeof listKanbanGoalsRequestSchema>
|
||||
|
||||
export const listKanbanGoalsResponseSchema = z.object({
|
||||
data: z.array(kanbanGoalInfoSchema),
|
||||
})
|
||||
export type ListKanbanGoalsResponse = z.infer<typeof listKanbanGoalsResponseSchema>
|
||||
@@ -0,0 +1,4 @@
|
||||
export * from './goal'
|
||||
export * from './comment'
|
||||
export * from './event'
|
||||
export * from './task'
|
||||
@@ -0,0 +1,164 @@
|
||||
import { z } from 'zod'
|
||||
import { KanbanTaskStatus, KanbanTaskPriority, KanbanTaskEventType } from '@shumai/db/enums'
|
||||
import { paginationPageInfoSchema, paginationParamsSchema } from '../pagination'
|
||||
import { kanbanUserInfoSchema, kanbanEventInfoSchema } from './event'
|
||||
import { kanbanCommentInfoSchema } from './comment'
|
||||
|
||||
export { KanbanTaskStatus, KanbanTaskPriority, KanbanTaskEventType }
|
||||
|
||||
export const createKanbanTaskSchema = z.object({
|
||||
title: z.string().min(1),
|
||||
description: z.string().optional(),
|
||||
isAgentTask: z.boolean().optional(),
|
||||
priority: z.nativeEnum(KanbanTaskPriority).optional(),
|
||||
startDate: z.union([z.string(), z.date()]).optional(),
|
||||
dueDate: z.union([z.string(), z.date()]).optional(),
|
||||
goalId: z.string().optional(),
|
||||
projectId: z.string().optional(),
|
||||
reporterId: z.string().optional(),
|
||||
assigneeId: z.string().optional(),
|
||||
targetFolderId: z.string().optional(),
|
||||
parentIds: z.array(z.string()).optional(),
|
||||
assetIds: z.array(z.string()).optional(),
|
||||
})
|
||||
export type CreateKanbanTaskRequest = z.infer<typeof createKanbanTaskSchema>
|
||||
|
||||
export const updateKanbanTaskSchema = z.object({
|
||||
fromStatus: z.nativeEnum(KanbanTaskStatus).optional(),
|
||||
title: z.string().min(1).optional(),
|
||||
description: z.string().nullable().optional(),
|
||||
status: z.nativeEnum(KanbanTaskStatus).optional(),
|
||||
reason: z.string().optional(),
|
||||
priority: z.nativeEnum(KanbanTaskPriority).optional(),
|
||||
startDate: z.union([z.string(), z.date()]).nullable().optional(),
|
||||
dueDate: z.union([z.string(), z.date()]).nullable().optional(),
|
||||
goalId: z.string().nullable().optional(),
|
||||
projectId: z.string().nullable().optional(),
|
||||
reporterId: z.string().nullable().optional(),
|
||||
assigneeId: z.string().nullable().optional(),
|
||||
targetFolderId: z.string().nullable().optional(),
|
||||
beforeIndex: z.string().optional(),
|
||||
afterIndex: z.string().optional(),
|
||||
parentIds: z.array(z.string()).optional(),
|
||||
assetIds: z.array(z.string()).optional(),
|
||||
})
|
||||
export type UpdateKanbanTaskRequest = z.infer<typeof updateKanbanTaskSchema>
|
||||
|
||||
export const listKanbanTasksRequestSchema = z
|
||||
.object({
|
||||
status: z.nativeEnum(KanbanTaskStatus).optional(),
|
||||
isAgentTask: z
|
||||
.union([z.boolean(), z.string()])
|
||||
.transform((v) => v === true || v === 'true')
|
||||
.optional(),
|
||||
goalId: z.string().optional(),
|
||||
projectId: z.string().optional(),
|
||||
priority: z.nativeEnum(KanbanTaskPriority).optional(),
|
||||
assigneeId: z.string().optional(),
|
||||
reporterId: z.string().optional(),
|
||||
})
|
||||
.merge(paginationParamsSchema)
|
||||
export type ListKanbanTasksRequest = z.infer<typeof listKanbanTasksRequestSchema>
|
||||
|
||||
export const kanbanStatusEventInfoSchema = z.object({
|
||||
id: z.string(),
|
||||
type: z.nativeEnum(KanbanTaskEventType),
|
||||
actor: kanbanUserInfoSchema.nullable().optional(),
|
||||
summary: z.string().optional(),
|
||||
blockReason: z.string().optional(),
|
||||
blockKind: z.string().optional(),
|
||||
reason: z.string().optional(),
|
||||
createdAt: z.union([z.string(), z.date()]),
|
||||
})
|
||||
export type KanbanStatusEventInfo = z.infer<typeof kanbanStatusEventInfoSchema>
|
||||
|
||||
export const kanbanTaskGoalSummarySchema = z.object({
|
||||
id: z.string(),
|
||||
title: z.string(),
|
||||
})
|
||||
export type KanbanTaskGoalSummary = z.infer<typeof kanbanTaskGoalSummarySchema>
|
||||
|
||||
export const kanbanTaskSummarySchema = z.object({
|
||||
id: z.string(),
|
||||
title: z.string(),
|
||||
isAgentTask: z.boolean(),
|
||||
status: z.nativeEnum(KanbanTaskStatus),
|
||||
priority: z.nativeEnum(KanbanTaskPriority),
|
||||
sortIndex: z.string().nullable().optional(),
|
||||
})
|
||||
export type KanbanTaskSummary = z.infer<typeof kanbanTaskSummarySchema>
|
||||
|
||||
export const kanbanTaskAssetInfoSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
type: z.string(),
|
||||
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
||||
thumbnailUrl: z.string().nullable().optional(),
|
||||
path: z.string(),
|
||||
creator: kanbanUserInfoSchema.nullable().optional(),
|
||||
sizeByte: z.number().optional(),
|
||||
fileCount: z.number().optional(),
|
||||
projectId: z.string().nullable().optional(),
|
||||
createdAt: z.union([z.string(), z.date()]),
|
||||
})
|
||||
export type KanbanTaskAssetInfo = z.infer<typeof kanbanTaskAssetInfoSchema>
|
||||
|
||||
export const kanbanTaskInfoSchema = z.object({
|
||||
id: z.string(),
|
||||
title: z.string(),
|
||||
description: z.string().nullable().optional(),
|
||||
isAgentTask: z.boolean(),
|
||||
status: z.nativeEnum(KanbanTaskStatus),
|
||||
priority: z.nativeEnum(KanbanTaskPriority),
|
||||
startDate: z.union([z.string(), z.date()]).nullable().optional(),
|
||||
dueDate: z.union([z.string(), z.date()]).nullable().optional(),
|
||||
startedAt: z.union([z.string(), z.date()]).nullable().optional(),
|
||||
completedAt: z.union([z.string(), z.date()]).nullable().optional(),
|
||||
teamId: z.string(),
|
||||
projectId: z.string().nullable().optional(),
|
||||
sortIndex: z.string().nullable().optional(),
|
||||
creator: kanbanUserInfoSchema,
|
||||
reporter: kanbanUserInfoSchema.nullable().optional(),
|
||||
assignee: kanbanUserInfoSchema.nullable().optional(),
|
||||
goal: kanbanTaskGoalSummarySchema.nullable().optional(),
|
||||
targetFolderId: z.string().nullable().optional(),
|
||||
latestStatusEvent: kanbanStatusEventInfoSchema.nullable().optional(),
|
||||
commentCount: z.number().default(0),
|
||||
dependencyCount: z.number().default(0),
|
||||
dependentCount: z.number().default(0),
|
||||
assetCount: z.number().default(0),
|
||||
createdAt: z.union([z.string(), z.date()]),
|
||||
updatedAt: z.union([z.string(), z.date()]),
|
||||
})
|
||||
export type KanbanTaskInfo = z.infer<typeof kanbanTaskInfoSchema>
|
||||
|
||||
export const kanbanTaskDetailSchema = kanbanTaskInfoSchema.extend({
|
||||
dependencies: z.array(kanbanTaskSummarySchema),
|
||||
dependents: z.array(kanbanTaskSummarySchema),
|
||||
assets: z.array(kanbanTaskAssetInfoSchema),
|
||||
comments: z.array(kanbanCommentInfoSchema),
|
||||
events: z.array(kanbanEventInfoSchema),
|
||||
})
|
||||
export type KanbanTaskDetail = z.infer<typeof kanbanTaskDetailSchema>
|
||||
|
||||
export const listKanbanTasksResponseSchema = z.object({
|
||||
data: z.array(kanbanTaskInfoSchema),
|
||||
pageInfo: paginationPageInfoSchema,
|
||||
})
|
||||
export type ListKanbanTasksResponse = z.infer<typeof listKanbanTasksResponseSchema>
|
||||
|
||||
export const linkAssetToTaskSchema = z.object({
|
||||
taskId: z.string(),
|
||||
})
|
||||
export type LinkAssetToTaskRequest = z.infer<typeof linkAssetToTaskSchema>
|
||||
|
||||
export const linkTaskAssetsSchema = z.object({
|
||||
assetIds: z.array(z.string()),
|
||||
})
|
||||
export type LinkTaskAssetsRequest = z.infer<typeof linkTaskAssetsSchema>
|
||||
|
||||
export const listAssetTasksResponseSchema = z.object({
|
||||
data: z.array(kanbanTaskInfoSchema),
|
||||
total: z.number(),
|
||||
})
|
||||
export type ListAssetTasksResponse = z.infer<typeof listAssetTasksResponseSchema>
|
||||
@@ -28,6 +28,14 @@ export const assetPreviewSchema = z.object({
|
||||
|
||||
export type AssetPreview = z.infer<typeof assetPreviewSchema>
|
||||
|
||||
export const kanbanTaskPreviewSchema = z.object({
|
||||
id: z.string().optional(),
|
||||
title: z.string().optional(),
|
||||
status: z.string().optional(),
|
||||
})
|
||||
|
||||
export type KanbanTaskPreview = z.infer<typeof kanbanTaskPreviewSchema>
|
||||
|
||||
export const notificationInfoSchema = z.object({
|
||||
id: z.string().optional(),
|
||||
creator: teamUserInfoSchema.optional(),
|
||||
@@ -35,6 +43,7 @@ export const notificationInfoSchema = z.object({
|
||||
team: entityInfoSchema.optional(),
|
||||
project: entityInfoSchema.optional(),
|
||||
asset: assetPreviewSchema.optional(),
|
||||
kanbanTask: kanbanTaskPreviewSchema.optional(),
|
||||
user: teamUserInfoSchema.optional(),
|
||||
createdAt: z.string().optional(),
|
||||
isRead: z.boolean().optional(),
|
||||
@@ -67,6 +76,7 @@ export interface CreateNotificationRequest {
|
||||
creatorId?: string
|
||||
assetId?: string
|
||||
taskId?: string
|
||||
kanbanTaskId?: string
|
||||
userId?: string
|
||||
commentMessage?: string // For parsing mentions
|
||||
}
|
||||
@@ -84,6 +94,8 @@ export const notificationSettingsSchema = z.object({
|
||||
yourUploads: z.boolean().default(false),
|
||||
otherUploads: z.boolean().default(true),
|
||||
statusUpdates: z.boolean().default(true),
|
||||
kanbanTasks: z.boolean().default(true),
|
||||
kanbanComments: z.boolean().default(true),
|
||||
})
|
||||
|
||||
export type NotificationSettings = z.infer<typeof notificationSettingsSchema>
|
||||
|
||||
Reference in New Issue
Block a user