Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 18, 2026

Adds interactive keyboard-driven mode to --tree UI for post-run test exploration and selective re-runs.

Changes

TreeViewDisplay.cs (+202 lines)

  • IsExpanded property on TreeViewNode for collapse/expand state tracking
  • Selection state: _selectedIndex, _interactiveMode fields
  • Navigation: SelectUp(), SelectDown() with auto-scroll
  • Toggle: ToggleSelectedNode() rebuilds flattened view
  • Re-run support: GetSelectedNodeTests() recursively collects test FQNs
  • Visual indicators: > (selection), / (expand/collapse), help footer

TestRunner.cs (+134 lines)

  • RunInteractiveModeAsync() orchestrates keyboard loop and re-run workflow
  • Checks Console.IsInputRedirected to skip when stdin redirected (CI/CD)
  • Handles keys: ↑/↓ (navigate), Enter (toggle), 'r' (re-run), Ctrl+C (exit)
  • After re-run completes, returns to interactive mode with updated results

Behavior

╭─MyTests (15/15)────────────────────────────────────────╮
│ 15 passed  0 failed  00:00                             │
│ ████████████████████████████████████████████████ 100 % │
│                                                         │
│ > └─ ▼ ● Asynkron (15/15)      ← selected              │
│      └─ ▼ ● TestRunner (15/15)                         │
│         └─ ● Tests (15/15)                              │
│                                                         │
│ ↑↓ navigate | Enter expand/collapse | r re-run         │
╰─────────────────────────────────────────────────────────╯

Press 'r' on a failed branch to re-run just those tests. Repeat until done. Ctrl+C to exit.

Original prompt

This section details on the original issue you should resolve

<issue_title>feat: Add interactive mode to --tree UI with keyboard navigation</issue_title>
<issue_description>## Summary

Add interactive keyboard-driven mode to the --tree UI that allows users to navigate and manipulate the test tree after the initial test run completes.

Features

  • Keyboard Navigation: Use up/down arrow keys to navigate the tree
  • Expand/Collapse: Press Enter to expand or collapse tree nodes
  • Re-run Tests: Press 'r' to re-run the selected branch (and all tests within it)
  • Persistent UI: No final summary screen; UI continues accepting input until the user initiates a re-run
  • Continuous Input: After a re-run completes, the UI returns to interactive mode with updated results

Behavior

  1. After test run completes, display the tree in interactive mode
  2. User navigates using keyboard (↑/↓ to select nodes)
  3. Pressing Enter toggles expand/collapse on the selected node
  4. Pressing 'r' re-runs all tests in the selected branch
  5. After re-run, tree updates with new results and returns to interactive mode
  6. Loop continues until user exits (e.g., Ctrl+C)

Implementation Notes

  • Extend ChartRenderer.cs or create new InteractiveTreeRenderer
  • Integrate with TestRunner.cs or create InteractiveRunner.cs
  • Track selected node position in tree
  • Support filtering re-run logic to only selected branch and children
  • Consider visual indicator for currently selected node
    </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add interactive mode to --tree UI with keyboard navigation feat: Add interactive mode to --tree UI with keyboard navigation Jan 18, 2026
Copilot AI requested a review from rogeralsing January 18, 2026 12:31
@rogeralsing rogeralsing marked this pull request as ready for review January 18, 2026 12:50
@rogeralsing rogeralsing merged commit 0bd17c9 into main Jan 18, 2026
1 check passed
@rogeralsing rogeralsing mentioned this pull request Jan 21, 2026
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.

feat: Add interactive mode to --tree UI with keyboard navigation

2 participants