Skip to content

feat(frontend): add the model detail page - #7127

Draft
tanishqgandhi1908 wants to merge 28 commits into
apache:mainfrom
tanishqgandhi1908:feat/model-ui-detail
Draft

feat(frontend): add the model detail page#7127
tanishqgandhi1908 wants to merge 28 commits into
apache:mainfrom
tanishqgandhi1908:feat/model-ui-detail

Conversation

@tanishqgandhi1908

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds /dashboard/user/model/:mid, the read-only model detail page. Previously the Models list page linked to a route that didn't exist. The page is a view-only fork of dataset-detail.component.*: header with name, creation time, public/private and downloadable tags plus model-specific framework and format tags, quick-settings toggles, editable markdown description, version dropdown with per-version size, file tree, file preview, copy-path, and per-file / per-version-zip download. It reuses user-dataset-version-filetree, markdown-description and size-formatter.util.ts rather than duplicating them.

user-dataset-file-renderer gains a single @input() resourceType, defaulting to "dataset", which branches only its blob fetch — so every existing call site is unchanged. ModelService gains the version/file-tree/presign/zip methods, DownloadService gains the model download wrappers, and a ModelVersion interface is added.

Any related issues, documentation, discussions?

Closes #6499 (Add model management UI).
Umbrella: #6494.

Stacked on fix/model-file-tree-resource-prefix

How was this PR tested?

New model-detail.component.spec.ts with 25 cases covering route-param handling, metadata population, version selection and file-tree loading, download gating across owner / public / no-access, both toggles including failure-revert, description optimistic-update-and-revert, and the empty-version and empty-tree paths. Plus 7 cases in model.service.spec.ts, 4 in download.service.spec.ts, and 1 model-branch case in the renderer spec.

The renderer's 18 pre-existing tests and all 63 dataset-detail tests pass unmodified, which is the evidence the shared seam is behaviour-neutral for datasets. 199 tests pass across the six affected spec files; tsc --noEmit, eslint and prettier are clean.

cd frontend && npx ng test --watch=false --include src/app/dashboard/component/user/user-model/user-model-explorer/model-detail.component.spec.ts

Manually verified against a local stack: card click reaches the page, tags render correctly, the visibility and downloadable toggles persist, description editing works, and a model with no versions shows the empty state. File preview and version switching will be exercised once the create-model/version UI lands in the next PR.

Screenshot 2026-07-30 at 10 21 14 AM Screenshot 2026-07-30 at 10 19 32 AM

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5)

aicam and others added 28 commits July 1, 2026 13:57
… tests

Review fixes on apache#5911: use dataset owner email in retrieveLatestDatasetVersion,
replace brittle Option.get/.head with headOption, strip datasets prefix on
selection-modal reopen, clarify FileResolver docs; add FileResolver/DatasetFileNode
and frontend path-helper tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The datasets logical-path prefix strips four leading segments
(datasets/owner/dataset/version); update the cover-image test's input
path to include the prefix so the extracted relative path is the file
name, not an empty string.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Now that models are coming as a separate resource/table, the leading
resource-type segment is what selects the backing table, so an unprefixed
path can no longer be routed unambiguously. Make the "datasets" prefix
required instead of a tolerated fallback, and migrate existing data.

- FileResolver: a dataset path must start with the "datasets" segment;
  unprefixed paths are no longer treated as dataset paths.
- pytexera DatasetFileDocument: same rule, mirroring the backend.
- FileListerSourceOpExec: parse the now-prefixed datasetVersionPath
  (skip the "datasets" segment); extracted into a testable helper.
- Migration (sql/updates/29.sql): prepend "datasets/" to legacy paths
  stored in workflow.content and workflow_version.content, covering both
  the fileName (scan sources) and datasetVersionPath (file lister)
  operator properties. Only values whose first two segments match an
  existing (user.email, dataset.name) are rewritten, so local paths and
  URLs are left untouched; email format is irrelevant (owner may be a
  username without "@"). Uses create_missing=false and is idempotent.
- Example workflows: use datasets-prefixed paths.

Tests: FileResolverSpec and WorkflowExecutionsResourceSpec updated;
test_dataset_file_document.py updated; new FileListerSourceOpExecSpec.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…l-path-prefix

# Conflicts:
#	frontend/src/app/common/type/datasetVersionFileTree.spec.ts
…format python test

- dataset-selection-modal.component.spec.ts: expect the datasets-prefixed
  selectedPath in version (non-file) mode, matching the emitted path.
- test_dataset_file_document.py: apply ruff format (wrap an over-length line)
  so `ruff format --check` passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The cover-image endpoints resolve a dataset path built as
{owner}/{name}/{coverImage}. With the prefix now required by FileResolver,
these must carry the datasets/ segment; add it in the set-cover,
get-cover redirect, and cover-url handlers so cover images resolve again.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rage

# Conflicts:
#	common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/DocumentFactorySpec.scala
The explicit-access branch of listModels hardcoded size 0 while the public
branch computed it, so a user's own models reported no size. Compute it in
both, mirroring the dataset listing, and degrade to 0 rather than dropping
the row when LakeFS cannot answer.
DatasetFileNode.fromLakeFSRepositoryCommittedObjects hardcoded
ResourceType.Datasets as the tree's leading segment. Models reuse that
builder, so model file nodes reported paths under /datasets/... .
FileResolver dispatches on that segment, so presigning a model file by
its logical path resolved against the DATASET table -- a 404, or the
wrong resource's file when a user owns a same-named dataset.

Make resourceType a required parameter so every call site declares which
resource it builds, and extract the scaffolding the two builders
duplicated into buildVersionSkeleton and sortChildrenRecursively.
fromPhysicalFileNodes stays pinned to Datasets: physical on-disk trees
are dataset-only.

Datasets are unaffected -- the file-population loop is moved verbatim and
the terminal sort makes creation order unobservable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions github-actions Bot added engine ddl-change Changes to the TexeraDB DDL pyamber frontend Changes related to the frontend GUI infra common platform Non-amber Scala service paths labels Jul 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @aglinxinyuan, @Ma77Ball, @Yicong-Huang
    You can notify them by mentioning @aglinxinyuan, @Ma77Ball, @Yicong-Huang in a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common ddl-change Changes to the TexeraDB DDL engine feature frontend Changes related to the frontend GUI infra platform Non-amber Scala service paths pyamber

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add model management UI

2 participants