Skip to content

feat: Automatically select new dataset upon creation#348

Open
artkuo wants to merge 2 commits into
automeris-io:masterfrom
artkuo:select-new-dataset
Open

feat: Automatically select new dataset upon creation#348
artkuo wants to merge 2 commits into
automeris-io:masterfrom
artkuo:select-new-dataset

Conversation

@artkuo

@artkuo artkuo commented Jun 18, 2026

Copy link
Copy Markdown

Automatically selects the newly created dataset once a user adds a new dataset. If the user adds multiple datasets, the first of the newly added datasets is automatically selected.

Motivation

I often found myself accidentally adding new data points to the previously active dataset rather than the newly created one. Automatically switching the selection to the new dataset matches user expectation and makes the workflow more ergonomic.

Technical Changes

In datasetManagement.js:

  • Replaced wpd.tree.refreshPreservingSelection() in addSingleDataset() with a call to wpd.tree.refresh() and wpd.tree.selectPath() targeting the new dataset.
  • Modified addMultipleDatasets() to track the first new dataset that gets created, and select its path after the tree is refreshed.

Verification (Manual Testing)

I manually tested the behavior locally in the UI:

  • Single Dataset: Verified that adding a single dataset closes the popup and automatically selects and activates the new dataset in the sidebar tree.
  • Multiple Datasets: Verified that adding multiple datasets (e.g., 3 datasets) closes the popup and automatically selects the first of the newly created datasets.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant