Skip to content

feat(ui-outputs): add user column and refactor the view#3221

Open
skamril wants to merge 4 commits into
release/v2.32.0from
feature/outputs-view
Open

feat(ui-outputs): add user column and refactor the view#3221
skamril wants to merge 4 commits into
release/v2.32.0from
feature/outputs-view

Conversation

@skamril
Copy link
Copy Markdown
Member

@skamril skamril commented May 22, 2026

  • add Zod schema validation on outputs API responses
  • integrate TanStack Query for data fetching and caching
  • add "archived" chip indicator on output items
  • restrict access to archived outputs

@skamril skamril requested a review from hdinia May 22, 2026 07:17
@skamril skamril self-assigned this May 22, 2026
Copilot AI review requested due to automatic review settings May 22, 2026 07:17
skamril added 2 commits May 22, 2026 08:17
- add Zod schema validation on outputs API responses
- integrate TanStack Query for data fetching and caching
- add "archived" chip indicator on output items
- restrict access to archived outputs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the study outputs UI/API integration by introducing Zod-validated output response types and TanStack Query-based fetching/caching, while also refactoring both frontend and backend logic around outputs, archiving, and (in the backend) study storage/snapshot management.

Changes:

  • Added a dedicated outputs API module (schemas/types/methods) with Zod validation and introduced output queries/mutations for TanStack Query.
  • Refactored outputs-related UI screens (outputs list, copy/export/launch dialogs, job log actions) to rely on the new API/query layer and to display archived state (chip + restricted access) and a user column.
  • Refactored backend storage/snapshot abstractions (new interfaces/managers), adjusted disk-usage computation to include outputs, and updated tests/fixtures accordingly.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
