063a839790
- Add clone_mode and branch fields to tool_instances - Add ssh_key_id to git_repositories for per-repo SSH key assignment - Implement host-side git cloning with branch selection (default: main) - Mount SSH keys into containers for git operations in clone mode - Add dirty state check on clone-mode instance deletion with confirmation - Update SessionsPage with mount/clone selector, branch input, SSH key display - Add SSH key selector to repository creation form - Add dirty delete confirmation modal with changed files list - Update API schemas and endpoints for new fields - Sync delta specs to main specs (git-repo, tool-instances, repo-clone-mode) - Archive completed OpenSpec change: repo-clone-mode-with-ssh - Document git requirement for custom tool types Quality gates: Frontend typecheck and build passed OpenSpec: repo-clone-mode-with-ssh archived with all tasks complete
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