SIGN IN SIGN UP

refactor: convert course-home CTA toast from Redux to a React ToastProvider (#1982)

The shared TabPage read the call-to-action toast from the courseHome Redux
slice, so no course-home tab could be de-Redux'd while the toast stayed in
Redux. This extracts it end to end (part of #1946, Phase 3):

- Toast client state -> a new React ToastProvider/useToast context
  (src/generic/ToastContext.tsx), mounted at the route root. Message and
  visibility are decoupled (setToastContent vs openToast/closeToast), removing
  the slice's show={!!toastHeader} content/visibility fusion. TabPage renders
  the single <Toast> from the context.
- The two POST writers that feed it -> React Query mutations in
  src/course-home/data/apiHooks.ts (useResetDeadlines, usePostEvent), following
  the product-tours mutation pattern. The hooks own only the POST + toast and
  carry no Redux; the transitional model-store refresh stays in each caller's
  mutate onSuccess (dispatch(getTabData)) until that data is RQ, keeping
  apiHooks.ts Redux-free.
- Deletes the resetDeadlines/processEvent thunks (and the index.js re-export)
  and the setCallToActionToast reducer + toast fields from the slice. The
  processEvent postMessage parse/guard moves into useIFrameBehavior.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
B
Brian Smith committed
fe9b4544d80bdb297e84f4562ebfbb0c5882506f
Parent: 9566831
Committed by GitHub <noreply@github.com> on 8/11/2026, 4:11:36 PM