webapp/src/types/types.ts Renames output synthesis type and tightens output field typings.
webapp/src/services/api/tasks/types.ts Minor comment/cosmetic update.
webapp/src/services/api/study.ts Switches output lookup to new outputs API module; removes legacy output helpers.
webapp/src/services/api/studies/outputs/types.ts Adds typed request params and inferred output response type.
webapp/src/services/api/studies/outputs/schemas.ts Introduces Zod schemas for outputs responses.
webapp/src/services/api/studies/outputs/index.ts Adds outputs CRUD API wrappers with Zod parsing.
webapp/src/routes/-shared/components/studies/dialogs/StudyLaunchDialog/utils.ts Uses TanStack Query outputs cache to build output selection options.
webapp/src/routes/-shared/components/studies/dialogs/ExportModal/index.tsx Refactors outputs fetching to new outputs API types.
webapp/src/routes/-shared/components/studies/dialogs/CopyStudyDialog.tsx Migrates outputs selection to TanStack Query and new output typing.
webapp/src/routes/_authenticated/tasks/-components/LaunchJobLogView.tsx Refactors log action buttons to IconButton/Badge-based UI.
webapp/src/routes/_authenticated/studies/$studyId/route.tsx Minor route config reordering.
webapp/src/routes/_authenticated/studies/$studyId/index.tsx Prefetches job list via route loader.
webapp/src/routes/_authenticated/studies/$studyId/explore/outputs/index.tsx Major refactor of outputs list view: TanStack Query, archived restrictions, user column, new actions UX.
webapp/src/routes/_authenticated/studies/$studyId/explore/outputs/$outputId/-utils.ts Updates output typing used by output detail utils.
webapp/src/routes/_authenticated/studies/$studyId/explore/outputs/-utils.ts Adds shared sorting/selection helpers for outputs+jobs.
webapp/src/routes/_authenticated/studies/$studyId/explore/outputs/-hooks/useUnarchiveOutput.ts Adds TanStack Query mutation hook with optimistic updates.
webapp/src/routes/_authenticated/studies/$studyId/explore/outputs/-hooks/useDeleteOutput.ts Adds TanStack Query delete mutation hook with optimistic updates.
webapp/src/routes/_authenticated/studies/$studyId/explore/outputs/-hooks/useArchiveOutput.ts Adds TanStack Query archive mutation hook with optimistic updates.
webapp/src/routes/_authenticated/studies/$studyId/explore/modeling/binding-constraints/-hooks/useDeleteBindingConstraint.ts Improves snackbar message fallback on delete failure.
webapp/src/routes/_authenticated/studies/$studyId/explore/modeling/areas/$areaId/storages/$storageId/additional-constraints/-hooks/useDeleteStorageConstraint.ts Improves snackbar message fallback on delete failure.
webapp/src/routes/_authenticated/studies/$studyId/-components/InformationView/LauncherHistory/JobStepper.tsx Migrates outputs fetch to TanStack Query and refactors action buttons to IconButton.
webapp/src/queries/outputs/queries.ts Adds outputs query factory.
webapp/src/queries/outputs/mutations.ts Adds outputs mutation option factories.
webapp/src/queries/outputs/keys.ts Defines TanStack Query keys for outputs operations.
webapp/public/locales/fr/main.json Updates output-related placeholders and adds delete-output error message.
webapp/public/locales/en/main.json Updates output-related placeholders and adds delete-output error message.
tests/variantstudy/model/test_variant_model.py Updates snapshot generator and filesystem DAO factory setup in tests.
tests/study/test_service.py Moves disk usage import and removes unknown-format test.
tests/study/storage/variantstudy/test_variant_study_service.py Updates fixtures and filesystem setup assumptions.
tests/study/storage/variantstudy/test_snapshot_generator.py Migrates snapshot generator tests to new generator/service API.
tests/study/storage/variantstudy/model/test_dbmodel.py Updates snapshot up-to-date checks to use service logic.
tests/study/storage/rawstudy/test_raw_study_service.py Refactors export test to use StudyService/raw storage service and asserts outputs not exported.
tests/study/service/test_service.py Updates study service tests to new DAO factory and outputs access interface.
tests/study/dao/conftest.py Consolidates DAO builders into shared helpers (moved to tests/conftest.py).
tests/storage/integration/test_STA_mini.py Updates study path retrieval logic for integration tests.
tests/storage/integration/conftest.py Ensures RawStudy created with explicit storage_mode.
tests/storage/business/test_watcher.py Updates mocked method name for raw metadata update.
tests/storage/business/test_variant_study_service.py Removes legacy/duplicated tests that no longer apply after refactor.
tests/storage/business/test_raw_study_service.py Major refactor to new storage/service APIs and adds delete raw/variant study tests.
tests/storage/business/test_optional_matrices.py Updates normalization call path and expectations after service refactor.
tests/storage/business/test_import.py Refactors import tests to use real raw_study_service and shared fixtures.
tests/storage/business/test_export.py Refactors normalization tests to use new service and FileStudy separation.
tests/matrixstore/test_matrix_usage_providers.py Updates matrix usage providers to use storage mapping abstraction.
tests/integration/studies_blueprint/test_disk_usage.py Refactors endpoint test and uses output import fixture with size tolerance.
tests/integration/raw_studies_blueprint/test_fetch_raw_data.py Removes archived/unarchived param branch from test.
tests/integration/output/test_v2_output_storage.py Moves shared fixtures out to integration conftest.
tests/integration/conftest.py Adds session-scoped STA-mini/output zip fixtures used by multiple tests.
tests/helpers.py Updates RawStudy factory to include default storage_mode and trims docstring.
tests/core/tasks/test_tasks_service.py Refactors task test setup to use DAO factory + command-based study edits.
tests/conftest.py Adds shared DAO builders and filesystem DAO fixture; extends imports for new abstractions.
tests/conftest_services.py Updates RawStudyService fixture ctor signature and repository usage.
antarest/study/storage/variantstudy/snapshot/snapshot_manager_interface.py Introduces snapshot manager interface abstraction.
antarest/study/storage/variantstudy/snapshot/snapshot_generator.py Refactors snapshot generation to delegate snapshot ops to variant study service/manager.
antarest/study/storage/variantstudy/snapshot/file_snapshot_manager.py Adds filesystem snapshot manager implementation.
antarest/study/storage/variantstudy/snapshot/database_snapshot_manager.py Adds database snapshot manager stub (currently unimplemented).
antarest/study/storage/variantstudy/snapshot/init.py Package init for new snapshot module.
antarest/study/storage/variantstudy/model/dbmodel.py Removes snapshot_dir + snapshot helpers from VariantStudy model.
antarest/study/storage/variantstudy/command_matrix_usage_provider.py Refactors to rely on storage mapping for matrix reference discovery.
antarest/study/storage/utils.py Moves disk usage helper here and adds user/editor helpers + StudyMetadataCreation dataclass.
antarest/study/storage/study_storage.py Removes legacy IStudyStorage interface file.
antarest/study/storage/study_storage_interface.py Adds new storage interface focused on copy/export/import/usage/disk usage.
antarest/study/storage/study_service_interface.py Adds study service interface for common study operations.
antarest/study/storage/storage_service.py Updates storage service to return new service interface type.
antarest/study/storage/rawstudy/raw_study_service.py Major refactor: uses storage mapping, DAO factories, new import/copy/export/normalize paths, updated disk usage.
antarest/study/storage/rawstudy/raw_study_matrix_usage_provider.py Refactors to use storage mapping for matrix references.
antarest/study/storage/file_study_utils.py Extracts filesystem utilities (snapshot dir, export flat, update study.antares).
antarest/study/storage/file_study_storage.py Adds filesystem-backed storage implementation for new interface.
antarest/study/storage/database_storage.py Adds DB-backed storage implementation stub (some methods unimplemented).
antarest/study/storage/abstract/abstract_study_service.py Replaces legacy AbstractStorageService with new base class for study services.
antarest/study/storage/abstract/init.py Package init for new abstract module.
antarest/study/storage/abstract_storage_service.py Removes legacy AbstractStorageService implementation.
antarest/study/service.py Refactors study service to new DAO creation path, new disk usage calculation, and file access logic.
antarest/study/repository.py Updates comments referencing new abstract service name.
antarest/study/main.py Updates service wiring for new RawStudyService constructor signature.
antarest/study/dao/file/file_study_factory_dao.py Refactors filesystem DAO factory to accept path getter and new StudyMetadataCreation.
antarest/study/dao/database/database_study_factory_dao.py Updates DB DAO factory to use StudyMetadataCreation and adds get_study_dao().
antarest/study/dao/api/study_factory_dao.py Updates DAO factory interface to metadata-based creation + retrieval.
antarest/study/adapters.py Extends outputs access adapter to support output disk usage.
antarest/output/storage/v2/storage.py Ensures OutputDetails includes id for V2 storage and adds output disk usage.
antarest/output/storage/output_storage.py Adds id to OutputDetails and introduces disk-usage method in storage interface.
antarest/output/storage/file/storage.py Ensures OutputDetails includes id and adds output disk usage implementation.
antarest/output/service.py Exposes output disk usage via service API.
antarest/launcher/model.py Minor docstring edit.
Comments suppressed due to low confidence (2)

