The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-8381-5de83017defe685cc29703eb37628383fbbf3bfb
 has succeeded.
Run started by GitHub user aicam (triggered by aicam).

Head commit for run:
1cbe857007a6526c6087f187667ef3b3c9ade546 / Tanishq Gandhi 
<[email protected]>
feat(frontend): render an absent fact as an em dash and a size as 0 B 
everywhere (#8381)

### What changes were proposed in this PR?

A resource's size, and the facts it has none of, rendered four different
ways depending on where you looked. This settles on one convention: **a
fact with nothing to show renders "—", and a size renders `0 B`**,
because zero bytes is a meaningful answer.

**Card view hid the size row; list view showed `0 B`.** A dataset
created but never uploaded to showed no size line at all in card view
(`*ngIf="size"` hides a zero) and `Size: 0 B` in list view. Card view
now always renders the row, so both views agree.

**A copied workflow claimed `Size: 0 B`.** Only search asks the backend
for workflow sizes (`SearchService` → `GET /workflow/size`), so a
`DashboardEntry` built straight from a duplicate response carried no
size and rendered as an empty workflow beside correctly-sized siblings.
Both duplicate paths now fetch the sizes before the rows go on screen —
the list items read the size once on binding, so filling it in
afterwards would not show.

**The two detail cards disagreed with each other.** The dataset Data
Card left "Last updated" and "Latest version file" blank; the model
Model Card em-dashed them *and* its size. Now both pages em-dash the
version facts and both render `0 B` for the size.

`formatSize` is deliberately unchanged.

This is a `feat` rather than a `fix`: it is a deliberate, user-facing
change to how these fields render, and it touches the model detail page,
which does not exist on the release branches — so it should not be
backported.

**Before** — no size line in card view, `0 B` in list view, a fresh copy
claiming `0 B`, and the two detail cards disagreeing:

<img width="1440" height="900" alt="issue4-1-datasets-card-view-before"
src="https://github.com/user-attachments/assets/5afd125b-f1e3-49b6-b782-6c0657773e9e";
/>
<img width="1440" height="900" alt="issue4-2-datasets-list-view-before"
src="https://github.com/user-attachments/assets/edcca435-c936-4049-8a0b-65d43dfabf71";
/>
<img width="1440" height="900" alt="issue4-7-duplicated-workflow-before"
src="https://github.com/user-attachments/assets/04e02e80-d232-4dec-99bc-35126c4db916";
/>
<img width="1440" height="900" alt="issue4-3-empty-dataset-stats-before"
src="https://github.com/user-attachments/assets/90a00ca4-11a7-428c-88b4-7024899090eb";
/>


**After** — card view reads `0 B` like list view, the copy reports its
real size, and both detail
cards read the same:

<img width="1440" height="900" alt="issue4-1-datasets-card-view-after"
src="https://github.com/user-attachments/assets/2d7f4121-b52e-4269-b773-5ba6012e1961";
/>
<img width="1440" height="900" alt="issue4-7-duplicated-workflow-after"
src="https://github.com/user-attachments/assets/2520ff1a-fbb8-4211-b616-32b7086a3946";
/>
<img width="1440" height="900" alt="issue4-3-empty-dataset-stats-after"
src="https://github.com/user-attachments/assets/ace12205-b959-4658-b568-d9be8a89fcef";
/>
<img width="1440" height="900" alt="issue4-4-empty-model-stats-after"
src="https://github.com/user-attachments/assets/496ecdf4-d6d1-459f-9922-c70c6da9b38a";
/>

### Any related issues, documentation, discussions?

Closes #8380.

### How was this PR tested?

Specs added:

- `card-item.component.spec.ts` — `still reports an empty resource's
size, so card and list view
agree`, asserting the row renders and reads `0 B` at size 0. 80 passed.
- `user-workflow.component.spec.ts` — `asks for the copy's size, which
the duplicate response does
not carry`, asserting `getSizes` is called with the new wid and the
entry takes that size.
  74 passed.
- `dataset-detail.component.spec.ts` — `em-dashes the facts a dataset
with no versions has none of`
and `shows the real facts once a version exists`, covering both legs of
each stat. 144 passed.
- `model-detail.component.spec.ts` — the same case for the model card,
pinning "—" for the version
  facts and `0 B` for the size. 80 passed.
- `StubWorkflowPersistService` gained a `getSizes` so the duplicate
specs exercise the new call.

One existing model spec, `dashes out the latest-version facts for a
model with no versions`, asserted
the card contained no `0 B` — it pinned the old model-only convention
and is superseded by the new
per-field case, so it was removed rather than edited.

```
cd frontend
npx ng test --include 
src/app/dashboard/component/user/list-item/card-item/card-item.component.spec.ts
npx ng test --include 
src/app/dashboard/component/user/user-workflow/user-workflow.component.spec.ts
npx ng test --include 
src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts
npx ng test --include 
src/app/dashboard/component/user/user-model/user-model-explorer/model-detail.component.spec.ts
```

Checked by hand against a local stack: an empty dataset reads `0 B` in
both views, the dataset and
model cards both show `—` for the version facts and `0 B` for the size,
and a freshly copied workflow
reports 109.00 B like its siblings instead of 0 B.

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

Generated-by: Claude Code (Opus 5)

Report URL: https://github.com/apache/texera/actions/runs/33813908943

With regards,
GitHub Actions via GitBox

Reply via email to