Skip to content

Update: Rework popup aria labels for Previous and Next (fixes #315)#369

Open
swashbuck wants to merge 2 commits into
masterfrom
issue/315
Open

Update: Rework popup aria labels for Previous and Next (fixes #315)#369
swashbuck wants to merge 2 commits into
masterfrom
issue/315

Conversation

@swashbuck

@swashbuck swashbuck commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #315

Update

  • Popup Previous/Next aria labels now utilize isAtStart/isAtEnd instead of the presence of an item title. So a middle item with an empty title still announces its position (e.g. "Previous (item 2 of 3)") instead of falling back to a bare "Previous"/"Next".
  • When looping (_canCycleThroughPagination), isAtStart/isAtEnd are forced false. The buttons never disable and always wrap, so the active item is never treated as the start or end and the item count is always announced.
  • Schemas updated with the new defaults.
  • Aligns the label logic with adapt-contrib-narrative (PR #311).
  • Added a migration to update the previous/next globals on existing courses, but only where the value still equals the old default. Author customizations are preserved.

Testing

  1. Hot Graphic popup, looping off:
    • First item: Previous = plain "Previous" (disabled); Next = "item 2 of N".
    • Last item: Next = plain "Next" (disabled); Previous = "item N-1 of N".
  2. Clear a middle item's title: Previous/Next still announce "(item N of M)" rather than the bare label.
  3. Enable _canCycleThroughPagination: buttons never disable, wrap correctly, and always announce the item count (including at the first/last item).
  4. Verify with a screen reader (VoiceOver/NVDA).
  5. Migration: grunt migration:test passes (28/28).

Posted via collaboration with Claude Code

Key Previous/Next aria labels off isAtStart/isAtEnd instead of the
presence of an item title, so a middle item with an empty title still
announces its position. When looping (_canCycleThroughPagination),
isAtStart/isAtEnd are forced false since the buttons never disable and
always wrap. Aligns with adapt-contrib-narrative.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…315)

Update the popup previous/next aria-label globals from the old
title-keyed default to the new isAtStart/isAtEnd default, but only when
the value still equals the old default so author customizations are kept.
Uses @@CURRENT_VERSION/@@RELEASE_VERSION placeholders.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@kirsty-hames kirsty-hames left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected thanks @swashbuck - tested with voiceOver Safari on Mac 👍

@swashbuck
swashbuck requested review from ethan-lp and lemmyadams July 17, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Reviewing

Development

Successfully merging this pull request may close these issues.

Rework popup aria labels for Previous and Next

3 participants