Skip to content

Bridge domain edits to shared universe state#15

Merged
SnorreFossland merged 1 commit into
alpha-prefrom
codex/shared-universe-domain-reads
Jun 3, 2026
Merged

Bridge domain edits to shared universe state#15
SnorreFossland merged 1 commit into
alpha-prefrom
codex/shared-universe-domain-reads

Conversation

@SnorreFossland

Copy link
Copy Markdown
Contributor

Summary

This follow-up slice keeps the domain migration moving after PR #14.

It bridges UPDATE_DOMAIN_PROPERTIES through the shared universe adapter so edits to project/domain details update state.universe.world.worldDefinition.domain as well as the legacy phData.domain reducer path.

Changes

  • Added setUniverseDomain to the shared universe reducer.
  • Mapped legacy UPDATE_DOMAIN_PROPERTIES through toSharedUniverseAction.
  • Wrapped the Project component dispatch with bindLegacyUniverseDispatch so domain edits reach shared state.
  • Removed an unused props.phData.domain read from ProjectMenuBar.

Notes

The legacy reducer still owns compatibility updates to phData.domain. This PR only ensures the shared universe tree remains synchronized during domain edits.

Remaining expected legacy references are compatibility paths in:

  • src/reducers/reducer.js
  • src/components/utils/workspaceUniverseAdapter.ts

Validation

  • npm run build
  • npm test
  • Local browser smoke check: /project loaded successfully on localhost:3000, showed the domain UI, and browser console had no errors.

@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mimris Ready Ready Preview, Comment Jun 3, 2026 4:11pm

@SnorreFossland SnorreFossland marked this pull request as ready for review June 3, 2026 16:19
Copilot AI review requested due to automatic review settings June 3, 2026 16:19
@SnorreFossland SnorreFossland merged commit afaaab1 into alpha-pre Jun 3, 2026
2 checks passed
@SnorreFossland SnorreFossland deleted the codex/shared-universe-domain-reads branch June 3, 2026 16:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for legacy domain property updates by introducing a dedicated Redux action and reducer logic to merge domain patches into the shared universe state.

Changes:

  • Added setUniverseDomain action and reducer handling to update worldDefinition.domain.
  • Introduced mergeDomainPatch helper to shallow-merge domain objects.
  • Mapped legacy UPDATE_DOMAIN_PROPERTIES action to the new shared-universe action via toSharedUniverseAction, and updated dispatch usage in Project.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/sharedUniverse/universeSlice.ts Adds domain patch merge helper, new action, and reducer branch to update worldDefinition.domain.
src/sharedUniverse/legacyDispatch.ts Maps legacy UPDATE_DOMAIN_PROPERTIES to setUniverseDomain.
src/components/loadModelData/ProjectMenuBar.tsx Removes unused domain local variable.
src/components/Project.tsx Wraps React Redux dispatch with bindLegacyUniverseDispatch to translate legacy actions.

Comment on lines +47 to +63
const mergeDomainPatch = (domain: unknown, patch: unknown) => {
if (
domain &&
patch &&
typeof domain === 'object' &&
typeof patch === 'object' &&
!Array.isArray(domain) &&
!Array.isArray(patch)
) {
return {
...(domain as Record<string, unknown>),
...(patch as Record<string, unknown>),
};
}

return patch;
};

export const setUniverseState = createAction<SharedUniverseState>('universe/setUniverseState');
export const setUniversePhData = createAction<LegacyPhData>('universe/setUniversePhData');
export const setUniverseDomain = createAction<unknown>('universe/setUniverseDomain');
...state.world,
worldDefinition: {
...state.world.worldDefinition,
domain: mergeDomainPatch(state.world.worldDefinition.domain, action.payload),
Comment on lines +21 to +22
const rawDispatch = useDispatch();
const dispatch = bindLegacyUniverseDispatch(rawDispatch);
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