feat(tui): list preview pane at wide terminals#1749
Merged
Conversation
- Extend list-viewport.test.tsx: preview renders at wide widths (>=120
cols), updates as cursor moves, absent at narrow widths, absent when
renderPreview prop is not provided
- Extend panels-screen.test.tsx: panel preview summary ("members"
label) appears beside list when stdout is wide (140 cols)
Co-authored-by: Copilot <175574315+pedrofuentes@users.noreply.github.com>
- Add PREVIEW_MIN_COLS=120 const and optional renderPreview/stdout props to ListViewportProps; passes stdout to useTerminalSize for injection - At columns>=120 with renderPreview provided, render a two-column layout: list on the left, bordered preview pane on the right showing renderPreview(selectedItemId); narrows fall through to existing layout - Preview updates as the cursor moves (safeCursor drives selectedId) - Migrate PanelsScreen, ExpertsScreen, SessionsScreen, ChatsScreen: each accepts stdout? for test injection and passes a renderPreview rendering a sanitized short summary of the selected entity - All preview strings pass through toSingleLineDisplay; no new imports of @github/copilot-sdk or restricted modules Co-authored-by: Copilot <175574315+pedrofuentes@users.noreply.github.com>
The initial assertion not.toContain('\u001B[') was too broad: Ink's own
border and bold styling legitimately emit ANSI CSI sequences. Fix by
embedding \u001B[31m in the test-data panel name and asserting that the
specific red-ANSI sequence does NOT appear in the preview (i.e., the
renderPreview callback sanitizes user-supplied content via
toSingleLineDisplay).
Co-authored-by: Copilot <175574315+pedrofuentes@users.noreply.github.com>
Pass stdout to useTerminalSize conditionally (only when defined) to satisfy exactOptionalPropertyTypes=true; add | undefined to all optional stdout and renderPreview declarations in ListViewportProps and the four screen props interfaces. Co-authored-by: Copilot <175574315+pedrofuentes@users.noreply.github.com>
Owner
Author
|
Status: APPROVED Sentinel Review ReportRef: feature/tui-preview-pane → main Phase 1 — TDD / Test Evidence
Phase 1.5 — Fast-path Evaluation🔴 count: 0 | LOC: 132 non-test/non-lockfile changed lines (≤150: Y) | Security paths: Y (TUI renders untrusted content to terminal/UI) | New deps: N | Commit types qualify: N ( Phase 2 — Execution Log
Findings
Details (ordered by severity)No reportable findings. Follow-ups & Actions
Decision rationale
|
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
ListViewport gains an optional
renderPreviewshown beside the list at ≥120 cols; Panels/Experts/Sessions/Chats provide a selected-item preview; narrow-width rendering unchanged; Phase 10 TUI overhaul — PR-17Changes
ListViewportPREVIEW_MIN_COLS = 120constrenderPreview?: (selectedId: string) => React.ReactNodeandstdout?: ResizableStdout(for test injection)renderPreviewis provided and terminalcolumns >= 120, renders a two-column layout: existing list on the left, bordered preview pane on the right showingrenderPreview(selectedItemId)safeCursordrivesselectedId)renderPreview→ falls through to unchanged single-column layoutScreen migrations (PanelsScreen, ExpertsScreen, SessionsScreen, ChatsScreen)
readonly stdout?: ResizableStdout | undefinedprop (threaded to ListViewport for test injection)renderPreviewthat builds a sanitized short summary from the loaded list data:toSingleLineDisplay(sanitized)Tests
list-viewport.test.tsx: 4 new tests — preview renders at wide width (140 cols via FakeStdout), updates on cursor move, absent at narrow (80 cols), absent withoutrenderPreviewpanels-screen.test.tsx: 1 new test — preview "members" label appears at wide width; raw\u001B[31mfrom tainted panel name does not bleed throughOut of scope
AppRouter/footer/nav/Header; detail screens; narrow-width rendering (unchanged).