feat: implement collaboration module

- Backend (FastAPI):
  - Task comments with nested replies and soft delete
  - @mention parsing with 10-mention limit per comment
  - Notification system with read/unread tracking
  - Blocker management with project owner notification
  - WebSocket endpoint with JWT auth and keepalive
  - User search API for @mention autocomplete
  - Alembic migration for 4 new tables

- Frontend (React + Vite):
  - Comments component with @mention autocomplete
  - NotificationBell with real-time WebSocket updates
  - BlockerDialog for task blocking workflow
  - NotificationContext for state management

- OpenSpec:
  - 4 requirements with scenarios defined
  - add-collaboration change archived

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beabigegg
2025-12-29 20:45:07 +08:00
parent 61fe01cb6b
commit 3470428411
38 changed files with 3088 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
# Change: Add Collaboration Features
## Why
專案管理系統需要協作功能,讓團隊成員能在任務內進行討論、標記相關人員,並處理任務阻礙。目前系統缺乏這些核心協作機制,導致使用者仍需依賴 Email 或其他工具進行溝通。
## What Changes
- 新增任務留言系統(支援巢狀回覆)
- 實作 @提及功能(自動完成 + 即時通知)
- 建立阻礙管理機制(標記原因、主管通知、解除追蹤)
- 實作即時通知系統Redis Pub/Sub + WebSocket
## Impact
- Affected specs: `collaboration`
- Affected code:
- 新增 models: Comment, Mention, Notification, Blocker
- 新增 API routes: `/comments`, `/notifications`
- 新增 services: NotificationService, WebSocketManager
- 前端: 任務詳情頁新增留言區、通知中心