Files
Task_Reporter/openspec/changes/archive/2025-12-04-add-open-room-access/tasks.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

3.3 KiB

Tasks: Add Open Room Access

Phase 1: Backend - Room Visibility & Self-Join

1.1 Modify room listing to show all rooms

  • Update room_service.list_user_rooms() to return all rooms for authenticated users
  • Add is_member and current_user_role fields to room response
  • Add my_rooms query parameter filter
  • Update room list schema to include new fields
  • Write unit tests for modified listing behavior

1.2 Implement self-join endpoint

  • Create POST /api/rooms/{room_id}/join endpoint
  • Add validation for already-member case (return 409)
  • Add validation for archived room case (return 400)
  • Create membership with role="viewer" and added_by=self
  • Update room member_count on join
  • Write integration tests for self-join

1.3 Modify role change permissions for editors

  • Update membership_service.check_user_permission() for role changes
  • Allow EDITOR to upgrade VIEWER → EDITOR
  • Deny EDITOR from downgrading (editor→viewer) or removing members
  • Deny EDITOR from setting owner role
  • Write unit tests for permission matrix changes

1.4 Implement user search endpoint

  • Create GET /api/users/search endpoint
  • Query users table by display_name and user_id (email)
  • Return max 20 results
  • Require minimum query length
  • Write tests for search functionality

Phase 2: Frontend - Login & Room List

2.1 Add password visibility toggle to login

  • Add eye/eye-slash toggle button to password field
  • Toggle input type between "password" and "text"
  • Update button icon based on visibility state
  • Ensure toggle works with keyboard accessibility

2.2 Update room list for all-rooms view

  • Fetch all rooms (remove member-only filter default)
  • Display "Member" badge for member rooms
  • Display "Join" button for non-member rooms
  • Add "My Rooms Only" filter toggle
  • Handle join action with optimistic update

2.3 Create room join preview for non-members

  • Create restricted view for non-member room access
  • Show room metadata but not content
  • Display prominent "Join Room" button
  • Handle join with success toast and page reload

Phase 3: Frontend - Member Management

3.1 Add user search to member management

  • Create searchable user input component
  • Implement debounced search (300ms)
  • Display search results with name and email
  • Handle empty results state
  • Wire up to GET /api/users/search

3.2 Update member role change UI for editors

  • Show "Upgrade to Editor" for viewers (when current user is editor)
  • Hide remove option for editors
  • Hide downgrade options for editors
  • Keep full controls visible for owners

Phase 4: Testing & Validation

4.1 Backend integration tests

  • Test room listing shows all rooms
  • Test self-join creates viewer membership
  • Test editor can upgrade but not downgrade
  • Test user search returns correct results

4.2 Frontend E2E tests

  • Test password visibility toggle
  • Test room list shows join buttons
  • Test self-join flow
  • Test member search and add flow
  • Test editor role limitations

Validation Checklist

  • Run openspec validate add-open-room-access --strict
  • All existing tests pass
  • New tests cover all scenarios
  • Manual testing of full user flow