hapi icon indicating copy to clipboard operation
hapi copied to clipboard

Show and filter work directories in Codex import

Open zhaozhaozz opened this issue 5 months ago • 1 comments

Problem

The Codex session import dialog lists local Codex sessions, but sessions from multiple projects are hard to distinguish when the working directory is not visible and there is no way to filter by project directory.

Proposed change

  • Show each Codex session's working directory in the import list.
  • Add a work directory filter to narrow the list before importing.
  • Keep "Select all" scoped to the currently visible filtered sessions.

Acceptance criteria

  • Users can see the working directory for Codex sessions that include cwd metadata.
  • Users can filter local Codex sessions by working directory.
  • Selecting all after filtering imports only the visible filtered sessions.
  • The behavior is covered by focused component tests.

zhaozhaozz avatar Jun 05 '26 09:06 zhaozhaozz

This is a valid frontend change request. Verified current state: local Codex session summaries already include optional cwd from transcript metadata, but the import dialog currently only renders title, preview, current marker, and modified time. There is no work-directory filter in the dialog today, and Select all currently selects every session passed into the component, so after adding filtering it should be changed to select the filtered/visible session IDs only.

Relevant code:

  • hub/src/web/routes/codexDesktop.ts:55 - CodexLocalSessionSummary already defines optional cwd.
  • hub/src/web/routes/codexDesktop.ts:413 - local Codex transcript parser builds session summaries.
  • hub/src/web/routes/codexDesktop.ts:448 - parser reads payload.cwd from session_meta.
  • hub/src/web/routes/codexDesktop.ts:484 - returned summary includes cwd.
  • hub/src/web/routes/codexDesktop.ts:1626 - /api/codex/sessions returns listLocalCodexSessions().
  • web/src/types/api.ts:162 - frontend CodexLocalSessionSummary also includes optional cwd.
  • web/src/api/client.ts:196 - frontend fetches local Codex sessions from /api/codex/sessions.
  • web/src/components/CodexSessionSyncDialog.tsx:98 - selectAll currently selects all sessions prop IDs.
  • web/src/components/CodexSessionSyncDialog.tsx:176 - dialog maps over all sessions with no directory filter.
  • web/src/components/CodexSessionSyncDialog.tsx:202 - list preview currently shows last user message or originator/version, not cwd.

No focused component test for CodexSessionSyncDialog was found in web/src during the code search, so the requested coverage likely needs a new component test around rendering cwd, filtering by cwd, and selecting only visible filtered sessions.


HAPI Bot

github-actions[bot] avatar Jun 05 '26 09:06 github-actions[bot]