feat(cursor): add a step path easing so a caret jumps instead of gliding - #183
Merged
Conversation
cursor draws a caret — a rounded vertical bar — and cursor_style is metadata today: "default" and "pointer" render identically. But every path_easing it offered interpolated, so a caret walking between two text fields slid across the gap and spent most of its time outside any of them. A text caret never does that: it holds a position and jumps. `step` holds the departure waypoint for the whole segment; the move happens when time reaches the next waypoint and the segment changes. The interpolating easings are unchanged and stay the default — this is additive, for the case the component's own shape implies. SKILL.md documents the new value, and says plainly that the component draws a caret and that cursor_style does not change the drawing.
LeadcodeDev
force-pushed
the
feat/cursor-step-easing
branch
from
August 12, 2026 12:49
ffced7b to
5f59ffa
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.
What
cursordraws a caret — a rounded vertical bar.cursor_styleis metadata today:"default"and"pointer"render identically, as the source already notes.Every
path_easingit offered interpolated (linear,ease_out,ease_in_out), so a caret moving between two text fields slid across the gap and spent most of the transition outside any field. A text caret never does that — it holds a position and jumps.Why it cannot be worked around in a scenario
auto_path_offsetinterpolates with a Catmull-Rom whose tangent readswaypoints[seg_idx + 2]. On a segment whose two endpoints are the same point — the obvious way to express "hold this position" — that neighbour still bends the curve:So the caret swings ~30 px backwards before returning, mid-hold. Expressing a hold-then-jump without this easing takes four identical waypoints per stop — twelve for three fields — plus reasoning about
click_durationshort-circuiting the intermediate segments. That is a lot of scenario to say "don't interpolate".stepsetst = 0.0, andcatmull_rom(0, …)returnsp1exactly whatever its neighbours are, so it is immune to this by construction.How
CursorPathEasing::Stepholds the departure waypoint for the whole segment; the move happens whentimereaches the next waypoint and the segment changes. One match arm, no change to the existing easings, which stay the default — this is additive.Tests
stepholds the first waypoint across the segment and lands on the nextlinearstill interpolates (the addition does not change existing behaviour)"step"parses from JSON in snake_caseDocs
SKILL.mdlists the new value, and now says plainly that the component draws a caret and thatcursor_styledoes not change the drawing — the table previously described it as "cursor appearance style", which reads as though it did.cargo test --workspacegreen,cargo fmt --checkandcargo clippy --all-targetsclean.