Preserve remote Mimris model focus#33
Merged
Merged
Conversation
# Conflicts: # src/pages/model.tsx
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 the /model page flow and the remote-universe Metis proxy so that explicit “current model / focus” requests are preserved end-to-end, rather than being overridden by previously stored local Mimris state.
Changes:
- Adds a structured
RemoteMetisFocusQueryand forwards focus-related query params throughbuildRemoteMetisProxyPath(...)into the remote-universe Metis API proxy. - Updates
/modelroute building/updating to carry focus params, and skips restoringmemorystatewhen an explicit focus request is present. - Updates the Next.js API proxy endpoint to append the allowed focus query params to the remote Metis request URI.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/pages/model.tsx | Parses focus query params, forwards them through route updates and remote proxy fetches, and conditionally skips local memory restore. |
| src/pages/api/remote-universe/[universeSlug]/metis.ts | Forwards a whitelisted set of focus query params from the proxy request to the remote Metis endpoint. |
| src/components/utils/remoteUniverse.ts | Introduces RemoteMetisFocusQuery and extends the proxy-path builder to include focus query params. |
Comment on lines
+96
to
+102
| const hasRequestedRemoteMetisFocus = (focusQuery?: RemoteMetisFocusQuery) => | ||
| Boolean( | ||
| focusQuery?.modelScope === 'current' || | ||
| focusQuery?.currentModelRef || | ||
| focusQuery?.currentModelviewRef || | ||
| focusQuery?.currentMetamodelRef, | ||
| ); |
Comment on lines
+136
to
141
| const updateModelRoute = (options: { universeId?: string; universeSlug?: string; baseUrl?: string; metisScope?: string; focusQuery?: RemoteMetisFocusQuery }) => { | ||
| const nextRoute = buildModelRoute(options); | ||
| const currentPath = typeof window !== 'undefined' ? `${window.location.pathname}${window.location.search}` : router.asPath; | ||
| if (currentPath === nextRoute) return; | ||
| router.replace(nextRoute, undefined, { shallow: true, scroll: false }); | ||
| }; |
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
/modelroutes and remote Metis proxy calls.Verification
pnpm tsc --noEmitpassed in the active Mimris checkout before the clean branch was created.node_modules; directtsc --noEmitthere cannot run becausetscis not installed in that worktree.