Skip to content

3: Zustand for pushes#9275

Open
camd wants to merge 5 commits intomasterfrom
camd/zustand-for-pushes
Open

3: Zustand for pushes#9275
camd wants to merge 5 commits intomasterfrom
camd/zustand-for-pushes

Conversation

@camd
Copy link
Collaborator

@camd camd commented Mar 2, 2026

This completes migration to Zustand from Redux by converting pushes handling.

camd and others added 3 commits March 1, 2026 11:52
…t Router v6 hooks

Migrate 6 class components that still used props.location/props.navigate to
functional components using useLocation()/useNavigate() hooks directly. Also
fix bugs in Health.jsx: leaked notificationsId interval, undefined
this.props.history reference in filter(), and references to undefined methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Health and MyPushes now call useLocation/useNavigate internally,
so the test wrappers that passed these as props are no longer needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… migration

- Fix perfherder nav links broken by v7_relativeSplatPath (use absolute paths)
- Fix ErrorMessages using reactstrap Alert props (isOpen/toggle -> show/onClose/dismissible)
- Fix intermittent-failures Layout missing updateState prop from MainView and BugDetailsView
- Remove dead history/location propTypes from Layout
- Fix nested <a> tags in Breadcrumb components (use href/linkAs props instead)
- Replace reactstrap listClassName with className on Breadcrumb
- Remove dead location/navigate props passed from withValidation HOC
- Fix Victory flyoutComponent passing non-DOM props to <div>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@camd camd self-assigned this Mar 2, 2026
@camd camd changed the title Camd/zustand for pushes 3: Zustand for pushes Mar 2, 2026
camd and others added 2 commits March 1, 2026 18:14
- Phase 1: Migrate notifications store to Zustand
  * Create notificationStore.js with notify action
  * Update all components to import from new store

- Phase 2: Migrate pinnedJobs store to Zustand
  * Create pinnedJobsStore.js with pinned jobs and pin board visibility
  * Update PinBoard, DetailsPanel, and related components

- Phase 3: Migrate selectedJob store to Zustand (PRESERVING CRITICAL FIXES)
  * Create selectedJobStore.js with job selection logic
  * IMPORTANT: Preserve URL-first architecture from camd/fix-job-click-clear-bug:
    - selectJobViaUrl() for URL-first job selection
    - clearJobViaUrl() for clearing via URL
    - syncSelectionFromUrl() for syncing state from URL
    - wasJobJustSelected() to prevent race condition when clicking jobs
  * These functions ensure:
    - Jobs scroll into view on page load
    - Legacy selectedJob URL parameter is supported
    - Clicking different jobs no longer closes the details panel
  * Remove Redux connect from PushJobs (now uses Zustand directly)
  * Update PushList and DetailsPanel to use new store

Note: Phase 4 (push store migration) is NOT included in this commit.
The push store remains in Redux to minimize risk and preserve stability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Complete the Redux-to-Zustand migration by converting the last remaining
store (pushes). This removes all Redux dependencies from the project.

- Create Zustand pushesStore with all state, actions, and async thunks
- Update 16 consumer components to use usePushesStore hooks
- Wrap class components (ActionBar, PerformanceTab, CustomJobActions)
  with function components to inject Zustand state as props
- Remove Redux Provider, configureStore, and redux/ directory
- Remove redux, react-redux, redux-thunk, redux-debounce, redux-mock-store
- Update all 23 test files to use Zustand setState/getState patterns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@camd camd force-pushed the camd/zustand-for-pushes branch from 792c0cc to 6cf03c0 Compare March 2, 2026 02:32
@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 57.40473% with 883 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.36%. Comparing base (d43d586) to head (6cf03c0).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
ui/perfherder/graphs/GraphsView.jsx 0.87% 226 Missing ⚠️
ui/infra-compare/InfraCompareTableView.jsx 2.81% 69 Missing ⚠️
ui/perfherder/tests/TestsView.jsx 2.98% 65 Missing ⚠️
ui/job-view/details/tabs/SimilarJobsTab.jsx 5.88% 64 Missing ⚠️
ui/job-view/stores/selectedJobStore.js 61.03% 53 Missing and 7 partials ⚠️
ui/shared/InternalIssueFiler.jsx 5.35% 53 Missing ⚠️
ui/job-view/stores/pinnedJobsStore.js 48.97% 42 Missing and 8 partials ⚠️
ui/job-view/details/PinBoard.jsx 78.30% 46 Missing ⚠️
ui/push-health/Health.jsx 68.59% 38 Missing ⚠️
ui/shared/BugFiler.jsx 80.76% 35 Missing ⚠️
... and 16 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9275      +/-   ##
==========================================
- Coverage   82.76%   82.36%   -0.41%     
==========================================
  Files         609      608       -1     
  Lines       34293    34389      +96     
  Branches     3233     3293      +60     
==========================================
- Hits        28383    28324      -59     
- Misses       5785     5934     +149     
- Partials      125      131       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants