feat(console): add focusable scrollable detail/chat pane (v shortcut)#135
Open
codeaholicguy wants to merge 3 commits into
Open
feat(console): add focusable scrollable detail/chat pane (v shortcut)#135codeaholicguy wants to merge 3 commits into
codeaholicguy wants to merge 3 commits into
Conversation
Press v from the agent list to focus the right-side preview pane; scroll chat content with up/down or j/k without changing the selected agent; Esc or left arrow returns to list focus. Narrow mode leaves v as a no-op to avoid trapping focus in a hidden pane. Extracts key routing into a pure resolveConsoleKeyAction helper and chat viewport math into buildPreviewViewport so both are unit-testable without Ink rendering snapshots. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…fect Merge the two near-identical select-agent branches into one using modular arithmetic (idx + delta + list.length) % list.length, and extract clampedOffset from the viewport before useEffect to avoid optional-chaining in the dependency array. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
detail) so the right-side preview/chat pane can receive keyboard focus independently of the agent listvfrom the agent list to focus the selected agent's chat pane (wide mode only; no-op in narrow mode to avoid hidden focus trap)↑/↓/j/kscroll chat content instead of changing the selected agent;Escor←returns to list focus↑ older/↓ newer) appear in the pane header when additional content exists outside the viewportHow it works
Key routing is extracted into
resolveConsoleKeyAction()— a pure function with no Ink dependency, making all routing scenarios unit-testable. Viewport/scroll math lives inbuildPreviewViewport()— another pure helper that converts loaded messages + requested offset into visible lines, a clamped offset, and affordance flags.ConsoleAppowns the requested offset and relies onPreviewPaneto clamp and report the valid value back viaonScrollOffsetClamp.