Surface missing schema fields in Simulation Details page#128
Surface missing schema fields in Simulation Details page#128
Conversation
- Configuration Card: add caseGroup, compsetAlias, description fields - Provenance Card: show user names with UUID fallback - New Scientific Metadata card with markdown-rendered keyFeatures/knownIssues - Collapsible Advanced Metadata section with formatted JSON for extra - Add UserPreview type and createdByUser/lastUpdatedByUser to SimulationOut - Install react-markdown for markdown rendering Co-authored-by: tomvothecoder <25624127+tomvothecoder@users.noreply.github.com>
…nce card Co-authored-by: tomvothecoder <25624127+tomvothecoder@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Surfaces additional SimulationOut metadata on the Simulation Details page (configuration/provenance/scientific/advanced metadata) and updates frontend types/dependencies to support the new UI.
Changes:
- Add
createdByUser/lastUpdatedByUsertyping and render richer provenance display. - Render new Scientific Metadata section (markdown) and Advanced Metadata collapsible JSON viewer.
- Add
react-markdowndependency and update lockfile.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
frontend/src/types/simulation.ts |
Adds UserPreview type and extends SimulationOut with nested user preview fields. |
frontend/src/features/simulations/components/SimulationDetailsView.tsx |
Renders additional schema fields, adds markdown rendering, and adds an “Advanced Metadata” collapsible. |
frontend/package.json |
Adds react-markdown dependency. |
frontend/pnpm-lock.yaml |
Lockfile update for react-markdown and transitive deps. |
Files not reviewed (1)
- frontend/pnpm-lock.yaml: Language not supported
| <CollapsibleTrigger className="flex w-full items-center justify-between"> | ||
| <CardTitle className="text-base">Advanced Metadata</CardTitle> | ||
| <ChevronDown className="h-4 w-4 text-muted-foreground transition-transform duration-200 [&[data-state=open]]:rotate-180" /> |
There was a problem hiding this comment.
ChevronDown rotation styling won’t activate because data-state is applied to CollapsibleTrigger, not the icon. Move the open-state selector to the trigger (targeting the child svg) or use a group/data-[state=open] pattern so the icon rotates when the collapsible is open.
| <CollapsibleTrigger className="flex w-full items-center justify-between"> | |
| <CardTitle className="text-base">Advanced Metadata</CardTitle> | |
| <ChevronDown className="h-4 w-4 text-muted-foreground transition-transform duration-200 [&[data-state=open]]:rotate-180" /> | |
| <CollapsibleTrigger className="flex w-full items-center justify-between [&[data-state=open]>svg]:rotate-180"> | |
| <CardTitle className="text-base">Advanced Metadata</CardTitle> | |
| <ChevronDown className="h-4 w-4 text-muted-foreground transition-transform duration-200" /> |
| <CardContent> | ||
| <pre className="rounded-md bg-muted p-4 text-xs overflow-auto max-h-[400px]"> | ||
| {JSON.stringify(simulation.extra, null, 2)} | ||
| </pre> |
There was a problem hiding this comment.
JSON.stringify(simulation.extra, null, 2) runs on every render even when the collapsible is closed, which can be expensive for large extra payloads. Consider controlling the open state and only rendering/stringifying the JSON when open (or memoizing the string).
| id: string; | ||
| email: string; | ||
| role: string; | ||
| fullName?: string | null; |
There was a problem hiding this comment.
Backend UserPreview schema uses full_name (snake_case). As a nested object under createdByUser/lastUpdatedByUser, this will serialize as full_name, so the frontend type fullName won’t match the API payload. Align the field name (e.g., full_name) or update the backend preview schema to use camelCase aliases consistently.
| fullName?: string | null; | |
| full_name?: string | null; |
| user?: { fullName?: string | null; email: string } | null; | ||
| fallbackId?: string | null; | ||
| }) => { | ||
| if (user) return <span className="text-sm">by {user.fullName ?? user.email}</span>; |
There was a problem hiding this comment.
UserDisplay reads user.fullName, but the backend UserPreview schema exposes full_name (snake_case). With the current code, full names won’t display and will always fall back to email. Update this to match the actual API field name (or normalize the user preview shape before rendering).
| user?: { fullName?: string | null; email: string } | null; | |
| fallbackId?: string | null; | |
| }) => { | |
| if (user) return <span className="text-sm">by {user.fullName ?? user.email}</span>; | |
| user?: { fullName?: string | null; full_name?: string | null; email: string } | null; | |
| fallbackId?: string | null; | |
| }) => { | |
| if (user) { | |
| return ( | |
| <span className="text-sm"> | |
| by {user.fullName ?? user.full_name ?? user.email} | |
| </span> | |
| ); | |
| } |
Description
Several
SimulationOutschema fields exist on the backend but aren't rendered in the details view. This PR surfaces them across four UI areas.Configuration Card
caseGroup— shown conditionally under Case NamecompsetAlias— shown under Compsetdescription— read-onlyTextareaat bottom, preserves line breaksProvenance Card
createdByUser/lastUpdatedByUsernames (fullName→emailfallback → raw UUID fallback)UserDisplayhelper to DRY the patternScientific Metadata Card (new, below Timeline)
keyFeaturesandknownIssuesrendered as markdown viareact-markdownAdvanced Metadata (new, collapsible)
extra, using existingCollapsibleprimitiveextrais emptyType changes (
frontend/src/types/simulation.ts)UserPreviewinterfacecreatedByUserandlastUpdatedByUsertoSimulationOutDependencies
react-markdown@^10.1.0(no known advisories)case_idis explicitly not exposed per spec.Checklist
Deployment Notes (if any)
None — UI-only change, no schema/API/migration changes.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.