Skip to content

feat(tui): add thread commands and session graph#32299

Draft
mrbickle98 wants to merge 3 commits into
anomalyco:devfrom
mrbickle98:thread-commands
Draft

feat(tui): add thread commands and session graph#32299
mrbickle98 wants to merge 3 commits into
anomalyco:devfrom
mrbickle98:thread-commands

Conversation

@mrbickle98

@mrbickle98 mrbickle98 commented Jun 14, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #32316

Type of change

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

What does this PR do?

Adds two new slash commands to the TUI:

  1. /thread - Creates a child thread from selected text. When you select text and run this command, it creates a new session linked to the parent, captures the selected text and recent conversation context, and stores them in session metadata. The child session shows a ThreadFooter with navigation buttons (Parent, Prev, Next, Graph) and displays the selected text excerpt.

  2. /graph - Shows a visual tree of all threads and subagents related to the current session. Displays parent threads with their selected text, the current session highlighted, and child threads/subagents nested below. Click any node to navigate to that session.

The prompt handler injects the parent context as a synthetic system reminder on the first message in a thread session, so the AI has context about what was selected.

How did you verify your code works?

  • Typecheck passes: bun typecheck in packages/tui
  • Unit tests pass: bun test test/util/session.test.ts
  • Verified thread creation captures selected text and parent context
  • Verified graph dialog shows correct hierarchy

Screenshots / recordings

UI change - screenshots pending

Checklist

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

- Add /thread command to create child threads from selected text
- Add /graph command to visualize session hierarchy (threads + subagents)
- Add ThreadFooter with navigation (parent/prev/next) and selected text excerpt
- Add DialogSessionGraph for tree view of all thread relationships
- Inject thread context (selected text + parent snapshot) on first prompt
- Add session.thread.new and session.graph keybinds
- Add session utility helpers (isThread, isSubagent, getThreadChildren, etc.)
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Jun 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

[FEATURE]: Thread commands and session graph

1 participant