From 95f3189d27ae00297807087d0fa6fd9c8792c62e Mon Sep 17 00:00:00 2001
From: Tanishq Gandhi <56472134+tanishqgandhi1908@users.noreply.github.com>
Date: Sun, 20 Sep 2026 23:58:06 -0700
Subject: [PATCH] fix(frontend): remove the clear button from the dataset
version picker (#8343)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
### What changes were proposed in this PR?
The version dropdown on a dataset's detail page carried nzAllowClear, so
clicking the × emitted null into onVersionSelected(version:
DatasetVersion), which read this.selectedVersion.dvid and threw an
uncaught TypeError. The page was left half-cleared: the main pane said
"No version is selected" while the header still showed the cleared
version's file path and the file tree still listed its files.
Clearing the selection is not a meaningful action on a page whose entire
content is one version, so the button goes away. The model detail page
already works this way.
dataset-detail.component.html — drop nzAllowClear from the version
nz-select.
dataset-detail.component.ts — onVersionSelected takes DatasetVersion |
undefined and skips the fetch when there is no dvid, so an empty
selection cannot throw even if the control pushes one (an empty version
list, for instance). Mirrors model-detail.component.ts.
Picking a version behaves exactly as before: same request, same
arguments.
Before — the × in the dropdown, and the page after clicking it (console
output overlaid so it fits in one screenshot):
After — same dropdown hovered, no clear button:
### Any related issues, documentation, discussions?
Closes #8342
### How was this PR tested?
Two cases added to dataset-detail.component.spec.ts:
survives the version select being emptied — onVersionSelected(undefined)
neither throws nor fetches. Without the signature change it does not
compile.
offers no way to empty the selection — the rendered picker has no clear
control.
```
cd frontend
npx ng test --include src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts
# Tests 144 passed (144)
```
Also checked by hand against a local stack: hovering the version
dropdown on a dataset with two versions no longer offers a ×, switching
versions still reloads the file tree and preview, and the console stays
clean.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)
(backported from commit 83e71c2a598451b9e046fdb867a33ab5a8779152)
---
.../dataset-detail.component.html | 1 -
.../dataset-detail.component.spec.ts | 15 +++++++++++++++
.../dataset-detail.component.ts | 6 +++---
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.html b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.html
index 777a1537654..5263213bbb1 100644
--- a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.html
+++ b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.html
@@ -395,7 +395,6 @@