Part of #1946 — Redux → React Query migration (Stage 1). Part of the #1976 courseware decomposition (plan) — Target 2 (outline sidebar), peel. Stacked on the sequence conversion.
Goal: convert checkBlockCompletion to a React Query mutation.
Why its own layer: it's the courseware requestCert — a shared writer that patches both the units model (complete) and the sidebar's courseware.courseOutline completion rollups (updateCourseOutlineCompletion), and it has two consumers in different layers (CoursewareContainer on unit render, and the outline sidebar on unit click). Peeling it below both consumers keeps them from fighting over completion state once the sidebar is also React-Query-backed.
Tasks
- Convert
checkBlockCompletion → useMutation; on success update the units cache (via the bridge) and the outline cache (setQueryData, replacing updateCourseOutlineCompletion).
- Preserve the "already complete → no-op" short-circuit.
Verify: completing a unit updates the unit indicator and the sidebar completion rollups (incl. the courseOutlineShouldUpdate refetch trigger for locked sequences).
Scoped-but-light; a full plan gets added when this is picked up.
Part of #1946 — Redux → React Query migration (Stage 1). Part of the #1976 courseware decomposition (plan) — Target 2 (outline sidebar), peel. Stacked on the sequence conversion.
Goal: convert
checkBlockCompletionto a React Query mutation.Why its own layer: it's the courseware
requestCert— a shared writer that patches both theunitsmodel (complete) and the sidebar'scourseware.courseOutlinecompletion rollups (updateCourseOutlineCompletion), and it has two consumers in different layers (CoursewareContaineron unit render, and the outline sidebar on unit click). Peeling it below both consumers keeps them from fighting over completion state once the sidebar is also React-Query-backed.Tasks
checkBlockCompletion→useMutation; on success update theunitscache (via the bridge) and the outline cache (setQueryData, replacingupdateCourseOutlineCompletion).Verify: completing a unit updates the unit indicator and the sidebar completion rollups (incl. the
courseOutlineShouldUpdaterefetch trigger for locked sequences).Scoped-but-light; a full plan gets added when this is picked up.