feat(pointer): add typed mouse input and animated recording overlays - #28
Merged
Conversation
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.
Why
Mouse-driven terminal demos need to show where an interaction happened, not just the resulting screen. Terminal Control previously required raw escape sequences for mouse input and offered no pointer feedback in exported recordings.
What Changes
termctrl mouse demo move 12 4termctrl mouse demo click 12 4down,move,upvideo --pointer-overlay--pointer-reduced-motionThe same typed input is available through Rust sessions,
session.mouse(...)in the TypeScript client, and MCPsend_mouse. Ghostty uses the application's negotiated mouse protocol; disabled reporting and out-of-bounds coordinates fail before sending input.The pointer uses 220 ms smoothstep travel, subtle press compression, and short fades. It arrives at the recorded input instant without adding delays or synthetic input. Ordinary screenshots remain unadorned, and
--hide-cursorcontinues to mean the terminal text cursor.Recording Clock
Mouse evidence records the delivered bytes and semantic action on the existing recording clock. Video sampling follows source time through cuts, speed changes, holds, and resizes, rather than tying animation to terminal redraws.
New recordings use format v2; current readers still accept v1. Named sessions and driver clients check capability support and request an update/restart instead of falling back to unsafe raw input.
Maintenance Review
Public exports, adapter input shapes, legacy recording readability, process ownership, and documented commands are preserved. The audit found no justified unused-export or dependency deletions.
Demo
The same real PTY recording exported with the overlay disabled (left) and enabled (right). This uses the included
scripts/mouse-demo.tsfixture, not an external production application. The edit includes 0.8x and 1.4x clips, deliberate holds, and a viewport resize. Both exports are 60 fps.pointer-review-comparison.mp4
Scope
Typed mouse input and presentation-only video overlays, plus focused cleanup and regression fixes from a repository-wide review. Live recording controls (#5), additional MCP recording/artifact tools (#7), and the broader tape/workspace automation in #18 remain separate work.
Verification
Completed: 142 Rust tests (one manual benchmark ignored), 16 client tests, and 10 OpenTUI tests. Independent reviews checked lifecycle/ownership, adapter schemas, and recording timing. All 339 decoded frames of the edited demo are identical before and after the refactors. The three new correctness regressions failed before their fixes and pass afterward.
The complete validation set is being rerun before merge; packaged-consumer and CI results will be updated here:
bun install --frozen-lockfile cargo fmt --all -- --check cargo test --all-targets cargo clippy --all-targets --all-features -- -D warnings cargo build --release bun run test:npm bun run build:npm bun run validate:npm bun run validate:opentui cargo package --list cargo package