Skip to content

Fold App's radial store reach into push-down Containers#356

Merged
rulkens merged 16 commits into
mainfrom
spec/react-store-containers
Jun 20, 2026
Merged

Fold App's radial store reach into push-down Containers#356
rulkens merged 16 commits into
mainfrom
spec/react-store-containers

Conversation

@rulkens

@rulkens rulkens commented Jun 19, 2026

Copy link
Copy Markdown
Owner

What & why

App.tsx was the single radial subscriber to the Redux store — ~25 useAppSelector calls + ~24 dispatches funnelled down as props (SettingsPanel alone took ~40). Any one selector firing re-rendered App and cascaded through the entire HUD.

This folds that reach into push-down Container components (a pattern borrowed from the repperjs reference impl): each container subscribes to only its slice at its own boundary, so a store change re-renders just that subtree. A point-size drag now re-renders only the Galaxies section, a label toggle only Labels, a debug checkbox only DebugPanel.

Purely structural — no Redux state shape change, no engine change, no behaviour change.

What shipped

  • 9 containers in src/components/containers/, each memo'd and subscribing only to its own slice: AutoRotateToggleContainer, DebugPanelContainer, TierChipContainer, and the 6 SettingsPanel section containers (Galaxies / CosmicWeb / Flow / Structures / Labels / Display).
  • SettingsPanel: ~880-line, ~40-prop monolith → 109-line presentational shell (zero store reach) composing the section containers.
  • RenderTogglesSection is now fully presentational — the codebase's last leaf-level store reach is gone.
  • App dropped from ~25 selectors + ~24 dispatches to exactly 5 selectors (the three it reads in its own JSX + the two useStructureMemberCount needs).

Convention (new src/components/containers/README.md)

  • <Name>Container renders <Name> (presentational, minus "Container").
  • Container owns all store reach; presentational pairs import nothing from store//state/ (grep-verified).
  • Uniform memo idiom: import { memo } from 'react'export default memo(ComponentName). Memo is load-bearing here, not polish — it's what stops an unrelated App re-render cascading through the containers.

Provenance

Spec + plan ride this PR (lead commits): docs/superpowers/specs/2026-06-19-react-store-containers-design.md, docs/superpowers/plans/2026-06-19-react-store-containers.md.

Testing

  • 2819/2819 tests pass, npm run typecheck clean, npm run build succeeds.
  • Each of 11 tasks passed a two-verdict (spec + quality) review; a whole-branch review on the most-capable model returned ready to merge, zero Critical/Important.
  • Behaviour verified byte-equivalent on the riskiest extractions: the three tri-state masters, the cosmic-web Style-picker batching, and the Labels 3-way dispatch narrowing (structure → milkyWay → galaxy-catalog).

🤖 Generated with Claude Code

rulkens and others added 14 commits June 19, 2026 12:45
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…onal

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…bel dispatch)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ection containers

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ctors)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
skymap a235b35 Commit Preview URL

Branch Preview URL
Jun 20 2026, 09:27 AM

rulkens and others added 2 commits June 20, 2026 02:25
…ainers

# Conflicts:
#	src/components/App/App.tsx
DoD audit READY: 2890 tests pass, typecheck + build clean. All nine
containers + presentational pairs + SettingsPanel shell shipped; zero
leaf-level store reach; no createSelector introduced; README documents
the convention. App's selector set matches the plan plus the two
selection-display reads the #350 selection-into-store merge moved into
App (noted in the DoD).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rulkens rulkens merged commit 4a7970c into main Jun 20, 2026
2 checks passed
@rulkens rulkens deleted the spec/react-store-containers branch June 20, 2026 09:33
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