Skip to content

feat(console): add focusable scrollable detail/chat pane (v shortcut)#135

Open
codeaholicguy wants to merge 3 commits into
mainfrom
feature-agent-console-detail-chat-view
Open

feat(console): add focusable scrollable detail/chat pane (v shortcut)#135
codeaholicguy wants to merge 3 commits into
mainfrom
feature-agent-console-detail-chat-view

Conversation

@codeaholicguy

@codeaholicguy codeaholicguy commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a third console focus state (detail) so the right-side preview/chat pane can receive keyboard focus independently of the agent list
  • Press v from the agent list to focus the selected agent's chat pane (wide mode only; no-op in narrow mode to avoid hidden focus trap)
  • While detail pane is focused, //j/k scroll chat content instead of changing the selected agent; Esc or returns to list focus
  • Scroll affordances (↑ older / ↓ newer) appear in the pane header when additional content exists outside the viewport
  • Switching agents resets the scroll offset so the latest content is always shown first

How 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 in buildPreviewViewport() — another pure helper that converts loaded messages + requested offset into visible lines, a clamped offset, and affordance flags. ConsoleApp owns the requested offset and relies on PreviewPane to clamp and report the valid value back via onScrollOffsetClamp.

codeaholicguy and others added 3 commits July 2, 2026 23:08
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>
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