Sync: develop into staging (Data control, biochem, subsystems, structures)#178
Merged
VibhavSetlur merged 1 commit intoModelSEED:stagingfrom May 4, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR syncs develop into staging, focusing on UI hardening and data correctness across pages that consume Workspace / ModelSEED APIs (notably timestamp parsing, DataGrid behavior, and model/FBA/media link/data fields).
Changes:
- Added a shared
parseWorkspaceDateutility and updated multiple DataGriddateTimecolumns to correctly parse Workspace timestamps likeYYYY-MM-DD-HH:MM:SS. - Hardened
DataControlHeaderpagination by hiding it while grid rows are loading to avoid a transient “0-0 of 0” display. - Simplified
listMyMediaFromApito only use the/api/media/mineendpoint, and adjusted model detail rendering to prefermedia_refplus some ref/link handling.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/utils/date.ts | Introduces parseWorkspaceDate helper for normalizing Workspace timestamp strings into parseable ISO-like form. |
| lib/api/modelseed.ts | Simplifies listMyMediaFromApi behavior to a single endpoint call (removes prior fallback path scanning). |
| components/layout/DataControlHeader.tsx | Hides custom pagination while DataGrid is loading to prevent pagination flashing incorrect totals. |
| app/model/[...path]/page.tsx | Uses parseWorkspaceDate for timestamps, prefers media_ref, adjusts model edits query key/candidate, and improves FBA link ref handling. |
| app/fba/[...path]/page.tsx | Normalizes Workspace ls timestamps before sorting FBA refs by time. |
| app/data/[...path]/page.tsx | Preserves raw Workspace timestamps and parses them via parseWorkspaceDate for the “Modified” column. |
| app/(user-data)/myMedia/page.tsx | Parses media modification dates with parseWorkspaceDate for correct DataGrid dateTime handling. |
| app/(user-data)/my-models/page.tsx | Parses model modification dates with parseWorkspaceDate for correct DataGrid dateTime handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+195
to
199
| const rawTs = String(entry[3] ?? ''); | ||
| const normalizedTs = rawTs.replace(/^(\d{4}-\d{2}-\d{2})-(\d{2}:\d{2}:\d{2})$/, '$1T$2'); | ||
| const ts = Number.isFinite(new Date(normalizedTs).getTime()) | ||
| ? new Date(normalizedTs).getTime() | ||
| : 0; |
Comment on lines
625
to
629
| * ``` | ||
| */ | ||
| export async function listMyMediaFromApi(): Promise<ModelseedMediaSummary[]> { | ||
| const primary = await listMediaGeneric('/api/media/mine'); | ||
| if (primary.length > 0) return primary; | ||
|
|
||
| if (!USE_NEW_PROXY) return primary; | ||
| const username = getStoredAuthUsername(); | ||
| if (!username) return primary; | ||
|
|
||
| try { | ||
| const fallbackPaths = [ | ||
| `/${username}/media`, | ||
| `/${username}/modelseed/media`, | ||
| ]; | ||
| for (const path of fallbackPaths) { | ||
| const viaWorkspace = await listMediaViaWorkspaceLs(path); | ||
| if (viaWorkspace.length > 0) return viaWorkspace; | ||
| } | ||
| return primary; | ||
| } catch (err) { | ||
| console.warn('modelseed-api: fallback /api/workspace/ls media lookup failed:', err); | ||
| return primary; | ||
| } | ||
| return listMediaGeneric('/api/media/mine'); | ||
| } |
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.
Merges latest
developwork intostagingfor upstream review.Includes: DataControlHeader hardening, biochem compounds/reactions fixes, subsystems reaction links, compound/reaction structure placeholders, tests/docs.
Fork
stagingmatches localdevelop; pushed toorigin/staging.Made with Cursor