Skip to content

3: Zustand for pushes#9275

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

3: Zustand for pushes#9275
camd wants to merge 2 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 camd self-assigned this Mar 2, 2026
@camd camd changed the title Camd/zustand for pushes 3: Zustand for pushes Mar 2, 2026
@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 65.87423% with 445 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.24%. Comparing base (f724147) to head (c3b2151).

Files with missing lines Patch % Lines
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/shared/BugFiler.jsx 80.76% 35 Missing ⚠️
ui/job-view/KeyboardShortcuts.jsx 61.62% 33 Missing ⚠️
ui/job-view/stores/pushesStore.js 89.21% 22 Missing ⚠️
ui/job-view/details/tabs/SideBySideVideo.jsx 8.69% 21 Missing ⚠️
ui/job-view/details/tabs/AnnotationsTab.jsx 18.18% 18 Missing ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9275      +/-   ##
==========================================
- Coverage   82.40%   82.24%   -0.16%     
==========================================
  Files         610      609       -1     
  Lines       34633    34526     -107     
  Branches     3338     3217     -121     
==========================================
- Hits        28538    28396     -142     
- Misses       5970     5999      +29     
- 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.

camd and others added 2 commits March 8, 2026 10:12
- 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 6cf03c0 to c3b2151 Compare March 8, 2026 17:18
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