webapp/src/services/api/studies/outputs/index.ts:32

  • archiveOutput() builds the endpoint URL with a raw outputId. To avoid regressions vs the previous implementation (which encoded the output ID), apply encodeURIComponent(outputId) when interpolating it into the path.
export async function archiveOutput({ studyId, outputId }: OutputParams) {
  const { data: taskId } = await client.post(`/v1/studies/${studyId}/outputs/${outputId}/_archive`);
  return z.string().parse(taskId);
}

webapp/src/services/api/studies/outputs/index.ts:37

  • unarchiveOutput() builds the endpoint URL with a raw outputId. This should be URL-encoded (as it was previously) to support output IDs with reserved characters and to be consistent with other routes. Consider using encodeURIComponent(outputId) in the path.
export async function unarchiveOutput({ studyId, outputId }: OutputParams) {
  const { data: taskId } = await client.post(
    `/v1/studies/${studyId}/outputs/${outputId}/_unarchive`,
  );

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread webapp/src/types/types.ts Outdated
Comment thread webapp/src/services/api/studies/outputs/index.ts Outdated
Comment thread webapp/src/routes/-shared/components/studies/dialogs/CopyStudyDialog.tsx Outdated
Comment thread antarest/launcher/model.py Outdated
@skamril skamril force-pushed the feature/outputs-view branch 2 times, most recently from 70abd1f to 93519c2 Compare May 22, 2026 08:20
@skamril skamril force-pushed the feature/outputs-view branch from 93519c2 to 02f5517 Compare May 22, 2026 08:20
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.

2 participants