Staging sync: fix canonical model refs and FBA detail loading#181
Merged
VibhavSetlur merged 3 commits intoModelSEED:stagingfrom May 5, 2026
Merged
Staging sync: fix canonical model refs and FBA detail loading#181VibhavSetlur merged 3 commits intoModelSEED:stagingfrom
VibhavSetlur merged 3 commits intoModelSEED:stagingfrom
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Syncs staging changes that correct how the UI resolves ModelSEED model/FBA references when loading model-linked data, and adds unit coverage for the updated API client behavior.
Changes:
- Add a new ModelSEED API client wrapper to fetch FBA “detail data” by
ref+fba_id(with 404 →nullsemantics). - Update the FBA detail page to prefer the new detail endpoint before falling back to the list endpoint / workspace fetch.
- Update the model detail page to use a “canonical” model ref for FBA/gapfill lookups.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| app/model/[...path]/page.tsx | Changes how the model ref used for FBA/gapfill API calls is derived (intended to be canonical). |
| app/fba/[...path]/page.tsx | Adds a first-attempt fetch of FBA detail data by fba_id before list/workspace fallbacks. |
| lib/api/modelseed.ts | Introduces getModelFbaDataFromApi(ref, fbaId) calling /api/models/fba/data. |
| tests/unit/api/modelseed-client.test.ts | Adds unit tests asserting query-string construction, decoding behavior, and 404 handling for the new wrapper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1441
to
+1448
| const modelApiRef = useMemo(() => { | ||
| // Only fetch model-linked data if we're on a specific model, not a folder. | ||
| const segments = workspacePath.split('/').filter(Boolean); | ||
| if (segments.length >= 3 && !workspacePath.toLowerCase().endsWith('/modelseed')) { | ||
| const modelPath = workspacePath.endsWith('/model') ? workspacePath : `${workspacePath}/model`; | ||
| return modelPath; | ||
| if (segments.length < 3 || workspacePath.toLowerCase().endsWith('/modelseed')) { | ||
| return null; | ||
| } | ||
| return null; | ||
| }, [workspacePath]); | ||
| return apiCandidates[0] ?? null; | ||
| }, [workspacePath, apiCandidates]); |
Comment on lines
+12
to
+19
| beforeEach(() => { | ||
| vi.restoreAllMocks(); | ||
| vi.resetModules(); | ||
| process.env.NEXT_PUBLIC_USE_MODELSEED_API = 'true'; | ||
| process.env.NEXT_PUBLIC_MODELSEED_API_URL = 'http://localhost:8000'; | ||
| localStorage.clear(); | ||
| setAuthToken(); | ||
| }); |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
VibhavSetlur:stagingintoModelSEED:staging.Included Commits
b93af2bfix(model-detail): use canonical model ref for FBA and gapfills5fda9bafix(fba-detail): load FBA detail data by fba_idFiles Changed
app/model/[...path]/page.tsxapp/fba/[...path]/page.tsxlib/api/modelseed.tstests/unit/api/modelseed-client.test.tsWhy
fba_idconsistently.Validation
upstream/staging.Test plan
fba_idfrom model detail links.Made with Cursor