Skip to content

[FE] Confirm every deletion of a tag association from the Competency Management page #786

In review
openedx/frontend-app-authoring
#3389

Description

@thelmick-unicon

User Story

As a course author, I want to confirm before I remove a competency's association with content, so I understand this action cannot be undone from this screen and that learners keep the mastery they have already earned.

Acceptance Criteria

Scenario: Deleting an association asks for confirmation first
  Given an author is viewing a competency's content associations
  When they delete one
  Then a confirmation is shown
    And the association is not yet removed

Scenario: The confirmation names what is removed and what happens to learners
  Given an author is deleting the association between "5 Whys + Fishbone Deep Dive" and the competency "Inference"
  When the confirmation is shown
  Then its title asks "Remove 5 Whys + Fishbone Deep Dive from Inference?"
    And its message ends with "This can't be undone from this screen. Learners keep any mastery status they already have."
    And its only buttons are Cancel and Remove
    And the author does not have to type anything to confirm

Scenario: Confirming removes the association from the page
  Given the confirmation is shown for an association
  When the author chooses Remove
  Then the association is removed from the page

Scenario: Cancelling leaves the association in place
  Given the confirmation is shown for an association
  When the author chooses Cancel
  Then the association is still listed
    And nothing is sent to the server

Scenario: The confirmation reads the same whatever happens underneath
  Given two associations, one that learner mastery depends on and one that does not
  When the author deletes each
  Then the same confirmation wording is shown for both

Scenario: Removing a competency's last association in a course warns that the course may be closed to that competency
  Given "5 Whys + Fishbone Deep Dive" is the only content in its course that is associated with the competency "Inference"
  When the author deletes that association
    And the confirmation is shown
  Then its message also says "After this removal, no content in this course is associated with Inference. If learners already have a mastery status for Inference from this course, Inference can't be associated with content in this course again."

Scenario: Removing a Rule Group or rule box that holds a competency's last associations in a course warns that the course may be closed to that competency
  Given removing a Rule Group or a rule box would leave no content in its course associated with the competency "Inference"
  When the author deletes that Rule Group or rule box
    And the confirmation is shown
  Then its message also says "After this removal, no content in this course is associated with Inference. If learners already have a mastery status for Inference from this course, Inference can't be associated with content in this course again."

Scenario: Removing a Course Group always warns that the course may be closed to that competency
  Given a course author viewing the rules of the competency "Inference"
  When they choose Remove from Inference from the ⋮ menu on a Course Group
    And the confirmation is shown
  Then its message also says "After this removal, no content in this course is associated with Inference. If learners already have a mastery status for Inference from this course, Inference can't be associated with content in this course again."

Scenario: No course-closing warning is shown while the course keeps other associations with the competency
  Given two pieces of content in the same course are associated with the competency "Inference"
  When the author deletes one of those associations
    And the confirmation is shown
  Then its message does not include the warning that Inference can't be associated with content in this course again

Scenario: A deletion that fails does not appear to have succeeded
  Given the author has chosen Remove in the confirmation
  When the request fails
  Then the confirmation stays open, with an error message at its top
    And the association is still listed
    And choosing Remove again retries the deletion
    And no success message is shown

Scenario: The confirmation is usable by keyboard and screen reader
  When the confirmation is shown
  Then focus moves into it
    And its message and buttons are announced
    And it can be dismissed from the keyboard

Scenario: Both entry points that directly remove one association show the confirmation
  Given a course author viewing a competency's rule box
  When they click the "X" on an already-associated subsection's chip in the Browse Courses panel, or the "X" on that same association's item in the box's Selected Content list
  Then the confirmation is shown either way

Scenario: Deleting a whole Rule Group or Course Group shows the confirmation too
  Given a course author viewing a competency's rules
  When they choose Remove group from the ⋮ menu on a saved Rule Group, or Remove from [competency] from the ⋮ menu on a Course Group
  Then the confirmation is shown
    And the group and everything beneath it is not yet removed

Scenario: Deleting a whole rule box shows the confirmation too
  Given a course author viewing a competency's rule box that has saved content
  When they choose Remove rule from the rule box's ⋮ menu
  Then the confirmation is shown
    And none of the box's associations are removed yet

Scenario: Deleting an unsaved placeholder does not ask for confirmation
  Given a course author has added a Rule Group or rule box with no content in it yet
  When they choose Remove group or Remove rule from its ⋮ menu
  Then it is removed from the page immediately
    And no confirmation is shown

Figma Links:
Remove flow
Remove content dialog
Remove group dialog
Remove rule dialog
Remove failed

Screenshots:

Image Image Image Image

Description

