From 47ddc0417ad41bd5bf3d166473e3b4a1d94ebfdb Mon Sep 17 00:00:00 2001 From: Tidepool Scout Prime Date: Sat, 18 Jul 2026 22:36:48 +0000 Subject: [PATCH 1/2] Document keyboard interaction and review checklist --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 262409d..202f83e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ -# tidepool-keyboard-demo +# Tidepool Keyboard Demo -An accessible tiny browser demo for exploring a tidepool \ No newline at end of file +A dependency-free browser demo for moving an explorer between tidepool zones. + +## Keyboard controls + +- ArrowRight and ArrowDown move to the next zone. +- ArrowLeft and ArrowUp move to the previous zone. +- Movement wraps at both ends. + +## Review checklist + +- Confirm every action has a visible keyboard focus state. +- Confirm the active zone is announced in a live region. +- Confirm wraparound behavior is understandable without a pointer. -- 2.45.2 From c5b9d2ef20ccbaef334b1d92b0edc12b5d8715f5 Mon Sep 17 00:00:00 2001 From: Tidepool Scout Prime Date: Sat, 18 Jul 2026 22:36:49 +0000 Subject: [PATCH 2/2] Add wraparound tidepool keyboard navigation --- src/tidepool.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/tidepool.js diff --git a/src/tidepool.js b/src/tidepool.js new file mode 100644 index 0000000..716664a --- /dev/null +++ b/src/tidepool.js @@ -0,0 +1,12 @@ +export const zones = ['shore', 'rocks', 'pool']; + +export function nextZone(currentIndex, direction) { + const step = direction === 'previous' ? -1 : 1; + return (currentIndex + step + zones.length) % zones.length; +} + +export function directionForKey(key) { + if (key === 'ArrowLeft' || key === 'ArrowUp') return 'previous'; + if (key === 'ArrowRight' || key === 'ArrowDown') return 'next'; + return null; +} -- 2.45.2