"Allow public read" switch: no success toast, and the error toast has no Retry

Open Beginner friendly
#3,311 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
Half a day
Newbie friendliness
74/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript
Domain
frontend

Research direction

Start in src/library-authoring/components/PublicReadToggle.tsx, in onChangeToggle, where showToast is currently called only in the .catch. Show a success toast once the PATCH to /api/libraries/v2/<lib>/ resolves, and add a Retry action to the error toast built from publicReadToggleDefaultError, using Paragon Toast's action prop. Done when a successful flip shows a confirmation and a failed one offers Retry that resends the same change.

Written by the indexing model from the issue text.

Description

The library sidebar's "Allow public read" switch (src/library-authoring/components/PublicReadToggle.tsx, added in #2942) gives no confirmation when a change succeeds. Flipping it sends PATCH /api/libraries/v2/<lib>/, which answers 200, and the switch moves, but no toast or other message appears.

The acceptance criteria in openedx/openedx-authz#239 ("US: M2.9 Toggle reuse content library") ask for:

  • the control disabled with a saving state while saving: done (disabled={… || isPending});
  • a success toast on success: missing. onChangeToggle only calls showToast in the .catch;
  • on error, an error message with a Retry action: partly done. The error toast (publicReadToggleDefaultError) has no Retry.

Impact: this switch changes who across the instance can view and reuse the library's content. The person flipping it gets no confirmation that it took, and if it fails they must find the switch again to retry.

Expected: show a success toast after the mutation resolves, and add a Retry action to the error toast (Paragon Toast supports an action), as #239 describes.

Environment: Tutor main, 2026-09-22. Code as on master 2026-10-13. Found by the Open edX end-to-end test suite (BTR TC-00575).

Dominant language
TypeScript
Stars
18
Forks
228
Avg merge
2d 5h
Merged PRs (30d)
24

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openedx/frontend-app-authoring

All issues in openedx/frontend-app-authoring

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.