Files
egg 599802b818 feat: Add Chat UX improvements with notifications and @mention support
- Add ActionBar component with expandable toolbar for mobile
- Add @mention functionality with autocomplete dropdown
- Add browser notification system (push, sound, vibration)
- Add NotificationSettings modal for user preferences
- Add mention badges on room list cards
- Add ReportPreview with Markdown rendering and copy/download
- Add message copy functionality with hover actions
- Add backend mentions field to messages with Alembic migration
- Add lots field to rooms, remove templates
- Optimize WebSocket database session handling
- Various UX polish (animations, accessibility)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 08:20:37 +08:00

78 lines
3.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Tasks: Add LOT Field and Remove Room Templates
## Phase 1: Remove Room Templates (Backend) ✅
- [x] **T-1.1**: 刪除 `app/modules/chat_room/services/template_service.py`
- [x] **T-1.2**: 更新 `app/modules/chat_room/services/__init__.py` 移除 template_service 匯出
- [x] **T-1.3**: 更新 `app/main.py` 移除 `template_service.initialize_default_templates()` 呼叫
- [x] **T-1.4**: 更新 `app/modules/chat_room/router.py` 移除:
- `GET /rooms/templates` 端點
- 建立房間時的 template 參數處理
- [x] **T-1.5**: 刪除 `RoomTemplate` 模型 (`app/modules/chat_room/models.py`)
- [x] **T-1.6**: 建立 Alembic migration 刪除 `tr_room_templates` 資料表
## Phase 2: Add LOT Field (Backend) ✅
- [x] **T-2.1**: 在 `IncidentRoom` 模型新增 `lots` 欄位 (JSON/Text 類型)
- [x] **T-2.2**: 建立 Alembic migration 新增 `lots` 欄位到 `tr_incident_rooms`
- [x] **T-2.3**: 更新 `app/modules/chat_room/schemas.py`
- `CreateRoomRequest` 新增 `lots: Optional[List[str]]`
- `UpdateRoomRequest` 新增 `lots: Optional[List[str]]`
- `RoomResponse` 新增 `lots: List[str]`
- 新增 `AddLotRequest` schema
- [x] **T-2.4**: 更新 `room_service.py`
- `create_room()` 支援 lots 參數
- `update_room()` 支援 lots 更新
- [x] **T-2.5**: 更新 `app/modules/chat_room/router.py` 新增:
- `POST /api/rooms/{room_id}/lots` - 新增單一 LOT
- `DELETE /api/rooms/{room_id}/lots/{lot}` - 刪除單一 LOT
- [x] **T-2.6**: 執行 migration 並測試 API
## Phase 3: Remove Room Templates (Frontend) ✅
- [x] **T-3.1**: 更新 `frontend/src/types/index.ts` 移除 `RoomTemplate` interface
- [x] **T-3.2**: 更新 `frontend/src/services/rooms.ts` 移除 `getTemplates()` 方法
- [x] **T-3.3**: 更新 `frontend/src/hooks/useRooms.ts` 移除:
- `roomKeys.templates()`
- `useRoomTemplates()` hook
- [x] **T-3.4**: 更新 `frontend/src/hooks/index.ts` 移除 `useRoomTemplates` 匯出
- [x] **T-3.5**: 更新 `frontend/src/pages/RoomList.tsx` 移除 `useRoomTemplates()` 呼叫
## Phase 4: Add LOT Field (Frontend) ✅
- [x] **T-4.1**: 更新 `frontend/src/types/index.ts`
- `Room` interface 新增 `lots: string[]`
- `CreateRoomRequest` 新增 `lots?: string[]`
- [x] **T-4.2**: 更新 `frontend/src/services/rooms.ts` 新增:
- `addLot(roomId: string, lot: string)` 方法
- `removeLot(roomId: string, lot: string)` 方法
- [x] **T-4.3**: 更新 `CreateRoomModal` 元件 (`RoomList.tsx`)
- 新增 LOT 輸入區塊(動態新增/刪除行)
- 整合到表單提交邏輯
- [x] **T-4.4**: 更新 `RoomDetail.tsx`
- 顯示 LOT 清單
- 新增 LOT 編輯功能(新增/刪除按鈕)
- [x] **T-4.5**: 新增 `useAddLot``useRemoveLot` hooks
## Phase 5: Testing & Cleanup ✅
- [x] **T-5.1**: 更新 `hooks/useRooms.test.ts` 移除模板相關 mock新增 LOT mock
- [x] **T-5.2**: Frontend build passes (npm run build)
- [x] **T-5.3**: Frontend tests pass (63 tests)
- [x] **T-5.4**: 清理未使用的 import 和程式碼
## Dependencies
- T-1.* 可以並行處理
- T-2.1, T-2.2 必須在 T-2.3-T-2.6 之前完成
- T-3.* 可以在 T-1.* 完成後並行處理
- T-4.* 需要 T-2.* 和 T-3.* 完成後才能開始
- T-5.* 在所有實作完成後進行
## Summary
All phases completed successfully:
- Backend templates removed and LOT field added
- Frontend templates removed and LOT UI implemented
- Build and tests pass