Skip to content

Add collapsible active-sessions sidebar to the session page - #69

Open
ai-yappa[bot] wants to merge 1 commit into
mainfrom
agent/slack-v1-T07DMLN1JE6-C0BTJCJD69K-1789373437.289659
Open

ai-yappa[bot] wants to merge 1 commit into
mainfrom
agent/slack-v1-T07DMLN1JE6-C0BTJCJD69K-1789373437.289659

Conversation

@ai-yappa

@ai-yappa ai-yappa Bot commented Sep 14, 2026

Copy link
Copy Markdown

Summary

Adds a collapsible sidebar to the Codevil session page (/session/:id) that shows all other active sessions — sessions currently running or awaiting review — with the current session excluded.

What changed

  • packages/web/src/components/session/session-sidebar.tsx (new)

    • Fetches the session directory via the existing listSessions endpoint on mount.
    • Filters to active sessions (running / awaiting review) and excludes the currently open session, sorted most-recent first.
    • Collapsible: a chevron toggle collapses the panel to a narrow ribbon that keeps a live active-count badge. The collapsed state persists in localStorage (codevil_session_sidebar_collapsed).
    • Refreshes every 30s and whenever the tab regains focus/visibility, so the "other active sessions" list stays current across multiple sessions.
    • Each entry shows title, status pill, repo, and relative last-activity time, and navigates to that session.
    • Empty state ("No other active sessions") when nothing else is active.
  • packages/web/src/lib/session-status.ts (new)

    • Extracts the session-status derivation (deriveStatus, STATUS_LABEL) that lived in the home page so the sidebar and home page share one status vocabulary.
    • Adds isActiveSession (running or awaiting review; archived/failed/done are excluded) and filterOtherActiveSessions.
  • packages/web/src/routes/index.tsx — refactored to import the shared status module (no behavior change).

  • packages/web/src/routes/session.$id.tsx — renders the sidebar between the top rail and the workbench via a new .session-body row.

  • packages/web/src/session-components.css — sidebar styles (expanded/collapsed widths, dark-mode friendly via existing theme vars, responsive sizing ≤900px).

  • packages/web/src/lib/__tests__/session-status.test.ts (new) — unit tests for status derivation, active filtering, and "other active sessions" selection.

Verification

  • pnpm typecheck (repo root): passes for all packages.
  • pnpm test in packages/web: 264 tests pass (25 files), including the 10 new ones.
  • Root pnpm verify runs the sandbox-image integration tests, which fail in this sandbox (14 failures in packages/sandbox-image, environment-dependent: clone/pr/agent-tool behaviors). These are unrelated to this web-only change; web typecheck + build + tests all pass.

Add a left sidebar on /session/:id that lists all other active sessions
(running or awaiting review), excluding the current one. The sidebar
fetches the session directory on mount, refreshes every 30s and on tab
focus/visibility, and persists its collapsed state in localStorage.

Factor the home page's session-status derivation into a shared module so
the sidebar and home page use one status vocabulary, with unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants