Skip to content

fix(frontend): render workflow covers on the hub landing page - #8383

Merged
aicam merged 1 commit into
apache:mainfrom
tanishqgandhi1908:fix/hub-workflow-covers
Sep 3, 2026
Merged

fix(frontend): render workflow covers on the hub landing page#8383
aicam merged 1 commit into
apache:mainfrom
tanishqgandhi1908:fix/hub-workflow-covers

Conversation

@tanishqgandhi1908

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Workflow covers never rendered on the Hub landing page: every card under Top Loved Workflows and Top Cloned Workflows showed the grey placeholder, even for a workflow whose owner had set a cover, while the same workflow showed it correctly in Your Work → Workflows.

Covers reach the frontend two different ways. A workflow cover is a downscaled data URL that arrives inline on the list payload and lands on DashboardEntry.coverImageUrl. A dataset or model cover is a committed file, so what arrives is a path and the card has to fetch a presigned URL from /{id}/cover-url.

browse-section only ever handled the second kind — it asks the descriptor for a coverUrl and bails when there is none, which is always the case for a workflow, since WorkflowResourceDescriptor deliberately declares none. So nothing was ever cached for a workflow and getCoverImage fell through to the default.

getCoverImage now reads a workflow's cover straight off the entry, mirroring the branch card-item.component.ts:197-202 already had.

Also included, since it is one line in the same area and needs no separate issue: frontend/proxy.config.json declared "/api/model/**" twice (both pointing at :9092, so the last silently won). The duplicate is removed, leaving the entry beside /api/dataset, so the file reads dataset, model, access/dataset, access/model.

Before — both workflows are public; the left one has a cover, the right one does not:

issue5-1-hub-landing-before

After — the left card renders its cover, the right one still shows the placeholder:

issue5-1-hub-landing-after

Any related issues, documentation, discussions?

Closes #8382.

How was this PR tested?

browse-section.component.spec.ts, 25 passed:

  • renders a workflow's cover from the entry, since no cover is ever fetched for one — a workflow
    with a cover resolves to it, one without still gets the default.
  • keeps a file-backed kind on the placeholder rather than rendering its stored cover path — a
    dataset whose presigned fetch answers with an empty URL stays on the placeholder instead of
    rendering v1/images/preview.png.
  • skips an entity whose descriptor resolves no cover, rather than calling undefined was already
    there and asserted getCoverImage(workflow) === defaultBackground — it pinned the bug, so it now
    asserts the cover comes off the entry, with the unregistered-kind row still falling back.

landing-page.component.spec.ts also run, 17 passed.

cd frontend
npx ng test --include src/app/hub/component/browse-section/browse-section.component.spec.ts
npx ng test --include src/app/hub/component/landing-page/landing-page.component.spec.ts

Checked by hand against a local stack: a public workflow with a cover set from the dashboard now
shows it in both hub sections, and a public workflow without one is unchanged.

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

Generated-by: Claude Code (Opus 5)

Every card under Top Loved Workflows and Top Cloned Workflows showed the grey
placeholder, even for a workflow whose owner had set a cover, while the same
workflow rendered it correctly in Your Work.

Covers reach the frontend two different ways. A workflow's is a downscaled data
URL that arrives inline on the list payload and lands on
DashboardEntry.coverImageUrl. A dataset's or model's is a committed file, so
what arrives is a path and the card fetches a presigned URL from
/{id}/cover-url. browse-section only handled the second kind: it asks the
descriptor for a coverUrl and bails when there is none, which is always the
case for a workflow, since WorkflowResourceDescriptor deliberately declares
none. Nothing was ever cached for a workflow, so getCoverImage fell through to
the default.

getCoverImage now reads a workflow's cover off the entry, mirroring the branch
card-item already had. It is deliberately not a blanket fallback for every
kind: a dataset or model carries a stored path such as v1/cover.png, which no
img can load, so a blanket fallback would swap a clean placeholder for a broken
image whenever the presigned fetch returned nothing. A spec pins that, and
datasets and models keep resolving exactly as before.

Also removes a duplicate "/api/model/**" key in frontend/proxy.config.json,
where both entries pointed at :9092 and the last silently won.

Closes apache#8382.
@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels Sep 3, 2026
@Yicong-Huang Yicong-Huang added release/v1.3 back porting to release/v1.3 release/v1.2 back porting to release/v1.2 labels Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

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
    You can notify them by mentioning @aglinxinyuan in a comment.

@github-actions
github-actions Bot requested review from mengw15 and xuang7 September 3, 2026 18:31
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. release/* labels drive the post-merge backport, so add or remove one to change where this fix lands.

Release branch Analysis
release/v1.3 Change detected on this branch — label added; this fix is queued to backport here. Requested review from @mengw15.
release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. Requested review from @xuang7.

Auto-label run.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.04%. Comparing base (cd4fd5a) to head (b4ab0df).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8383   +/-   ##
=========================================
  Coverage     94.03%   94.04%           
  Complexity     4771     4771           
=========================================
  Files          1196     1196           
  Lines         48757    48760    +3     
  Branches       5916     5918    +2     
=========================================
+ Hits          45850    45854    +4     
  Misses         1458     1458           
+ Partials       1449     1448    -1     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from cd4fd5a
agent-service 99.32% <ø> (ø) Carriedforward from cd4fd5a
amber 89.89% <ø> (ø) Carriedforward from cd4fd5a
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from cd4fd5a
config-service 87.12% <ø> (ø) Carriedforward from cd4fd5a
file-service 87.91% <ø> (ø) Carriedforward from cd4fd5a
frontend 96.81% <100.00%> (+<0.01%) ⬆️
notebook-migration-service 79.31% <ø> (ø) Carriedforward from cd4fd5a
pyamber 98.47% <ø> (ø) Carriedforward from cd4fd5a
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from cd4fd5a

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aicam
aicam added this pull request to the merge queue Sep 3, 2026
Merged via the queue into apache:main with commit 1facefb Sep 3, 2026
29 of 35 checks passed
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Backport PR opened: draft #8390 (#8390) to release/v1.2, assigned to @tanishqgandhi1908 — needs manual work because the cherry-pick conflicts.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Backport PR opened: draft #8389 (#8389) to release/v1.3, assigned to @tanishqgandhi1908 — needs manual work because the cherry-pick conflicts.

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

Labels

fix frontend Changes related to the frontend GUI release/v1.2 back porting to release/v1.2 release/v1.3 back porting to release/v1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflow cover images never render on the Hub landing page

4 participants