Skip to content

Cover the timeline's vertical keyboard navigation - #211

Merged
Sev7eNup merged 1 commit into
mainfrom
test/ops-timeline-keyboard-lanes
Aug 15, 2026
Merged

Cover the timeline's vertical keyboard navigation#211
Sev7eNup merged 1 commit into
mainfrom
test/ops-timeline-keyboard-lanes

Conversation

@Sev7eNup

Copy link
Copy Markdown
Owner

OpsTimeline's single-tab-stop track (onTrackKeyDown) carries six key branches. The existing test exercised ArrowRight, Enter and Home — leaving the most logic-heavy part untested: ArrowDown/ArrowUp compute a neighbouring laneIndex and jump via navBars.findIndex(b => b.laneIndex === lane) behind a first !== -1 guard. ArrowLeft and End were uncovered as well.

Tests only, no production change:

  • lane-wise movementArrowDown moves aria-activedescendant to the other lane's bar, ArrowUp returns.
  • the empty-neighbour guard — a press past the outermost lane leaves the roving pointer where it was, in both directions. Without the guard the pointer clears and keyboard focus lands nowhere.
  • both endsEnd reaches the last bar, ArrowLeft steps 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.filter spread in navBars) is deliberately left alone — it is a cosmetic simplification, not a defect, and it does not belong in a test-coverage PR.

Closes #199

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.
@Sev7eNup
Sev7eNup merged commit be31a2b into main Aug 15, 2026
9 checks passed
@Sev7eNup
Sev7eNup deleted the test/ops-timeline-keyboard-lanes branch August 15, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR-Review #194: OpsTimeline vertical keyboard-navigation branches ship untested

1 participant