Accessibility: keyboard move entry and screen reader support (#72) (#115)

* commented out lesson and learning strip until lessons are established

* reword the hero section

* change layout and working on puzzle section - remove top div as it was
redundant

* amend flash message on replay

* switch cancel session for return home

* remove system theme toggle since this is the default, leaving only light
and dark toggles

* add keyboard and screen reader support for play (#72)

First draft covering the accessibility work in #72:\n\n- labelled SAN/UCI move input, validated against the tablebase and applied\n  by the board hook, plus an accessible promotion picker\n- live-region announcements for moves, checks, checkmates and solve/fail,\n  and a hidden text summary of the position\n- accessible labels, focus ring, skip link, keyboard-friendly review table\n  and non-colour grade cues\n- WCAG AA text contrast roles and a responsive play surface\n- regression tests for move entry, announcements and link-style CTAs
This commit is contained in:
2026-11-09 12:09:07 +01:00
committed by GitHub
parent 8df7ac982c
commit 805c2f1150
31 changed files with 812 additions and 136 deletions
+15 -1
View File
@@ -23,10 +23,12 @@ defmodule ChesstrainerWeb.EndgameLive.Play do
<span>FEN: {@endgame.fen}</span>
<button
id="copy-fen-btn"
type="button"
phx-hook="CopyFen"
data-fen={@endgame.fen}
class="inline-flex items-center cursor-pointer"
class="inline-flex items-center justify-center rounded p-1.5 cursor-pointer"
title="Copy FEN to clipboard"
aria-label="Copy FEN to clipboard"
>
<.icon name="hero-document-duplicate" class="w-3.5 h-3.5" />
</button>
@@ -44,6 +46,7 @@ defmodule ChesstrainerWeb.EndgameLive.Play do
<PlayComponents.play_surface
endgame={@endgame}
fen={@fen}
status={@status}
blocked_reason={@blocked_reason}
best_move={@best_move}
@@ -56,6 +59,10 @@ defmodule ChesstrainerWeb.EndgameLive.Play do
awaiting_reply={@awaiting_reply}
last_grade={@last_grade}
awaiting_best_line={@awaiting_best_line}
move_input={@move_input}
move_input_error={@move_input_error}
last_check={@last_check}
last_checkmate={@last_checkmate}
/>
<div :if={@user_rating} class="mb-4">
@@ -76,6 +83,13 @@ defmodule ChesstrainerWeb.EndgameLive.Play do
def handle_event("endgame_move_played", params, socket),
do: PlayCore.move_played(socket, params)
def handle_event("submit_move", params, socket), do: PlayCore.submit_move(socket, params)
def handle_event("move_input", params, socket), do: PlayCore.move_input_changed(socket, params)
def handle_event("move_input_error", params, socket),
do: PlayCore.move_input_error(socket, params)
def handle_event("opponent_reply_applied", params, socket),
do: PlayCore.opponent_reply_applied(socket, params)