tanishqgandhi1908 opened a new pull request, #8347:
URL: https://github.com/apache/texera/pull/8347
### What changes were proposed in this PR?
Every file path on a dataset's detail page embeds the dataset name, and
preview and single-file
download resolve a dataset by (owner, name). `onSaveDatasetName()` updated
the displayed name and
nothing else, so after a rename the page kept serving the old paths: the
file tree and the path above
the preview still said the old name, clicking a file hung on "File content
is loading" (404, then
500), and the Data Card's "Latest version file" was stale too. Only a reload
recovered.
The same rename was also allowed while an upload was running. The upload is
addressed by the name it
started with, so the data uploaded fine and then the completing call failed
with
`400 {"code":400,"message":"Dataset not found"}`, leaving the panel on
"Uploading: 1 file(s)" forever
and a row behind in `dataset_upload_session`.
- `dataset-detail.component.ts` — after a successful rename, refetch the
browsed version's file tree
and the Data Card's latest-version facts. The selected version is kept
deliberately;
`retrieveDatasetVersionList()` would also refresh both but resets the
picker to the newest version,
which a rename is no reason to do.
- `dataset-detail.component.ts` / `.html` — bind the uploader's existing
`uploadsInFlightChange`,
disable the name field and Save while an upload is running, show a hint
saying why, and guard
`onSaveDatasetName()` on the same invariant.
Note the browsed file resets to the version's first file after a rename,
because the dataset page
does not track the open file's relative path the way the model page does.
That is a small change in
behaviour from a page that was previously broken; tracking the open path can
follow separately if it
is worth it.
**Before** — renamed, but the path still says `sensor-readings` and the
preview hangs (console output
overlaid so it fits in one screenshot); the Data Card keeps the old path too:
<img width="1440" height="900" alt="image"
src="https://github.com/user-attachments/assets/330c06d6-a65a-409c-bf80-53b46c4d334c"
/>
<img width="1440" height="900" alt="image"
src="https://github.com/user-attachments/assets/53da25ab-2220-45f3-96c0-6f7012202bc0"
/>
**After** — the path and the Data Card both follow the new name, and the
file opens:
<!-- attach issue2-2-stale-tree-after.png -->
<!-- attach issue2-4-data-card-after.png -->
**After** — renaming is blocked while an upload is in flight:
<img width="1440" height="900" alt="image"
src="https://github.com/user-attachments/assets/7b0a7540-82fe-4403-8de3-eb9e2dae119b"
/>
### Any related issues, documentation, discussions?
Closes #8345.
### How was this PR tested?
Three cases added to `dataset-detail.component.spec.ts`:
- `refetches the file tree and the latest-version facts, which both embed
the old name` — asserts both
fetches happen with the browsed `dvid`, and that the selected version is
unchanged. Removing the
two refresh calls fails this test.
- `refuses to rename while an upload is in flight, which would strand it`.
- `locks the name field while an upload is in flight` — drives the real
uploader output through the
rendered template and checks the input and Save button are disabled.
```
cd frontend
npx ng test --include
src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts
# Tests 145 passed (145)
```
Also checked by hand against a local stack, with the file uploads throttled
so the upload stays in
flight: renaming now leaves the tree, the path header and the Data Card all
on the new name and files
still open, and the name field is greyed out with the hint while an upload
runs.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]