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>
This commit is contained in:
egg
2025-12-05 09:12:10 +08:00
parent 1e44a63a8e
commit 1d5d4d447d
48 changed files with 3505 additions and 401 deletions

View File

@@ -11,6 +11,7 @@ from fastapi.responses import FileResponse
from app.core.config import get_settings
from app.core.database import engine, Base
from app.modules.auth import router as auth_router
from app.modules.auth.users_router import router as users_router
from app.modules.auth.middleware import auth_middleware
from app.modules.chat_room import router as chat_room_router
from app.modules.chat_room.services.template_service import template_service
@@ -43,12 +44,12 @@ app.add_middleware(
allow_headers=["*"],
)
# Authentication middleware (applies to all routes except login/logout)
# Note: Commented out for now to allow testing without auth
# app.middleware("http")(auth_middleware)
# Authentication middleware (applies to all /api routes except login/logout)
app.middleware("http")(auth_middleware)
# Include routers
app.include_router(auth_router)
app.include_router(users_router)
app.include_router(chat_room_router)
app.include_router(realtime_router)
app.include_router(file_storage_router)
@@ -81,21 +82,14 @@ async def startup_event():
logger.warning(f"MinIO connection failed: {e} - file uploads will be unavailable")
@app.get("/")
async def root():
"""Health check endpoint"""
return {
"status": "ok",
"service": "Task Reporter API",
"version": "1.0.0",
"description": "生產線異常即時反應系統",
}
@app.get("/health")
@app.get("/api/health")
async def health_check():
"""Health check for monitoring"""
return {"status": "healthy"}
return {
"status": "healthy",
"service": "Task Reporter API",
"version": "1.0.0",
}
# Serve frontend static files (only if build exists)