Skip to content

Keep focus on the Attempt select while a chosen attempt loads - #15644

Open
rtibblesbot wants to merge 2 commits into
learningequality:developfrom
rtibblesbot:issue-15607-18cbfd
Open

rtibblesbot wants to merge 2 commits into
learningequality:developfrom
rtibblesbot:issue-15607-18cbfd

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Choosing a try no longer unmounts the "Attempt" select
  • Coach sets pageLoading only for a new learner, lesson or exercise
  • Late responses for an earlier choice are ignored

References

Fixes #15607.

Reviewer guidance

Suggested review: Full code review, then manual QA once the reviewer sets Needs QA.

  • User-visible files changed: kolibri/plugins/coach/frontend/app.js, kolibri/plugins/coach/frontend/modules/exerciseDetail/handlers.js, packages/kolibri-common/components/quizzes/QuizReport/index.vue.
  • Confirm both lesson exercise report routes may skip the shared coach router.beforeEach: try, question and interaction switches no longer refresh the class summary, and entering the report by Back/Forward no longer clears the snackbar.
  • Confirm a module-level pendingLoad in exerciseDetail/handlers.js is an acceptable pattern for discarding superseded learner loads.
  • On both coach lesson exercise reports and the learn practice-quiz report, choosing another attempt by keyboard and by mouse should leave focus on the "Attempt" select.
  • Developer check: after a keyboard switch, document.activeElement is the select.
  • Open risk: the select can now show before the first try finishes loading.

QA team: changing "Attempt" in a coach lesson exercise report keeps focus on "Attempt" and shows no page loader. Back, Forward and learner changes carry the most risk.

Requires: a lesson with "Skeletal Structure - Practice" (Kolibri QA Channel > Courses > Hummingbird Biology > Anatomy & Physiology > Skeletal Structure). A learner completes it twice, then starts again.

  1. Change the attempt: open the lesson > exercise > learner. Change "Attempt" by keyboard and mouse. No page loader shows. Does focus stay on "Attempt"?
  2. Back, Forward, reload: open the lesson > "Learners" > learner > exercise. Change "Attempt", click Back and Forward, then reload. The report shows the try in the address.
  3. Change the learner: open a second learner. Click Back and Forward quickly. The tries belong to the learner in the heading.
  4. Data states: one try shows no "Attempt". Address "try/9" shows an empty "Attempt"; choose an attempt and it loads.
  5. Learn practice quiz: as a learner, submit "Test on the details" (Kolibri QA Channel > Exercises > Practice quizzes > Chapter 1 > Unit 1) twice. Change "Attempt" by keyboard. Focus stays on "Attempt".

Evidence

Change the attempt

s1-switch-tries-mouse-keyboard.webm

Back and Forward

s2-select-switch-and-history.webm

Reload

Step Screenshot
Super admin: try 2, "Question 5" Super admin: try 2, "Question 5"

Change the learner

learner-switch-back-forward.webm

Data states

Step Screenshot
One try: no "Attempt" One try: no "Attempt"
"try/9": empty "Attempt" "try/9": empty "Attempt"
More captures (4)
Step Screenshot
Older try, "Question 3" Older try, "Question 3"
Coach reload: try 2 Coach reload: try 2
Not started Not started
"try/9", then try 1 chosen "try/9", then try 1 chosen

AI usage

Claude Code traced the focus loss to the slot's loading gate and wrote the fix and specs. Verified with Jest specs that fail without the fix, the existing QuizReport and QuizRenderer suites, and prek.


Written by rtibblesbot, an LLM-based coding agent.

@rtibblesbot

🟡 Waiting for feedback

Last updated: 2026-10-30 06:01 UTC

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

@rtibblesbot
rtibblesbot marked this pull request as ready for review October 22, 2026 06:25
@rtibblesbot
rtibblesbot requested review from a team and leq-bot October 22, 2026 06:25
@rtibblesbot
rtibblesbot force-pushed the issue-15607-18cbfd branch 2 times, most recently from b62449d to ba24b43 Compare October 26, 2026 04:40
@github-actions github-actions Bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Oct 26, 2026
</template>

<template
v-if="!loading"

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.

Why don't we need the loading check here anymore? Has this been handled elsewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It moved down to CurrentTryOverview (line 80), the only part of the subheader that reads currentTry.

  • The KSelect only needs pastTries, which loadAllTries fetches separately, so it renders correctly while the chosen try loads. With the old gate it was unmounted at that point, and focus dropped to <body>.
  • Searched the template for other loading gates: there are 3. The aside (line 90) and the #main loader (line 108) only wrap try-dependent content, never the control that has focus, so I left them as they were.
  • index.spec.js covers the select staying mounted and focused while the try loads, and the overview staying hidden until that try arrives.

rtibblesbot and others added 2 commits October 30, 2026 05:42
Choosing another attempt unmounted the select, dropping focus to <body>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The coach router guard set pageLoading and awaited a class summary
refresh on every navigation to the exercise learner report, unmounting
the page and dropping focus from the Attempt select. The report routes
now skip the guard; generateExerciseDetailHandler loads class info and
sets pageLoading itself when the learner, lesson or exercise changes.
Otherwise it commits the try, question and interaction at once, without
refetching the exercise, so the report never shows the old try's stats.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend SIZE: large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Choosing another attempt in a coach exercise report drops keyboard focus

2 participants