fix(analyse): position review mistakes button under active POV and use explicit side labels by kaushalrog · Pull Request #22095 · lichess-org/lila · GitHub
Skip to content

fix(analyse): position review mistakes button under active POV and use explicit side labels - #22095

Draft
kaushalrog wants to merge 7 commits into
lichess-org:masterfrom
kaushalrog:fix/learn-mistakes-explicit-side
Draft

kaushalrog wants to merge 7 commits into
lichess-org:masterfrom
kaushalrog:fix/learn-mistakes-explicit-side

Conversation

@kaushalrog

Copy link
Copy Markdown
Contributor

Summary of Changes

This PR improves the analysis board UX and accessibility when reviewing mistakes:

  1. Button Positioning (Fixes “Learn from your mistakes” button is displayed under White even when reviewing Black #21946): Previously, the retrospective review CTA button was statically positioned between the White and Black summaries in roundTraining.ts, making it always appear underneath White even when viewing the board from Black's perspective. It is now positioned directly beneath the player summary matching the active board orientation (bottomColor).
  2. Explicit Side Labels (Fixes Make the side explicit when starting “Learn from your mistakes” #21947): Replaces generic "Learn from your mistakes" text with explicit side labels ("Review white's mistakes" / "Review black's mistakes") using existing i18n.site.reviewWhiteMistakes and i18n.site.reviewBlackMistakes across the summary CTA, the action menu, the retro box header, and the NVUI blind-mode view.
  3. Accessibility: Adds role="button" and an explicit aria-label to the review button so screen readers announce the exact target side.

Related Issues

AI Contribution Disclosure

… summary

Fixes lichess-org#21946. The 'Learn from your mistakes' CTA was previously hardcoded
directly between the White and Black summaries, making it appear underneath
White even when viewing from Black's perspective and reviewing Black's mistakes.
Now render the button directly beneath the summary corresponding to bottomColor.
Fixes lichess-org#21947. Rather than showing generic 'Learn from your mistakes', label
the action 'Review white\'s mistakes' or 'Review black\'s mistakes' based
on current board orientation / POV, clarifying whose moves are being reviewed.
Reflect the specific side being reviewed in the retro box header title
('Review white\'s mistakes' / 'Review black\'s mistakes') instead of generic
'Learn from your mistakes'.
The action menu button for launching retrospective review now explicitly
states which side's mistakes will be analyzed, matching the active orientation.
Keep blind-mode / NVUI accessibility toggle consistent with the rest of
the analysis UI by announcing 'Review white\'s mistakes' or 'Review black\'s mistakes'.
Centralize the logic for determining the localized retrospective review
action string based on color to prevent duplication across views.
…ew button

Add aria-label and role='button' attributes to the review mistakes
anchor button to ensure screen readers unambiguously announce the action
and target side.
@ornicar ornicar added the AI AI-generated (substantially or wholly) label Oct 19, 2026
@ornicar

ornicar commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

@ornicar
ornicar marked this pull request as draft October 19, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI AI-generated (substantially or wholly)

Projects

None yet

2 participants