Skip to content

feat(tui): add global session picker toggle#33450

Open
onurmicoogullari wants to merge 1 commit into
anomalyco:devfrom
onurmicoogullari:global-session-picker
Open

feat(tui): add global session picker toggle#33450
onurmicoogullari wants to merge 1 commit into
anomalyco:devfrom
onurmicoogullari:global-session-picker

Conversation

@onurmicoogullari

@onurmicoogullari onurmicoogullari commented Jun 22, 2026

Copy link
Copy Markdown

Issue for this PR

Addresses #31932

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds an explicit global mode to the TUI session picker so users can discover and resume sessions from other projects without changing the default scoped picker behavior.

Key changes:

  • adds a session.toggle.global_list command and session_toggle_global_list keybind config
  • keeps default /sessions behavior scoped to the current project/directory
  • uses /experimental/session for global picker rows
  • shows project/path context for global rows
  • keeps sync.session.refresh(), --continue, and normal scoped sync behavior unchanged
  • requests root sessions server-side so child sessions do not crowd out root sessions

How did you verify your code works?

Ran:

  • bun test test/cli/cmd/tui/sync.test.tsx test/cli/cmd/tui/dialog-session-list.test.tsx test/config.test.tsx
  • bun typecheck
  • git diff --check origin/dev..HEAD

The pre-push hook also ran full repo typecheck successfully.

Screenshots / recordings

Default scoped mode:
Default scoped session picker mode

Sessions outside the current working directory are not shown:
Scoped session picker with no cross-project sessions shown

Global mode enabled:
Session picker with global mode enabled

Cross-project sessions are discoverable with project and path context:
Global session picker showing sessions from multiple projects

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

I found a potentially related PR:

PR #32750: feat: add global session list scope toggle (local → project → global)
#32750

This PR appears to address a very similar feature - a global session list scope toggle. This could be a duplicate or closely related work addressing the same underlying issue (#31932). You should check if #32750 is still open and what its current status is to avoid overlapping changes.

Summary

Adds an explicit global mode to the TUI session picker so users can discover and resume sessions from other projects without changing the default scoped picker behavior.

Addresses anomalyco#31932.

Key changes

- Added a session.toggle.global_list command and session_toggle_global_list keybind config to switch the picker between scoped and global listing.

- Routed picker browsing and search through a scoped/global list path that uses /experimental/session for global rows while leaving sync.session.refresh() and --continue scoped.

- Rendered project/path context for global rows and added spacing for multi-line select details so cross-project sessions are distinguishable.

- Covered scoped refresh, global root filtering, hydrated global session cleanup, and pinned global session behavior with TUI tests.
@onurmicoogullari

Copy link
Copy Markdown
Author

The following comment was made by an LLM, it may be inaccurate:

I found a potentially related PR:

PR #32750: feat: add global session list scope toggle (local → project → global) #32750

This PR appears to address a very similar feature - a global session list scope toggle. This could be a duplicate or closely related work addressing the same underlying issue (#31932). You should check if #32750 is still open and what its current status is to avoid overlapping changes.

I had not seen #32750 because it was not linked from #31932 when I started working on this.

The two PRs are related, but I do not think they are equivalent.

From the current #32750 diff, the “global” mode still appears to call sdk.client.session.list(...), which goes through the normal /session endpoint. That path is still tied to the current project/directory context, including SDK directory injection, so it does not reliably produce a true cross-project session list for the case described in #31932.

This PR takes a different approach:

  • uses /experimental/session for global mode, which is the endpoint that actually returns sessions across projects
  • explicitly avoids SDK directory injection for the global request, so the list is not accidentally scoped back to the current working directory
  • keeps sync.session.refresh() scoped, so --continue, quick switching, and normal TUI session state do not start seeing global sessions
  • keeps the feature picker-only: global rows are shown in the /sessions picker without changing the default scoped behavior
  • requests roots=true server-side, so child/subagent sessions do not consume the result window before root filtering
  • shows both project context and the selected session’s actual directory, which matters when similarly named sessions exist in different repos
  • includes regression coverage for scoped/global listing, root filtering, opening/hydrating a global session, and pinned global sessions

The larger diff here is mostly tests and fixture support. The production change is intentionally small, but the tests cover the edge cases that make this easy to regress: accidental scoping via SDK directory injection, global rows leaking into scoped mode, and pinned/global session behavior after hydration.

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.

1 participant