SIGN IN SIGN UP

refactor: convert product-tours from Redux to React Query (#1968)

Replace the `tours` Redux slice with React Query for server state and a
React context for the client UI flags (OEP-0067):

- data/apiHooks.ts: useTourData (useQuery) + useEndCourseHomeTour /
  useEndCoursewareTour (useMutation); data/queryKeys.ts keyed by username
- TourContext.tsx: mirrors the former slice's show-flags via useReducer
- ProductTours.jsx / LaunchCourseHomeTourButton.jsx read from the query +
  context instead of Redux; TabPage supplies TourProvider
- remove the tours reducer from store.ts and setupTest.js; delete
  data/{slice,thunks,index}.js

Preserve the original show/hide behavior: invalidateQueries on the end-tour
mutations keeps the cache in sync with the PATCH, and refetchOnWindowFocus:
false prevents a focus refetch from reopening a tour mid-session.

Update tests that render the tour tree to supply TourProvider and, for the
suites that hand-build their tree with RTL render, a QueryClientProvider.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
B
Brian Smith committed
a3ce0af59d9a9fca2ce57336e1750d087ac2ce05
Parent: 49b102a
Committed by GitHub <noreply@github.com> on 8/7/2026, 6:29:17 AM