Skip to content

[SimEdit]: Allow editing simulations from Simulation Details#225

Merged
tomvothecoder merged 3 commits into
E3SM-Project:dev/sim-editfrom
tomvothecoder:feature/70-sim-edit
Jun 11, 2026
Merged

[SimEdit]: Allow editing simulations from Simulation Details#225
tomvothecoder merged 3 commits into
E3SM-Project:dev/sim-editfrom
tomvothecoder:feature/70-sim-edit

Conversation

@tomvothecoder

@tomvothecoder tomvothecoder commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Truncate overflowing simulation detail fields, preserve the full values on hover, and wire the simulation details page to the edit/save flow.

Closes #70

  • Added truncation and hover titles to long read-only fields.
  • Kept full IDs and repository URLs available through hover text and copy actions.
  • Updated the simulation edit flow and backend tests for the metadata update path.

Checklist

  • Code follows project style guidelines
  • Self-reviewed code
  • No new warnings
  • Tests added or updated (if needed)
  • All tests pass (locally and CI/CD)
  • Documentation/comments updated (if needed)
  • Breaking change noted (if applicable)

Deployment Notes (if any)

@tomvothecoder tomvothecoder changed the title Refine simulation metadata editing [SimEdit]: Allow editing simulations from Simulation Details Jun 11, 2026
@tomvothecoder tomvothecoder changed the base branch from main to dev/sim-edit June 11, 2026 18:54
@tomvothecoder tomvothecoder requested a review from Copilot June 11, 2026 18:54

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da7f400f70

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend/app/features/simulation/schemas.py

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

Key Findings

  • The v1 “editable fields” implemented in both frontend and backend omit several
    fields listed as editable in Issue #70 (notably compiler and git provenance
    fields), which is a scope/acceptance-criteria mismatch for a PR that closes
    #70. (See comments in SimulationUpdate + EDITABLE_FIELDS.)
  • Frontend API typing now includes simulationType: 'master', but the backend
    SimulationType enum does not, creating an API contract drift that can lead
    to 422s if the UI ever sends that value.
  • Backend PATCH currently mutates updated_at/last_updated_by even for an empty
    PATCH body; this should be treated as a no-op.

This PR adds a narrow edit/save flow to the Simulation Details page, improves
read-only field display via truncation + hover titles, and introduces a backend
PATCH endpoint to persist allowed metadata updates for existing simulations.

Changes:

  • Added backend PATCH /simulations/{id} with a new SimulationUpdate schema
    and associated API/schema tests.
  • Wired Simulation Details page to an edit mode (form state + save/cancel) and
    compare selection toggle with a max selection limit.
  • Improved UI display for long read-only fields via truncation and hover titles.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
frontend/src/types/simulation.ts Introduces typed status/type unions and a SimulationUpdate payload type.
frontend/src/features/simulations/SimulationsPage.tsx Extends type/status color mappings for new enum values.
frontend/src/features/simulations/SimulationDetailsPage.tsx Adds save flow, local simulation state, and compare toggle wiring.
frontend/src/features/simulations/routes.tsx Passes compare-selection state into details route.
frontend/src/features/simulations/components/SimulationTypeBadge.tsx Updates the “unknown” label text.
frontend/src/features/simulations/components/SimulationDetailsView.tsx Adds editable form UI/state, save/cancel controls, and truncating readonly components.
frontend/src/features/simulations/api/api.ts Adds updateSimulation() PATCH client method.
frontend/src/components/shared/SimulationStatusBadge.tsx Expands supported statuses and normalizes display logic.
backend/tests/features/simulation/test_schemas.py Adds validation coverage for the new SimulationUpdate schema.
backend/tests/features/simulation/test_api.py Adds API coverage for simulation PATCH behavior and auth/error cases.
backend/app/features/simulation/schemas.py Adds SimulationUpdate schema (extra-forbid, partial fields).
backend/app/features/simulation/api.py Adds PATCH endpoint and refactors simulation detail query helper.

Comment thread frontend/src/types/simulation.ts
Comment thread frontend/src/types/simulation.ts Outdated
Comment thread frontend/src/features/simulations/components/SimulationDetailsView.tsx Outdated
Comment thread backend/app/features/simulation/schemas.py
Comment thread backend/app/features/simulation/api.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SimEdit]: Allow editing uploaded simulations from the Simulation Details page

2 participants