Removing a competency's association with a piece of content on the Competency Management page happens immediately, with no confirmation. Underneath, that removal will either delete the association or archives it, depending on whether any learner has been evaluated through it, and the author is deliberately not told which.

This ticket adds the confirmation step. The wording and behavior come from the design spike #775. The backend behavior it triggers is #674 (delete one criterion) and #675 (delete a whole group).

Some removals close a course to a competency for good. When a removal takes the last content in a course that is associated with a competency, and learners already have a mastery status for that competency from that course, the server archives the competency's group for that course instead of deleting it. An archived course group accepts no new associations (#717), and archiving is permanent for MVP, so that competency can't be associated with content in that course again. The confirmation warns the author whenever a removal would leave a course with no content associated with the competency.

Four ways to delete an association on this page are in scope: the "X" on a chip in the Browse Courses panel, the "X" on a chip in a rule box's Selected Content list, Remove group or Remove from [competency] in the ⋮ menu, which deletes a whole Rule Group or Course Group (#709), and Remove rule in the ⋮ menu, which deletes a whole rule box (#833). A rule box is a display-only grouping of criteria that share one score threshold, not a persisted record, so #833 deletes it by removing each of its criteria. Deleting an unsaved placeholder Rule Group or rule box removes nothing on the server and shows no confirmation.

Technical Details

This section is background and a suggested approach, not the ticket's source of truth. The User Story and Acceptance Criteria define what must be true when the work is done.

In short

Why one wording covers both outcomes. The server decides whether to remove the association or archive it, based on whether learner mastery depends on it, and does not report which it did. So the dialog cannot describe the mechanism. It can say the action cannot be undone from this screen and that existing learner mastery is unaffected, both of which are true either way.

Why the last-association warning is conditional. The page can tell from the rules it has already loaded whether a removal leaves a course with no content associated with the competency. It cannot tell whether learners have a mastery status there, which is what decides whether the server archives the course group and closes the course to the competency. So the warning is shown based only on what the removal leaves in the course, and its second sentence starts with "If learners already have a mastery status". The warning reads the same whether or not learner mastery depends on the removed content, so the author is still not told which outcome occurred.

What the frontend sends is unchanged. Removal on this page goes through the #674 and #675 delete endpoints, and the archive-or-delete branch is entirely server-side in those endpoints. This ticket adds a confirmation in front of the existing request and changes nothing about the request itself.

The dialog and its wording come from the design spike #775. It is Studio's standard delete dialog, with no type-to-confirm. The title is a question that names what is removed and from which competency, for example "Remove 5 Whys + Fishbone Deep Dive from Inference?". The buttons are Cancel and Remove. The body ends with "This can't be undone from this screen. Learners keep any mastery status they already have."

There are two entry points to a direct association removal, confirmed against the actual Competency Management UI: the "X" on an already-associated subsection's chip in the Browse Courses panel, and the "X" on that same association's item in the rule box's own Selected Content list. Both must show the confirmation.

The third and fourth entry points are deleting a whole Rule Group or course section (#709) and deleting a whole rule box (#833). This ticket gates both with the same dialog, since each removes or archives every association beneath it. For a rule box, one confirmation covers all of the box's criteria, not one per criterion.

Implementation specifics

  • Gate the existing delete action on the Competency Management page's association list, from both entry points identified above (the Browse Courses panel chip and the box's Selected Content list item). Do not change the request, the endpoint, or the payload.
  • Also gate [FE] Delete Competency Course & Rule Groups #709's whole-group delete action and [FE] Delete a Competency Rule Box #833's whole-rule-box delete action, the same way. Same dialog, same wording, same "not yet removed until confirmed" behavior. Do not gate deleting an unsaved placeholder.
  • Use Studio's standard delete dialog, DeleteModal in src/generic/delete-modal/DeleteModal.tsx, with title, description, and btnLabel set to the [UXD Spike] Confirmation dialogs for competency criteria edits and deletes #775 wording above. It wraps Paragon's AlertModal, so focus trapping and announcement come for free. Don't use the taxonomy tag list's type-to-confirm dialog (src/taxonomy/tag-list/DeleteModal.tsx).
  • Do not report which outcome occurred, and do not add a request to find out whether learner mastery depends on the association. The author is deliberately not told.
  • Add the last-association warning from data already on the page. A removal gets the warning when, after it, the competency's Course Group for that course would hold no associations: the association is the Course Group's only one, the rule box holds all of them, the Rule Group holds all of them, or the Course Group itself is being removed. Compute this from the criteria groups response the page already has ([BE] GET Competency Criteria & Groups #681). Do not add a request for it. The wording is "After this removal, no content in this course is associated with [competency]. If learners already have a mastery status for [competency] from this course, [competency] can't be associated with content in this course again." with the competency's name in place of [competency].
  • On failure, keep the dialog open and let Remove retry. Render a Paragon Alert with variant="danger" at the top of the dialog body, and leave Remove enabled so pressing it again resends the request. Don't close the dialog or show a toast. DeleteModal doesn't close itself after onDeleteSubmit, so the caller closes it only when the request succeeds. Do not optimistically remove the association from the list before the request succeeds, or a failed delete will look like a successful one until the page is reloaded.
  • Tests: the delete action shows the dialog and sends nothing, from all four entry points; deleting an unsaved placeholder shows no dialog; confirming removes the association or the group; cancelling sends nothing and leaves it listed; the same wording is used regardless of the server's outcome or which entry point triggered it; the last-association warning is shown when the removal leaves the course with no associations for the competency, from each entry point, always for a Course Group, and not when other associations remain; a failed request keeps the dialog open with the danger Alert and leaves the association listed, and a second Remove retries; focus moves into the dialog and it is keyboard dismissible.
  • Out of scope: the edit confirmation ([FE] Confirm every edit to a competency criterion or criteria group #785), the design itself ([UXD Spike] Confirmation dialogs for competency criteria edits and deletes #775), the server-side archive-versus-delete branch ([BE] Delete Competency Criterion #674, [BE] Build endpoint for removing a Competency Criteria Group #675), and the Course Outline and Libraries pages, which are [FE] Hide tag removal and tag adding for competency tags on Course Outline #784.
  • Context [UXD Spike] Confirmation dialogs for competency criteria edits and deletes #775 is the design spike that produces this dialog's wording and behavior.
  • [BE] Delete Competency Criterion #674 and [BE] Build endpoint for removing a Competency Criteria Group #675 are the server-side branch this confirmation sits in front of.
  • [FE] Delete Competency Course & Rule Groups #709 specifies the whole-group delete action, and [FE] Delete a Competency Rule Box #833 the whole-rule-box delete action, that this ticket also gates.

The approved implementation approach on #655, for why the author is not told whether the association was removed or archived.

Activity

  1. moved this from Needs additional details to Ready for Community Review in Competency Criteria and Student Progresson Sep 14, 2026
  2. jmakowski1123 commented on Sep 21, 2026

    @jmakowski1123

    This is approved.

  3. moved this from Ready for Community Review to Final Axim Review in Competency Criteria and Student Progresson Sep 21, 2026
  4. moved this from In Progress to Unicon Code Review in Competency Criteria and Student Progresson Oct 29, 2026
  5. moved this from Unicon Code Review to Community Code Review in Competency Criteria and Student Progresson Nov 6, 2026
  6. mgwozdz-unicon commented on Nov 13, 2026

    @mgwozdz-unicon
    Contributor

    @illiphilli heads up that the requirements on this ticket are about to change, so AShatsila/frontend-app-authoring#15 will need an update.

    Dave pointed out in #879 (comment) that a removal can close a course to a competency for good but we don't mention it in the confirmation dialog. When a removal takes the last content in a course that is associated with a competency, and learners already have a mastery status for that competency from that course, the server archives the competency's group for that course. Once #717 merges, an archived course group rejects new associations, so that competency can't be associated with content in that course again. This is a limitation we're accepting for MVP.

    The proposed change is that the confirmation adds a warning whenever the removal would leave the course with no content associated with the competency. That covers removing the last single association, removing a Rule Group or rule box that holds the last associations, and removing a Course Group, which always warns. The page works this out from the criteria groups data it has already loaded, with no new request. The proposed wording is: "After this removal, no content in this course is associated with [competency]. If learners already have a mastery status for [competency] from this course, [competency] can't be associated with content in this course again."

    The ticket text is in review with Tammie in https://github.com/Unicon/unicon-openedx-ai-config/pull/107.

  7. illiphilli commented on Nov 18, 2026

    @illiphilli

    @mgwozdz-unicon the warning is in AShatsila/frontend-app-authoring#15 as of today, with the ticket's wording. It shows for the last single association, a Rule Group or rule box that holds the last associations, and always for a Course Group, all worked out from the groups the page has already loaded.

    I also dropped the "so that course will no longer count toward [competency]" sentences from the course, only-group and only-rule dialogs, since the warning covers those cases.

    The PR stays a draft until the 710 branch is rebased onto the squashed 709 (openedx/frontend-app-authoring#3364). I'll mark it ready after that.

  8. moved this from Community Code Review to In Progress in Competency Criteria and Student Progresson Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions