Skip to content

Refactor debug filter from useEffect to Redux middleware#44

Merged
SCdF merged 2 commits intomainfrom
refactor-debug-middleware
Jan 20, 2026
Merged

Refactor debug filter from useEffect to Redux middleware#44
SCdF merged 2 commits intomainfrom
refactor-debug-middleware

Conversation

@SCdF
Copy link
Owner

@SCdF SCdF commented Jan 20, 2026

Summary

  • Move debug filter initialization from useEffect to Redux store initialization time
  • Add debugMiddleware to sync state changes to localStorage and debugModule
  • Remove DebugManager component entirely (no longer needed)

This eliminates the anti-pattern of dispatching state updates in effects for derived state that should be computed at init time.

Test plan

  • Verify debug filter persists across page reloads
  • Verify changing debug filter via Redux devtools updates localStorage
  • Verify app initializes correctly with/without stored debug filter

🤖 Generated with Claude Code

SCdF and others added 2 commits January 20, 2026 19:13
Move debug filter initialization and sync logic out of DebugManager's
useEffect and into Redux middleware. This eliminates the anti-pattern of
dispatching state updates in effects that should be computed at init time.

- Initialize debug state from localStorage at store creation
- Use debugMiddleware to sync state changes to localStorage/debugModule
- Remove DebugManager component (no longer needed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Empty string "" is falsy but was not handled by the middleware - only
null was explicitly checked. Now treat any falsy value as a clear.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@SCdF SCdF enabled auto-merge January 20, 2026 19:27
@SCdF SCdF merged commit f18cc15 into main Jan 20, 2026
2 checks passed
@SCdF SCdF deleted the refactor-debug-middleware branch January 20, 2026 19:27
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.

1 participant