Use shared universe in simple page wrappers - #28
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates a set of “simple” Next.js page wrappers to stop injecting the entire Redux store via connect(state => state) and instead read the needed user/focus/metis state from the shared-universe selector boundary (selectSharedUniverseState). This aligns these wrappers with the newer shared-universe state shape and reduces broad state coupling.
Changes:
- Replaced
connect(state => state)usage withuseSelector(selectSharedUniverseState)inabout,table,videos, andakmm-graphqlpages. - Updated
Layoutuser wiring to pull fromsharedUniverse.userrather thanprops.phUser. - Removed whole-store
connectwrapping from these pages, relying on shared-universe selectors instead.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/pages/videos.tsx | Switches from connected whole-store props to selectSharedUniverseState for Layout user. |
| src/pages/table.tsx | Removes whole-store connect and reads focus/user via shared-universe selector. |
| src/pages/akmm-graphql.tsx | Replaces useSelector(state => state) + connect with shared-universe selector access for metis/user. |
| src/pages/about.tsx | Removes whole-store connect and reads focus/user via shared-universe selector. |
Comment on lines
+1
to
5
| import { useSelector } from 'react-redux'; | ||
| import Page from '../components/page'; | ||
| import Layout from '../components/Layout'; | ||
| import Link from 'next/link'; | ||
| import SelectVideo from '../components/SelectVideo' |
|
|
||
| // import { loadData } from '../actions/actions' | ||
|
|
||
| const page = (props: any) => { |
Comment on lines
6
to
10
| @@ -11,11 +9,16 @@ import Table from '../components/Table'; | |||
| import SetContext from '../defs/ContextView' | |||
| import TasksHelp from '../components/TasksHelp' | |||
| // const model = (metis) && metis.models[0] | ||
| const data = useSelector((state:any) => state) | ||
| const metis = (data.phData) && data.phData.metis | ||
| const sharedUniverse = useSelector(selectSharedUniverseState); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
about,table,videos,akmm-graphql) from whole-storeconnect(state => state)toselectSharedUniverseStateVerification
npm testnpm run build