Skip to content

feat(tui): implement debugger controls widget and keyboard navigation - #493

Merged
codeZe-us merged 2 commits into
Toolbox-Lab:mainfrom
Marywase:feat/484-debugger-controls
Oct 23, 2026
Merged

codeZe-us merged 2 commits into
Toolbox-Lab:mainfrom
Marywase:feat/484-debugger-controls

Conversation

@Marywase

@Marywase Marywase commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

Implement the debugger controls footer and connect it to interactive replay navigation. The footer shows available hotkeys, the selected replay position, CPU instructions, and memory usage with budget percentages when limits are available.

How It Was Done

  • Render a responsive Ratatui footer with highlighted keybindings and disabled step styling at the end of the trace.
  • Poll Crossterm events for panel switching, navigation, step into/over, quitting, and terminal resizing.
  • Reconstruct the trace before entering raw mode, then browse its recorded invocation tree with a timeline and selected-invocation inspector. A terminal guard restores raw mode, cursor, and alternate-screen state on exit or errors.
  • Document interactive replay and add seven regression tests for rendering, navigation, budgets, resizing, and keyboard handling.
Acceptance criterion Implementation / evidence
Footer hotkeys and replay status TestBackend assertions at wide and narrow terminal sizes
CPU and memory budget indicators Actual ResourceProfile totals; tested percentages, unknown limits, and overruns
Keyboard event handling poll/read loop; tested Tab, navigation, step depth, quit, and release handling

Issues Encountered (If Any)

  • Full CLI testing is blocked by 19 existing compilation errors in grat-core, including missing TypeRef, decoder argument mismatches, and metadata access errors. These were reproduced on unchanged upstream main at 4d7390ebe6721023ecf3b55da08382101c55361b using the same dependency lockfile. No core changes are included here.
  • The existing upstream CI YAML is malformed and fails before creating jobs.
  • The current profiler supplies zero budget limits, so unavailable percentages display n/a. Navigation steps through recorded invocations; it does not implement live VM instruction stepping.

Related Issue

Closes #484

How It Was Tested

  • rustfmt --edition 2021 on the three changed Rust files; formatted files adopted.
  • git diff --check: passed.
  • Normal cargo test -p grat tui:: -- --nocapture and CLI Clippy: blocked by the core compilation errors above.
  • Isolated cargo test --manifest-path /tmp/issue-484-harness/Cargo.toml -- --nocapture: 7 passed.
  • Isolated cargo clippy --manifest-path /tmp/issue-484-harness/Cargo.toml --all-targets -- -D warnings: passed.

The isolated harness compiles the actual TUI source files and actual core trace types, with only the network config/replay boundary stubbed. It validates UI rendering and state transitions, not network replay, terminal lifecycle on a physical terminal, or complete CLI integration. The harness and workflow remain on a separate fork validation branch, outside this PR.

Validation run, logs, harness, and artifacts.

Screenshots / Video (If Applicable)

Excerpt from the real TestBackend rendering of the fixture (not a live transaction):

Controls | recorded replay totals
[Tab] Switch Panel  [j/k] Navigate  [s] Step Into  [o] Step Over  [q] Quit
CPU: 250 insns (25%) | Mem: 500 bytes (50%)
Replay: Paused 1/3

The validation log contains the complete 120-column terminal buffer; tests also cover 60-, 40-, 1-, and 0-column layouts.

Conflict resolution (October 23)

Merged upstream main at 2c58c74 into this branch. The application now renders the upstream hierarchical timeline while preserving this PR's inspector, controls footer, step/navigation keys and resize handling. The upstream ledger header and all unrelated upstream stepper/search changes are preserved. Added a regression for synchronized timeline/inspector selection.

Updated isolated validation: 18 TUI tests passed, including the upstream timeline widget tests; isolated Clippy with -D warnings passed. Applied the workflow's Rustfmt output and checked the final diff. The harness uses actual TUI sources and trace types, with the network replay boundary stubbed. Full cargo check -p grat remains blocked by 21 errors in unchanged upstream grat-core; the validation step tolerates that failure, so overall workflow success does not imply full CLI compilation passed. Existing malformed upstream CI and preview approval still require maintainer action.

@mintlify

mintlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 407da9a.

Approve preview

@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@Marywase Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6218a462-bc94-4a2e-83ba-851cc228cc69
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeZe-us
codeZe-us self-requested a review October 23, 2026 20:44
@codeZe-us
codeZe-us merged commit cf5edb4 into Toolbox-Lab:main Oct 23, 2026
2 checks passed
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.

Implement Ratatui Debugger Controls Widget

2 participants