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.0 KiB
3.0 KiB
Sessions Hub - Design
Architecture
Sessions Hub
├── Navigation
│ └── "Sessions" tab (between Dashboard and Projects)
│ └── Badge with active session count
├── SessionsPage
│ ├── Last Session Section
│ │ └── Quick access card with resume button
│ ├── Active Sessions Section
│ │ └── Grid of active session cards
│ ├── Recent Sessions Section
│ │ └── List of recent sessions
│ └── Create Session Section
│ └── Project selector + tool type selector
└── User Config
└── last_session_id field
Component Design
SessionsPage
Sections:
-
Last Session (if exists)
- Large card showing last session details
- "Resume" button to open the workspace
- Shows project, repository, tool type
-
Active Sessions
- Grid of cards for running instances
- Each card: name, type, status badge, action buttons
- Actions: Open, Stop, Restart, Delete
-
Recent Sessions
- List of last 5 sessions (any status)
- Compact list view with status indicators
- Click to navigate to workspace
-
Create New Session
- Project dropdown (all user's projects)
- Repository dropdown (filtered by project)
- Tool type dropdown
- Display name input
- "Create" button
AppShell Updates
Navigation:
Dashboard | Sessions (3) | Projects | SSH Keys | Tool Types | Settings
Badge:
- Shows count of active (running) sessions
- Updates via existing sessions polling
User Config Extension
New field:
interface UserConfig {
// existing fields...
last_session_id: string | null;
}
Update timing:
- Set when creating a new session
- Set when opening/resuming a session
Data Flow
Loading Sessions Page
- Fetch user config (for last_session_id)
- Fetch all user sessions via
/users/me/sessions - Filter into active vs recent
- Display last session if available
Creating Session
- User selects project, repo, tool type
- POST to
/projects/{id}/repositories/{id}/instances - On success: update user config with last_session_id
- Refresh sessions list
Resuming Session
- User clicks "Resume" on last session
- Navigate to workspace with session active
- Update user config (reinforce as last)
API Changes
GET /users/me/sessions
Already exists - returns all sessions for user.
PATCH /users/me/config
Already exists - add last_session_id to config schema.
Technical Details
Frontend:
- New page:
pages/sessions.tsx - Update:
app-shell.tsxfor navigation - Update:
api/settings.tsfor config type - Update:
state/sessions.tsxfor badge count
Backend:
- Update:
models/user_config.pyschema - Update:
api/user_config.pyto accept last_session_id
No new backend endpoints needed - reuse existing APIs.
Error Handling
- No sessions: Show empty state with "Create your first session" CTA
- Failed to load: Show error with retry button
- Create failed: Show error message, keep form open