feat(tui): add thread commands and session graph#32299
Draft
mrbickle98 wants to merge 3 commits into
Draft
Conversation
- 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.)
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #32316
Type of change
What does this PR do?
Adds two new slash commands to the TUI:
/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./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?
bun typecheckin packages/tuibun test test/util/session.test.tsScreenshots / recordings
UI change - screenshots pending
Checklist