Files
Task_Reporter/openspec/changes/archive/2025-12-05-add-admin-room-management/proposal.md
egg 1d5d4d447d feat: Add mobile responsive layout, open room access, and admin room management
Mobile Responsive Layout:
- Add useMediaQuery, useIsMobile, useIsTablet, useIsDesktop hooks for device detection
- Create MobileHeader component with hamburger menu and action drawer
- Create BottomToolbar for mobile navigation (Files, Members)
- Create SlidePanel component for full-screen mobile sidebars
- Update RoomDetail.tsx with mobile/desktop conditional rendering
- Update RoomList.tsx with single-column grid and touch-friendly buttons
- Add CSS custom properties for safe areas and touch targets (min 44px)
- Add mobile viewport meta tags for notched devices

Open Room Access:
- All authenticated users can view all rooms (not just their own)
- Users can join active rooms they're not members of
- Add is_member field to room responses
- Update room list API to return all rooms by default

Admin Room Management:
- Add permanent delete functionality for system admins
- Add delete confirmation dialog with room title verification
- Broadcast room deletion via WebSocket to connected users
- Add users search API for adding members

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 09:12:10 +08:00

33 lines
1.4 KiB
Markdown

# Proposal: Add Admin Room Management
## Why
Currently, rooms can only be soft-deleted (archived) and non-admin users can still see archived rooms when filtering. This creates two issues:
1. **No permanent deletion**: Archived rooms remain in the database indefinitely, and there's no way to completely remove sensitive or test data.
2. **Archived rooms visible to all**: Non-admin users can view archived rooms by changing the status filter, which may expose historical data that should be hidden from general users.
## What Changes
### 1. Admin-Only Permanent Room Deletion
- Add new endpoint `DELETE /api/rooms/{room_id}/permanent`
- Only system administrator (ymirliu@panjit.com.tw) can execute
- Cascading hard delete of all related data (members, messages, files, reports)
- Clean up MinIO storage for associated files
- Broadcast WebSocket disconnect to active connections
### 2. Hide Archived Rooms from Non-Admin Users
- Modify room listing to exclude ARCHIVED status for non-admin users
- Even "All Status" filter will not show archived rooms for regular users
- Admin users retain full visibility of all room statuses
- Remove "Archived" option from frontend status filter for non-admin users
## Related Specs
- `chat-room`: Room access control and deletion
- `frontend-core`: Room list filtering UI
## Out of Scope
- Batch deletion of multiple rooms
- Scheduled auto-deletion of old archived rooms
- Restore deleted rooms from backup