Cover the timeline's vertical keyboard navigation - #211
Merged
Conversation
The single-tab-stop track ships six key branches; the tests exercised ArrowRight, Enter and Home. The lane math — ArrowDown/ArrowUp jumping to the first bar of the neighbouring lane, guarded by the findIndex empty-lane check — was the least obvious part and the only part with no test at all, and ArrowLeft/End were uncovered too. Three cases close that: a vertical press lands on the other lane's bar and comes back, a press past the outermost lane leaves the roving pointer where it was, and End/ArrowLeft reach both ends.
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.
OpsTimeline's single-tab-stop track (onTrackKeyDown) carries six key branches. The existing test exercisedArrowRight,EnterandHome— leaving the most logic-heavy part untested:ArrowDown/ArrowUpcompute a neighbouringlaneIndexand jump vianavBars.findIndex(b => b.laneIndex === lane)behind afirst !== -1guard.ArrowLeftandEndwere uncovered as well.Tests only, no production change:
ArrowDownmovesaria-activedescendantto the other lane's bar,ArrowUpreturns.Endreaches the last bar,ArrowLeftsteps back.Run:
npx vitest run src/__tests__/components/operations/OpsTimeline.test.tsx→ 47 passed.The low-severity note from the issue (the always-empty
activeBars.filterspread innavBars) is deliberately left alone — it is a cosmetic simplification, not a defect, and it does not belong in a test-coverage PR.Closes #199