Skip to content

Split recording_json helpers and add kitty extended-key integration tests#33

Merged
HalFrgrd merged 6 commits into
masterfrom
copilot/split-recording-json-test-utils
May 13, 2026
Merged

Split recording_json helpers and add kitty extended-key integration tests#33
HalFrgrd merged 6 commits into
masterfrom
copilot/split-recording-json-test-utils

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

Summary

  • extracted shared integration-test helpers from tests/recording_json.rs into tests/common/mod.rs
  • added Command key alias support in script parsing (mapped to Super/Meta)
  • added src/bin/kitty_key_debug.rs, a crossterm-based helper that enables kitty keyboard enhancements, clears the screen between events, prints counter=<n> key={:?} using the full KeyEvent debug representation, and exits on unmodified q without printing that key event
  • removed fixed key-event limit handling from kitty_key_debug so it runs until explicit quit (q)
  • added tests/kitty_extended_keys.rs integration coverage for kitty extended key protocol events including Press Command, Release Command, Ctrl+Enter, and modifier combos
  • updated kitty integration assertions to match full KeyEvent debug output strings (instead of custom key-code formatting)
  • updated the kitty integration script to terminate by pressing q, and added an assertion that q is not printed

Validation

  • cargo test --all-targets
  • cargo test --test kitty_extended_keys
  • cargo test script::parser::tests::parses_key_aliases_modifier_only_and_actions
  • parallel_validation (Code Review passed; CodeQL timed out due tool time budget)

Copilot AI and others added 3 commits May 13, 2026 07:36
Comment thread src/bin/kitty_key_debug.rs Outdated
kind: &'static str,
}

fn decode_key(seq: &[u8]) -> KeyInfo {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to use crossterm events feature flags. The you can just use event poll to get a KeyEvent and print that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in c5ac71d: kitty_key_debug now uses crossterm event::poll + event::read and prints from KeyEvent directly. No UI screenshot (CLI/test-only change).

Comment thread tests/kitty_extended_keys.rs Outdated
"expected key debug app readiness"
);
assert!(
haystack.contains("codepoint=13") && haystack.contains("mods=CTRL"),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the kitty debug binary clear the screen before printing new stuff. And it should print a counter next to the key code debug.
And we should search in the haystack for the full string e.g. "key code(enter, modifiers=Ctrl) counter=3"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in c5ac71d: the debug binary now clears the screen before printing each new key event, includes a per-event counter, and tests now assert full strings (e.g. key code(enter, modifiers=Ctrl) counter=3). No UI screenshot (CLI/test-only change).

Copilot AI requested a review from HalFrgrd May 13, 2026 08:18
Copy link
Copy Markdown
Owner

@HalFrgrd HalFrgrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't try and make a custom format, just use the debug representation of the KeyEvent. Print the keyEvent not just key code.
Update the tests to so they look for this format instead of our custom one

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 13, 2026

Don't try and make a custom format, just use the debug representation of the KeyEvent. Print the keyEvent not just key code.
Update the tests to so they look for this format instead of our custom one

Implemented in 105b8e3: kitty_key_debug now prints the full KeyEvent debug value (counter=… key={:?}) instead of custom formatting, and tests/kitty_extended_keys.rs now matches that debug-format output. Screenshot: N/A (CLI/test output change only).

Copilot AI requested a review from HalFrgrd May 13, 2026 10:34
Copy link
Copy Markdown
Owner

@HalFrgrd HalFrgrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't have a limit on the number of keys to expect.
Pressing q without any modifiers should exit the application. We should not print anything to screen when we press q.
Make the test script press q when it is finished.

Agent-Logs-Url: https://github.com/HalFrgrd/evp/sessions/202ed8ef-5208-4300-b6a3-b75fe57cb4ca

Co-authored-by: HalFrgrd <4559349+HalFrgrd@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 13, 2026

Don't have a limit on the number of keys to expect.
Pressing q without any modifiers should exit the application. We should not print anything to screen when we press q.
Make the test script press q w...

Implemented in 1726ada: removed the fixed key-event limit, plain unmodified q now exits immediately without printing, and the integration tape now ends by pressing q with an assertion that no q event appears in output. Screenshot: N/A (CLI/test-only change).

Copilot AI requested a review from HalFrgrd May 13, 2026 10:45
@HalFrgrd HalFrgrd marked this pull request as ready for review May 13, 2026 17:10
@HalFrgrd HalFrgrd merged commit 36ddb0b into master May 13, 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.

2 participants