Skip to content

Phase 2.2 — Switch to an existing investigation window instead of opening a second one #331

Description

@ooloth

Phase 2.2 of #327. The title numbering is the work order: take milestone issues in Phase N.M order. The one hard dependency is #331 on #330, recorded as blockedBy; the rest is sequence, not blocking. Read gh issue view 327 --comments for the plan of record.

Current state

Pressing i twice on the same signal starts a second Claude Code session against the same item, with no indication the first one exists. launch() in ui/tui/src/investigations/launch.rs runs its tmux command unconditionally, and nothing anywhere checks whether an investigation for that signal is already open.

Ideal state

  • Pressing i on a signal that already has an open investigation window switches to that window instead of opening a second one
  • The TUI reports which window it switched to, rather than appearing to do nothing
  • Pressing i after that window has been closed opens a fresh investigation normally
  • Two different signals still get two separate windows

Out of scope

  • Detecting whether the session inside the window is still running or has finished. Window presence is the signal here; session state belongs to ADR 019's session records, which are not built
  • Resuming or reusing a completed session
  • Any automatic or unattended launching, which stays out of scope for this milestone

Starting points

  • ui/tui/src/investigations/launch.rs — the launch path, and the window naming introduced by the previous issue in this phase
  • ui/tui/src/state/update/mod.rs — where the investigate action becomes an effect

QA plan

  1. Select a PR, press i — expect a new named window
  2. Return to the TUI and press i on the same PR — expect no second window, and the TUI to switch to the existing one
  3. Run tmux list-windows — expect exactly one window for that PR
  4. Close the investigation window, return to the TUI, press i on the same PR — expect a fresh window to open
  5. Press i on a different PR — expect a second window alongside the first
  6. Run the TUI outside tmux and press i — expect the existing "not in tmux" error

Done when

Pressing i on a signal that already has an open investigation window switches to it instead of opening a second one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions