Skip to content

Read model page from shared universe state - #19

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

Read model page from shared universe state#19
SnorreFossland merged 1 commit into
alpha-prefrom
codex/model-page-shared-universe

Conversation

@SnorreFossland

Copy link
Copy Markdown
Contributor

Summary

  • Read the model page's phData, phFocus, phUser, and phSource values from the shared universe slice first, with legacy connected props as fallback.
  • Pass a legacy-shaped compatibility prop object into Modelling so GoJS/AKMM internals can remain unchanged for this slice.
  • Route header labels, save eligibility, remote save payloads, user display, and render checks through the shared-first values.

Verification

  • npm run build passed.
  • npm test passed.
  • Browser smoke loaded /model?universeSlug=4-enterprise-modeling-generic&universeApi=http%3A%2F%2Flocalhost%3A3001&metisScope=world-model without runtime or console errors. Full remote model rendering still depends on the universe API server on port 3001 being available.

@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 5:37pm

@SnorreFossland
SnorreFossland marked this pull request as ready for review June 3, 2026 17:37
Copilot AI review requested due to automatic review settings June 3, 2026 17:37
@SnorreFossland
SnorreFossland merged commit c29dd31 into alpha-pre Jun 3, 2026
3 checks passed

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

This PR updates the /model Next.js page to prefer phData, phFocus, phUser, and phSource from the shared universe slice (via selectSharedUniverseState), while preserving legacy Redux-connected props as a fallback so existing GoJS/AKMM internals can continue to operate with a legacy-shaped props object.

Changes:

  • Read model page state from selectSharedUniverseState first, with legacy prop fallback, and derive header labels / render gating from the shared-first values.
  • Construct a “legacy-compatible” props object (compatibilityProps) and pass it into Modelling to keep downstream expectations unchanged.
  • Route remote-save eligibility and remote save payloads through the shared-first ph* values.

Comment thread src/pages/model.tsx
Comment on lines 414 to 418
const username = typeof data?.username === 'string' && data.username
? data.username.charAt(0).toUpperCase() + data.username.slice(1)
: 'Guest';
dispatch(setUniverseUser({ ...props.phUser, focusUser: { name: username } }));
dispatch(setUniverseUser({ ...phUser, focusUser: { name: username } }));
} catch (error) {
Comment thread src/pages/model.tsx
Comment on lines +48 to 50
const workspaceMeta = getWorkspaceSnapshotMeta(phUser);
const activeMetisScope = normalizeMetisScope(workspaceMeta?.activeMetisScope);
const metisAvailability = describeMetisAvailability(workspaceMeta?.snapshot);
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