Skip to content

Add aria-valuetext to the epub viewer progress slider - #15431

Merged
rtibbles merged 2 commits into
learningequality:developfrom
rishiraj38:fix/14623-epub-slider-valuetext
Oct 5, 2026
Merged

rtibbles merged 2 commits into
learningequality:developfrom
rishiraj38:fix/14623-epub-slider-valuetext

Conversation

@rishiraj38

@rishiraj38 rishiraj38 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The EPUB reader's progress slider had no aria-valuetext, so screen readers announced the raw range value (for example "23") instead of a reading position. This binds aria-valuetext to the same locale-formatted percentage shown beside the slider, through a shared progressText computed, so no new translation string is needed.

It also fixes a related mismatch found in review: when a slider change landed the book on the page already shown, the range input kept the stepped value while sliderValue did not change, so the thumb and the announced percentage disagreed. The renderer now counts relocations and passes the count to the bottom bar, which sets the input from sliderValue whenever the count changes. The input keeps the user's value while the jump is in flight and is put back in step once the relocation settles, without recreating the element, so keyboard focus stays on the slider.

References

Fixes #14623

Reviewer guidance

  • BottomBar.spec.js asserts aria-valuetext for sliderValue 23 ("23%") and 100 ("100%"), and, rendered through a parent as in EpubRendererIndex, that a changed input keeps its value until relocationCount changes, is reset to sliderValue when the relocation leaves sliderValue unchanged, and moves to a new sliderValue when the book moves. The reset case fails without the watcher. EpubRendererIndex.spec.js checks relocatedHandler bumps relocationCount on every call, including one that leaves sliderValue unchanged. All 88 epub_viewer Jest tests pass.
  • Dragging is unaffected: the input is only touched when a relocation lands.
  • To check in the browser: open an EPUB in Learn, focus the slider, press ArrowRight a few times. After each press the thumb, the percentage label and the Accessibility pane's "Value description" in Chrome DevTools should agree, including on books where a press does not turn the page. Focus should stay on the slider.

AI usage

I used Claude Code to add the binding, prompting it to reuse the $formatNumber call the visible label already uses so screen readers announce the same value sighted users see. I had it write the failing spec cases first, reviewed them, and verified they pass with the change along with the epub_viewer tests and the prek hooks. I also used it to work through the review comments: tracing why the input kept its stepped value, adding the relocation count and its specs, which I reviewed and ran.

Screen readers announced the raw slider value; they now read the same
locale-formatted percentage shown next to the slider.
@rishiraj38
rishiraj38 requested review from a team and rtibbles September 30, 2026 04:08
@github-actions github-actions Bot added DEV: renderers HTML5 apps, videos, exercises, etc. DEV: frontend SIZE: very small labels Sep 30, 2026
@learning-equality-bot

Copy link
Copy Markdown
Contributor

👋 Hi @rishiraj38, thanks for contributing!

For the review process to begin, please verify that the following is satisfied:

  • Contribution is aligned with our contributing guidelines

  • Pull request description has correctly filled AI usage section & follows our AI guidance:

    AI guidance

    State explicitly whether you didn't use or used AI & how.

    If you used it, ensure that the PR is aligned with Using AI as well as our DEEP framework. DEEP asks you:

    • Disclose — Be open about when you've used AI for support.
    • Engage critically — Question what is generated. Review code for correctness and unnecessary complexity.
    • Edit — Review and refine AI output. Remove unnecessary code and verify it still works after your edits.
    • Process sharing — Explain how you used the AI so others can learn.

    Examples of good disclosures:

    "I used Claude Code to implement the component, prompting it to follow the pattern in ComponentX. I reviewed the generated code, removed unnecessary error handling, and verified the tests pass."

    "I brainstormed the approach with Gemini, then had it write failing tests for the feature. After reviewing the tests, I used Claude Code to generate the implementation. I refactored the output to reduce verbosity and ran the full test suite."

📢✨ Before we assign a reviewer:

  • @rtibblesbot will pre-review this pull request. Its comments are generated by an LLM, and should be evaluated accordingly.
  • We'll also invite community pre-review. See the community review guidance for both authors and reviewers.

Also check that issue requirements are satisfied & you ran pre-commit locally.

Pull requests that don't follow the guidelines will be closed.

Reviewer assignment can take up to 2 weeks.

📎 We couldn't find an issue linked to this pull request. Please edit the description and link one under References, for example Fixes #123 or Closes #123. A plain #123 mention doesn't link the PR to the issue.

@learning-equality-bot

Copy link
Copy Markdown
Contributor

📢✨ Before we assign a reviewer, we'll turn on @rtibblesbot to pre-review. Its comments are generated by an LLM, and should be evaluated accordingly.

@rtibblesbot

rtibblesbot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Waiting for changes

Last updated: 2026-10-01 23:11 UTC

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

@rtibblesbot rtibblesbot 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.

PR #15431 meets both acceptance criteria: aria-valuetext reuses the visible label's $formatNumber call, and the spec asserts two values.

  • suggestion: valuetext can disagree with the input's own value after a key step that lands on the current page (inline).
  • nitpick: duplicated format expression (inline).

CI pending. Manual QA (page turns, Home/End/arrows, TOC/search jumps, resume, ar/fa/fr-fr): valuetext matched the visible label except in the case above. axe showed no slider violations. Its 2 other violations predate this PR.


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?

Ran a phased review pipeline over the pull request diff:

  • Classified the diff to select review passes (core, frontend, backend) and whether manual QA was required
  • Core review pass checked correctness, design, architecture, testing, completeness, and DRY/SRP/Rule-of-Three principles
  • Specialized frontend/backend review passes applied framework-specific lenses where those files changed
  • For UI changes: manual QA and an accessibility audit against a live dev server, when available
  • Checked CI status and linked issue acceptance criteria
  • Synthesized one review from those passes and chose the verdict from the findings, CI status, and QA evidence

When a slider change lands the book on the page already shown, the range
input keeps the stepped value but sliderValue does not change, so the
input is not re-rendered and the thumb disagrees with the label and
aria-valuetext. Count relocations in the renderer and pass the count to
the bottom bar, which sets the input from sliderValue whenever the count
changes. The input keeps the user's value while the jump is in flight.

Also move the percentage formatting into a computed so the visible label
and aria-valuetext share it.

@rtibblesbot rtibblesbot 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.

PR #15431: both prior findings resolved. No new findings. CI pending.

Prior-finding status

RESOLVED — kolibri/plugins/epub_viewer/frontend/views/BottomBar.vue — valuetext disagrees with input value after a no-op key step
RESOLVED — kolibri/plugins/epub_viewer/frontend/views/BottomBar.vue — duplicated format expression


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?

Ran an automatic code-only delta review triggered by new commits on a previously reviewed PR:

  • Retrieved prior bot reviews via the GitHub API
  • Classified each prior finding as RESOLVED, UNADDRESSED, ACKNOWLEDGED, or CONTESTED
  • Only raised NEW findings for newly introduced code
  • Core review pass only — specialized frontend/backend lenses and manual QA run when a review is explicitly requested
  • Synthesized one review from the passes and chose the verdict from the findings, CI status, and QA evidence

@rtibbles rtibbles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes make sense, will ask QA to verify the fix.

@rtibbles rtibbles self-assigned this Oct 2, 2026
@radinamatic

Copy link
Copy Markdown
Member

Thank you @rishiraj38 , good work, ebook reader progress bar now has the proper aria-valuetext! 👏🏽

Win10 (start)  Running  - Oracle VirtualBox_051

@radinamatic radinamatic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Manual QA passes, good to go! 💯 :shipit: 🚀

@rtibbles
rtibbles merged commit 16ebd97 into learningequality:develop Oct 5, 2026
119 of 120 checks passed
@rishiraj38

Copy link
Copy Markdown
Contributor Author

Thanks @rtibbles for the reviews and @radinamatic for testing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DEV: frontend DEV: renderers HTML5 apps, videos, exercises, etc. SIZE: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[epub_viewer] Progress slider is missing aria-valuetext

4 participants