Skip to content

Frontend: /sessions list page + sidebar navigation entry #508

Description

@frankbria

Parent Issue

Part of #500 — depends on #501 (sessions CRUD API)

Context

There is currently no way to navigate to interactive sessions in the web-ui. This issue adds the /sessions page (a list of past and active sessions for the current workspace) and a sidebar navigation entry so users can discover and access it.

What to Build

1. New page: web-ui/src/app/sessions/page.tsx

Layout:

Sessions                          [+ New Session]
──────────────────────────────────────────────────
Search...

┌──────────────────────────────────────────────────┐
│ 🟢 Session #a3f2 · active                        │
│ workspace/myproject · claude-sonnet-4-6          │
│ Started 5 minutes ago · $0.012                   │
│                              [Resume →]          │
└──────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────┐
│ ⚪ Session #b1e7 · ended                          │
│ workspace/myproject · claude-sonnet-4-6          │
│ Ended 2 hours ago · $0.047                       │
│                              [View →]            │
└──────────────────────────────────────────────────┘

Data fetching:

  • GET /api/v2/sessions?workspace_path=<current> via SWR with 10s revalidation
  • Filter active sessions (state = active) and ended sessions separately
  • Show active sessions first

Session card:

  • State dot: green (active), gray (ended/paused)
  • Session short ID (last 8 chars of UUID)
  • Workspace path (basename only)
  • Model name
  • Relative start time + elapsed duration
  • Cost so far
  • [Resume →] for active, [View →] for ended — both link to /sessions/[id]
  • [End] button for active sessions (calls DELETE /api/v2/sessions/{id}, confirms first)

New Session button:

  • Opens a small modal/dialog:
    • Workspace path (pre-filled from current workspace, editable)
    • Model selector (dropdown: claude-sonnet-4-6, claude-opus-4-6, claude-haiku-4-5)
    • [Start Session] → POST /api/v2/sessions → redirect to /sessions/[id]

Empty state:

  • Icon + "No sessions yet" + "Start a session to chat with your agent interactively"

Loading state:

  • Skeleton cards (2–3 animate-pulse placeholders)

2. Sidebar navigation entry (web-ui/src/components/layout/AppSidebar.tsx)

Add "Sessions" as the 5th nav item (after Execution, before Blockers):

{ href: "/sessions", label: "Sessions", icon: MessageSquareIcon }
  • Use appropriate Hugeicon (e.g., MessageMultiple01Icon or similar chat icon)
  • Add active badge with count of active sessions (poll GET /api/v2/sessions?state=active every 30s — same pattern as blocker badge)

3. New layout file: web-ui/src/app/sessions/layout.tsx (if needed)

Standard page layout following the pattern of other pages.

Acceptance Criteria

  • /sessions page lists sessions from API, sorted active first
  • Session cards show state, model, elapsed time, and cost
  • [Resume →] / [View →] links navigate to /sessions/[id]
  • [End] button ends an active session with confirmation
  • "New Session" modal creates a session and redirects to detail page
  • Empty state shown when no sessions exist
  • Loading skeletons shown during initial fetch
  • Sidebar nav entry visible, active-highlighted when on /sessions
  • Sidebar badge shows count of active sessions

Notes

  • Reuse existing card patterns from TaskCard or workspace components for consistency
  • Workspace path comes from getSelectedWorkspacePath() (existing localStorage helper)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions