-
-
Notifications
You must be signed in to change notification settings - Fork 36
feat: interactive Recording with PTY and Hotkeys #316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
…tors - also restructure threading and messaging so that we can broadcast events between threads (e.g. screenshots) Signed-off-by: Sven Kanoldt <[email protected]>
Enable cleaner architecture by splitting into workspace with skylight-osd crate for on-screen display functionality.
0e1b555 to
c9d0388
Compare
Signed-off-by: Sven Kanoldt <[email protected]>
- also add a README.md explaining a quickstart and the API and the examples - fix glitch with one particular but random white border showing up Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
0307c39 to
dc85c53
Compare
…new abstraction Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
…se backend internals in the prelude module Signed-off-by: Sven Kanoldt <[email protected]>
- Add layout module (Padding, Margin, Border, BoxModel) - Add style module (Paint, TextStyle) - Add background() and corner_radius() to OsdFlashBuilder - Add examples: battery, equalizer, radar, sierpinski - Fix canvas trait to use ref parameters - Fix content bounds and center positioning
- Add a keyframe based API to the OsdWindowBuilder - interpolates numerical values of color and scale between the phases of keyframes - has change detection based on object order in the keyframe "drawing" - based on the the architecture at `.planning/osd-flash-animation-architecture.md` the documentation is on a module level at `crates/osd-flash/src/animation/mod.rs` - Add a pulsing animation example (crates/osd-flash/examples/recording_indicator_pulse.rs) - todo: there is a small flickering, so we explore if double buffering from CALayer might help us
Add `osd-flash-indicator` feature flag (enabled by default) that: - Uses dual cfg guard (target_os + feature) for proper platform handling - Falls back to NoopPresenter when disabled or on non-macOS - Removes osd-flash from dependency tree when disabled This provides a rollback strategy if OSD issues arise: cargo build --release --no-default-features Also adds --no-default-features CI testing to verify rollback path.
… animations Signed-off-by: Sven Kanoldt <[email protected]>
ede5dd5 to
6f0d864
Compare
…ngs for the core-animation examples Signed-off-by: Sven Kanoldt <[email protected]>
- we are just about to overhaul osd-flash and simplify it greatly Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
f4d7a9a to
98f3401
Compare
Signed-off-by: Sven Kanoldt <[email protected]>
98f3401 to
e089d8d
Compare
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
4e20078 to
2980a2d
Compare
Signed-off-by: Sven Kanoldt <[email protected]>
3cd50a1 to
aebeb5d
Compare
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
901e44b to
5717775
Compare
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
7f7c3d5 to
5f63b5c
Compare
Tests failed on CI because the stop timer started before capture began. On slow CI machines, timeout expired before all frames were captured. TestApi now sends Stop when the last frame is returned, removing timing dependency entirely.
- Remove duplicate show_recording_indicator() call in presenter - Move RecordingStarted event from countdown loop to fire once after countdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
…rate to objc2- crates for t-rec Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
Signed-off-by: Sven Kanoldt <[email protected]>
Replace anyhow with custom Error enum for better API stability: - Add Error::NotOnMainThread for thread safety violations - Add Error::NoScreenAvailable for missing display - Replace panics with proper error propagation in apply_position
This commit removes osd-flash and its integration to allow splitting the feature branch into two PRs: 1. crossterm-input-interception (this branch) 2. osd-flash-for-screenshots (separate branch) Removed: - crates/osd-flash/ directory - osd-flash workspace member - osd-flash-indicator feature from t-rec - OSD presenter integration code - test_flash CLI arg
Signed-off-by: Sven Kanoldt <[email protected]>
Increase the idle threshold from 50ms to 500ms to avoid timing-related flakiness on CI where thread scheduling can vary. Also relax the assertion to check for >= 2 frames rather than >= 3, as the test only needs to verify that frames within the threshold are preserved.
| use super::*; | ||
|
|
||
| #[test] | ||
| fn test_event_router() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing that's broadcasting is really working so two receivers in one test is needed
- Move Wallpaper, WallpaperConfig, WallpaperError, ValidatedPath from types.rs to new wallpapers/types.rs module - Add validate_wallpaper_dimensions() for DynamicImage validation - Add resolve_wallpaper() as main entry point for loading/validating - Update is_builtin_wallpaper() to use Wallpaper::builtin_values() as single source of truth - Simplify validate_wallpaper_config() in main.rs (~50 to ~15 lines) - Replace tuple (Wallpaper, u32) with WallpaperConfig in headless.rs - Make wallpapers module public in lib.rs
Interactive Recording with PTY and Hotkeys
Replaces the simple subprocess shell with a PTY-based architecture and adds keyboard hotkeys for in-session control.
Changes
PTY shell spawning
nix::pty::openpty)Keyboard hotkeys via crossterm
Event-driven actor model
EventRoutercoordinates capture, input, shell output, and presenter actorstokio::sync::broadcastfor inter-actor communicationRecording countdown
On-screen visual feedback (macOS, optional)
Headless recorder library API
libfeatureHeadlessRecorderfor programmatic recording of any window to GIF/MP4Decor,BackgroundColor,Wallpaperenums)Lazy logging
t-rec-recording.log) only created when something is loggedStructure
Reorganized as a Cargo workspace:
crates/t-rec— CLI and library