Skip to content

Conversation

@LianaHarris360
Copy link
Member

@LianaHarris360 LianaHarris360 commented Feb 10, 2026

Summary

This pull requests adds a confirmation modal to AssignCourseSidePanel so that while selecting and assigning a course, accidentally clicking outside of the panel won't close the side panel.

closeconfirmationmodal.mp4

References

Closes #14140

Reviewer guidance

  1. Go to Coach > Courses and attempt to assign a course.
  2. Click outside of the side panel to see the confirmation modal.

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend SIZE: small labels Feb 10, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

@pcenov
Copy link
Member

pcenov commented Feb 11, 2026

Hi @LianaHarris360, here are some issues I was able to identify while manually testing:

  1. When I click the 'Assign course' button the page becomes unresponsive. There are no errors in the console. If I navigate back to the 'Courses' page I can see that the course is listed in the table:
cannot.assign.course.mp4
  1. The modal should not appear when the user hasn't made any changes. This is the existing behavior at Lessons, Quizzes and Users:
no.changes.mp4

The same should be valid if the user decides to click the 'Cancel' button if they haven't made any selections. If they have made any selection and they chose to click the Cancel button I think we should still show the confirmation modal.

  1. Perhaps it should be further discussed what should be the label, text and buttons of the modal, as currently for the other places we are using this one:
areusure

@pcenov pcenov self-requested a review February 11, 2026 12:05
import { CoursesModals, PageNames } from '../../../../constants';
import { overrideRoute } from '../../../../utils';
import useAssignCourse from '../../composables/useAssignCourse';
import CloseConfirmationGuard from '../../../../../../facility/frontend/views/users/common/CloseConfirmationGuard.vue';
Copy link
Member

Choose a reason for hiding this comment

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

While we could reuse this, I think for the sake of wording/UX consistency within Coach (to some of Peter's comments), it might be easier to just use a KModal and repurpose the strings that we have in a few places.

There are definitely a few places where the logic is a little bit convoluted and more complicated 🙃 but, you can look here, as one example for reference.

The logic of the conditions for closing the side panel will also probably be a bit different, but looking at this may also give some ideas to address Peter's feedback around the checks, and confirming that some changes have been made.

Copy link
Member Author

Choose a reason for hiding this comment

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

I made a new, similar component within kolibri/plugins/coach/frontend/views/courses/modals/, reusing how the previous CloseConfirmationGuard modal used ref and beforeRouteLeave because the side panel pushes to a different route to close it, but I fixed the console errors and updated the strings used to keep the same UX consistency in Coach, so the feedback has been handled now.

…osing without confirmation when selections are made
@pcenov
Copy link
Member

pcenov commented Feb 12, 2026

Hi @LianaHarris360, I confirm that the reported issues are fixed. Now there are just the following scenarios to be handled too:

  1. The confirmation modal is not shown if I have selected a radio button at 'Select course to assign' while it should because I have made a selection:
2notshown.mp4
  1. The confirmation modal appears if I have made a selection at 'Select recipients' and then clicked the back arrow. In that case it should not appear, as the user is technically still editing things and should be able to go back and see the selected course:
no.confirmation.needed.mp4

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: medium SIZE: small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants