# Sessions Hub - Tasks

## Phase 1: Backend Config Update

- [x] **Task 1.1**: Update UserConfig model
  - Add `last_session_id` field to `models/user_config.py`
  - Create Alembic migration

- [x] **Task 1.2**: Update config API
  - Accept `last_session_id` in `api/user_config.py`
  - Update Pydantic schemas

## Phase 2: Frontend Navigation

- [x] **Task 2.1**: Add Sessions tab to AppShell
  - Insert between Dashboard and Projects
  - Add sessions icon
  - Show badge with active count

- [x] **Task 2.2**: Update router
  - Add `/sessions` route
  - Create placeholder page

## Phase 3: Sessions Page

- [x] **Task 3.1**: Create SessionsPage component
  - Page layout with sections
  - Loading and error states

- [x] **Task 3.2**: Implement Last Session section
  - Fetch from user config
  - Show session card with resume button
  - Handle no last session state

- [x] **Task 3.3**: Implement Active Sessions section
  - Fetch from sessions context
  - Grid of session cards
  - Action buttons (Open, Stop, Restart, Delete)

- [x] **Task 3.4**: Implement Recent Sessions section
  - Show last 5 sessions
  - Compact list view
  - Status indicators

- [x] **Task 3.5**: Implement Create Session section
  - Project selector (fetch all projects)
  - Repository selector (filtered by project)
  - Tool type selector
  - Display name input
  - Create button with validation

## Phase 4: Session Actions

- [x] **Task 4.1**: Resume last session
  - Navigate to workspace
  - Update user config

- [x] **Task 4.2**: Open session
  - Navigate to workspace with session

- [x] **Task 4.3**: Create session
  - Call API to create instance
  - Update user config with last_session_id
  - Refresh sessions list

## Phase 5: Polish

- [x] **Task 5.1**: Add CSS styles
  - Session cards layout
  - Badge styling
  - Responsive design

- [x] **Task 5.2**: Add icons
  - Session icon in navigation
  - Action icons on cards

## Phase 6: Quality Gates

- [x] **Task 6.1**: TypeScript check
  - `npm run typecheck`

- [x] **Task 6.2**: Lint check
  - `npm run lint`

- [x] **Task 6.3**: Build check
  - `npm run build`

- [x] **Task 6.4**: Manual verification
  - Navigation shows Sessions tab
  - Badge shows correct count
  - Last session displays
  - Can create session from page
  - Config persists
