94aa88c154
- Add Sessions tab to navigation between Dashboard and Projects - Show active session count badge in navigation - Create SessionsPage with: - Last session section with resume button - Active sessions grid with open/stop actions - Recent sessions list - Create session form with project/repo/tool selectors - Add last_session_id to user config - Update UserConfig schemas (backend and frontend) - Add comprehensive CSS for sessions page Quality gates: typecheck ✓, lint ✓, build ✓
3.5 KiB
3.5 KiB
Sessions Hub Specification
Requirements
Functional Requirements
- Sessions Tab: Navigation item between Dashboard and Projects
- Active Sessions Display: Show all running sessions with actions
- Last Session: Prominently show last created/accessed session
- Quick Create: Create sessions for any project from Sessions page
- Session Persistence: Save last_session_id in user config
- Badge: Show active session count in navigation
Non-Functional Requirements
- Performance: Load sessions in < 500ms
- Real-time: Badge updates with active count
- Responsive: Works on mobile and desktop
API Specification
Existing Endpoints Used
GET /users/me/sessions- List all user sessionsPOST /projects/{id}/repositories/{id}/instances- Create instanceGET /projects- List projects for selectorGET /projects/{id}/repositories- List repos for selectorGET /tool-types- List tool types for selectorGET /users/me/config- Get user config (with last_session_id)PATCH /users/me/config- Update user config (last_session_id)
User Config Schema Update
class UserConfigUpdate(BaseModel):
theme: Optional[str] = None
default_editor: Optional[str] = None
git_user_name: Optional[str] = None
git_user_email: Optional[str] = None
last_session_id: Optional[str] = None # NEW
UI Specification
Sessions Page Layout
+------------------------------------------+
| Sessions [New Session]|
+------------------------------------------+
| |
| Last Session |
| +--------------------------------------+ |
| | VS Code Server - My Project [Open] | |
| | Running on port 8080 | |
| +--------------------------------------+ |
| |
| Active Sessions (3) |
| +----------+ +----------+ +----------+ |
| | Session 1| | Session 2| | Session 3| |
| | Running | | Running | | Running | |
| | [Open] | | [Open] | | [Open] | |
| +----------+ +----------+ +----------+ |
| |
| Recent Sessions |
| - Session 4 (stopped) |
| - Session 5 (stopped) |
| |
+------------------------------------------+
Navigation Badge
[Dashboard] [Sessions (3)] [Projects] ...
Badge shows count of sessions with status === "running".
Create Session Dialog
+------------------------------------------+
| Create New Session |
+------------------------------------------+
| Project: [Dropdown] |
| Repository: [Dropdown] |
| Tool Type: [Dropdown] |
| Name: [Input] |
| |
| [Cancel] [Create] |
+------------------------------------------+
State Management
Sessions Context (existing)
Already polls /users/me/sessions every 10s. Use this for:
- Active session count (badge)
- Active sessions list
- Recent sessions list
User Config (existing)
Add last_session_id field. Update:
- On session creation
- On session open/resume
Quality Gates
- TypeScript compilation passes
- ESLint passes
- All sessions load correctly
- Badge updates with active count
- Last session persists across reloads
- Create session works from Sessions page