Add vim-style key bindings and timer scrubbing#29
Conversation
|
Hey there, thanks for the PR :) Changing skip from But I have a few issues with how increase decrease keys are implemented in this PR: Firstly, Increase is now limited to the initial duration only, which is not the behavior I want. I'd like to be able to extend it beyond initial duration when needed. Secondly, this will inaccurate stats to the db, since adding extra time is currently implemented by subtracting from elapsed time rather than actually extending the session. The same issue applies to decrease as well, since it will count more time than what was actually spent. I've actually decided against adding a decrease key in the past in 5aace8bd, mainly because it adds calculation issues and edge cases. Looking at it again now though, I might reconsider it if implemented correctly. |
Key binding changes
j/↓— new: decrease timer by 1 minutek/↑— existing up arrow, now also bound tok(vim up)h/←— existing left/reset, now also bound toh(vim left)l/→— skip was previouslys, now aligned to vim right (l+ arrow key)All four vim directional keys (
h j k l) now map to the four timer controls, making the bindings consistent for vim users.Timer scrubbing behaviour
Previously,
↑extended the session by adding toduration. The new approach modifieselapsedinstead, which correctly drives both the countdown display and the progress bar:j/↓): advanceselapsedby 1 minute. Clamps toduration - 1swhen less than a minute remains, so the timer reaches00:01and finishes naturally rather than getting stuck.k/↑): retreatselapsedby 1 minute. Clamps to0when already near the start, restoring the full session time.