feat: add cursor blink animation to embedded terminal#380
Merged
Conversation
Owner
Author
PR Review SummaryCritical Issues (1 found)
Important Issues (3 found)
Strengths
VerdictNEEDS FIXES — 1 critical (timer race), 3 important (duplication, misleading comment, silent error swallowing) Recommended Actions
|
Add a 530ms on/off cursor blink to the kild-ui terminal. The blink timer lives in TerminalView using an epoch-based invalidation pattern: each keystroke resets the blink so the cursor stays solid while typing. Unfocused cursors remain static (no blinking). Also fix pre-existing unused imports in git/health.rs (moved test-only imports into #[cfg(test)] module). Closes #314
- Extract duplicated blink timer loop into `spawn_blink_timer()` method - Split catch-all `_ => break` into explicit `Ok(false)` (stale epoch) and `Err(e)` (view dropped) arms with debug-level tracing - Fix misleading "thin bar" comment to accurately describe cursor_visible vs has_focus responsibility split
9daea28 to
3e5f60a
Compare
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.
Summary
Implementation
terminal_view.rs: Addedcursor_visible,blink_epoch,_blink_taskfields. Spawns blink timer infrom_terminal().reset_blink()called on every keystroke.terminal_element.rs: Addedcursor_visibleparameter. Skips cursor preparation in prepaint when hidden.git/health.rs: Fixed pre-existing clippy error (moved test-only imports into#[cfg(test)])Test plan
cargo fmt --check && cargo clippy --all -- -D warningspassescargo test --allpasses (1676 tests, 0 failures)cargo build --allsucceedsCloses #314