Skip to content

Commit 3b6c9d7

Browse files
authored
Improve experiments table empty states (#1755)
* add rough implementation of improved experiments table empty state * pull out get started component * add integration test * remove title from function args * make code more readable
1 parent 81d4c97 commit 3b6c9d7

File tree

26 files changed

+394
-115
lines changed

26 files changed

+394
-115
lines changed

CHANGELOG.md

Lines changed: 116 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,83 +6,161 @@ All notable changes to this project will be documented in this file.
66

77
### 🚀 New Features and Enhancements
88

9-
- Improve user facing text for dvc.runQueuedExperiments [#1751](https://github.com/iterative/vscode-dvc/pull/1751) by [@mattseddon](https://github.com/mattseddon)
10-
- Add manual refresh button to missing plots [#1754](https://github.com/iterative/vscode-dvc/pull/1754) by [@mattseddon](https://github.com/mattseddon)
11-
- Add option to hide a column from the experiments table [#1756](https://github.com/iterative/vscode-dvc/pull/1756) by [@wolmir](https://github.com/wolmir)
9+
- Improve user facing text for dvc.runQueuedExperiments
10+
[#1751](https://github.com/iterative/vscode-dvc/pull/1751) by
11+
[@mattseddon](https://github.com/mattseddon)
12+
- Add manual refresh button to missing plots
13+
[#1754](https://github.com/iterative/vscode-dvc/pull/1754) by
14+
[@mattseddon](https://github.com/mattseddon)
15+
- Add option to hide a column from the experiments table
16+
[#1756](https://github.com/iterative/vscode-dvc/pull/1756) by
17+
[@wolmir](https://github.com/wolmir)
1218

1319
### 🐛 Bug Fixes
1420

15-
- Prevent queued experiments from being selected via the experiments table [#1753](https://github.com/iterative/vscode-dvc/pull/1753) by [@mattseddon](https://github.com/mattseddon)
16-
- Fix timing of comparison table renders [#1759](https://github.com/iterative/vscode-dvc/pull/1759) by [@mattseddon](https://github.com/mattseddon)
17-
- Fix overflow of zoomed in plots not shown [#1763](https://github.com/iterative/vscode-dvc/pull/1763) by [@sroy3](https://github.com/sroy3)
18-
- Fix drop target moving away when picking up an item [#1762](https://github.com/iterative/vscode-dvc/pull/1762) by [@sroy3](https://github.com/sroy3)
21+
- Prevent queued experiments from being selected via the experiments table
22+
[#1753](https://github.com/iterative/vscode-dvc/pull/1753) by
23+
[@mattseddon](https://github.com/mattseddon)
24+
- Fix timing of comparison table renders
25+
[#1759](https://github.com/iterative/vscode-dvc/pull/1759) by
26+
[@mattseddon](https://github.com/mattseddon)
27+
- Fix overflow of zoomed in plots not shown
28+
[#1763](https://github.com/iterative/vscode-dvc/pull/1763) by
29+
[@sroy3](https://github.com/sroy3)
30+
- Fix drop target moving away when picking up an item
31+
[#1762](https://github.com/iterative/vscode-dvc/pull/1762) by
32+
[@sroy3](https://github.com/sroy3)
1933

2034
### 🔨 Maintenance
2135

22-
- Publish extension to Open VSX via publish action [#1758](https://github.com/iterative/vscode-dvc/pull/1758) by [@mattseddon](https://github.com/mattseddon)
36+
- Publish extension to Open VSX via publish action
37+
[#1758](https://github.com/iterative/vscode-dvc/pull/1758) by
38+
[@mattseddon](https://github.com/mattseddon)
2339

2440
## [0.2.17] - 2022-05-22
2541

2642
### 🚀 New Features and Enhancements
2743

28-
- Plot list virtualization [#1707](https://github.com/iterative/vscode-dvc/pull/1707) by [@sroy3](https://github.com/sroy3)
29-
- Prevent native context menu from being invoked on webviews [#1736](https://github.com/iterative/vscode-dvc/pull/1736) by [@rogermparent](https://github.com/rogermparent)
30-
- Rework experiment commands and context menus to vary based on whether experiments have checkpoints [#1738](https://github.com/iterative/vscode-dvc/pull/1738) by [@mattseddon](https://github.com/mattseddon)
31-
- Rework experiment table context menus to vary based on whether or not experiments have checkpoints [#1739](https://github.com/iterative/vscode-dvc/pull/1739) by [@mattseddon](https://github.com/mattseddon)
32-
- Make size of comparison table column more consistent [#1744](https://github.com/iterative/vscode-dvc/pull/1744) by [@sroy3](https://github.com/sroy3)
33-
- Add drag and drop for experiment table column groups [#1729](https://github.com/iterative/vscode-dvc/pull/1729) by [@wolmir](https://github.com/wolmir)
34-
- Show experiment names in comparison table headers (#1614) [#1730](https://github.com/iterative/vscode-dvc/pull/1730) by [@wolmir](https://github.com/wolmir)
35-
- Add experiment icons to editor/title when params file is open [#1740](https://github.com/iterative/vscode-dvc/pull/1740) by [@mattseddon](https://github.com/mattseddon)
36-
- Remove extra padding in plots [#1749](https://github.com/iterative/vscode-dvc/pull/1749) by [@sroy3](https://github.com/sroy3)
44+
- Plot list virtualization
45+
[#1707](https://github.com/iterative/vscode-dvc/pull/1707) by
46+
[@sroy3](https://github.com/sroy3)
47+
- Prevent native context menu from being invoked on webviews
48+
[#1736](https://github.com/iterative/vscode-dvc/pull/1736) by
49+
[@rogermparent](https://github.com/rogermparent)
50+
- Rework experiment commands and context menus to vary based on whether
51+
experiments have checkpoints
52+
[#1738](https://github.com/iterative/vscode-dvc/pull/1738) by
53+
[@mattseddon](https://github.com/mattseddon)
54+
- Rework experiment table context menus to vary based on whether or not
55+
experiments have checkpoints
56+
[#1739](https://github.com/iterative/vscode-dvc/pull/1739) by
57+
[@mattseddon](https://github.com/mattseddon)
58+
- Make size of comparison table column more consistent
59+
[#1744](https://github.com/iterative/vscode-dvc/pull/1744) by
60+
[@sroy3](https://github.com/sroy3)
61+
- Add drag and drop for experiment table column groups
62+
[#1729](https://github.com/iterative/vscode-dvc/pull/1729) by
63+
[@wolmir](https://github.com/wolmir)
64+
- Show experiment names in comparison table headers (#1614)
65+
[#1730](https://github.com/iterative/vscode-dvc/pull/1730) by
66+
[@wolmir](https://github.com/wolmir)
67+
- Add experiment icons to editor/title when params file is open
68+
[#1740](https://github.com/iterative/vscode-dvc/pull/1740) by
69+
[@mattseddon](https://github.com/mattseddon)
70+
- Remove extra padding in plots
71+
[#1749](https://github.com/iterative/vscode-dvc/pull/1749) by
72+
[@sroy3](https://github.com/sroy3)
3773

3874
### 🐛 Bug Fixes
3975

40-
- Fix pinning missing plot [#1742](https://github.com/iterative/vscode-dvc/pull/1742) by [@sroy3](https://github.com/sroy3)
76+
- Fix pinning missing plot
77+
[#1742](https://github.com/iterative/vscode-dvc/pull/1742) by
78+
[@sroy3](https://github.com/sroy3)
4179

4280
### 🔨 Maintenance
4381

44-
- Mock VS Code before importing modules in scheduled cli output test [#1737](https://github.com/iterative/vscode-dvc/pull/1737) by [@mattseddon](https://github.com/mattseddon)
45-
- Mock VS Code before importing modules in venv setup [#1747](https://github.com/iterative/vscode-dvc/pull/1747) by [@mattseddon](https://github.com/mattseddon)
46-
- Remove can select many property from selection trees [#1748](https://github.com/iterative/vscode-dvc/pull/1748) by [@mattseddon](https://github.com/mattseddon)
47-
- Make deeply nested experiments table test fixture static [#1745](https://github.com/iterative/vscode-dvc/pull/1745) by [@mattseddon](https://github.com/mattseddon)
48-
- Add eslint-plugin-etc for no-commented-out-code rule [#1750](https://github.com/iterative/vscode-dvc/pull/1750) by [@mattseddon](https://github.com/mattseddon)
82+
- Mock VS Code before importing modules in scheduled cli output test
83+
[#1737](https://github.com/iterative/vscode-dvc/pull/1737) by
84+
[@mattseddon](https://github.com/mattseddon)
85+
- Mock VS Code before importing modules in venv setup
86+
[#1747](https://github.com/iterative/vscode-dvc/pull/1747) by
87+
[@mattseddon](https://github.com/mattseddon)
88+
- Remove can select many property from selection trees
89+
[#1748](https://github.com/iterative/vscode-dvc/pull/1748) by
90+
[@mattseddon](https://github.com/mattseddon)
91+
- Make deeply nested experiments table test fixture static
92+
[#1745](https://github.com/iterative/vscode-dvc/pull/1745) by
93+
[@mattseddon](https://github.com/mattseddon)
94+
- Add eslint-plugin-etc for no-commented-out-code rule
95+
[#1750](https://github.com/iterative/vscode-dvc/pull/1750) by
96+
[@mattseddon](https://github.com/mattseddon)
4997

5098
## [0.2.16] - 2022-05-18
5199

52100
### 🚀 New Features and Enhancements
53101

54-
- Add plots selection quick pick [#1701](https://github.com/iterative/vscode-dvc/pull/1701) by [@mattseddon](https://github.com/mattseddon)
55-
- Add get started component to plots webview [#1718](https://github.com/iterative/vscode-dvc/pull/1718) by [@mattseddon](https://github.com/mattseddon)
56-
- Add codicons to welcome view buttons [#1717](https://github.com/iterative/vscode-dvc/pull/1717) by [@mattseddon](https://github.com/mattseddon)
57-
- Improve plots welcome view when there are no plots [#1722](https://github.com/iterative/vscode-dvc/pull/1722) by [@mattseddon](https://github.com/mattseddon)
58-
- Update view container welcome views [#1728](https://github.com/iterative/vscode-dvc/pull/1728) by [@mattseddon](https://github.com/mattseddon)
59-
- Add experiment run reset to menus [#1719](https://github.com/iterative/vscode-dvc/pull/1719) by [@mattseddon](https://github.com/mattseddon)
60-
- Bypass filters on missing values (for queued experiments) [#1732](https://github.com/iterative/vscode-dvc/pull/1732) by [@mattseddon](https://github.com/mattseddon)
102+
- Add plots selection quick pick
103+
[#1701](https://github.com/iterative/vscode-dvc/pull/1701) by
104+
[@mattseddon](https://github.com/mattseddon)
105+
- Add get started component to plots webview
106+
[#1718](https://github.com/iterative/vscode-dvc/pull/1718) by
107+
[@mattseddon](https://github.com/mattseddon)
108+
- Add codicons to welcome view buttons
109+
[#1717](https://github.com/iterative/vscode-dvc/pull/1717) by
110+
[@mattseddon](https://github.com/mattseddon)
111+
- Improve plots welcome view when there are no plots
112+
[#1722](https://github.com/iterative/vscode-dvc/pull/1722) by
113+
[@mattseddon](https://github.com/mattseddon)
114+
- Update view container welcome views
115+
[#1728](https://github.com/iterative/vscode-dvc/pull/1728) by
116+
[@mattseddon](https://github.com/mattseddon)
117+
- Add experiment run reset to menus
118+
[#1719](https://github.com/iterative/vscode-dvc/pull/1719) by
119+
[@mattseddon](https://github.com/mattseddon)
120+
- Bypass filters on missing values (for queued experiments)
121+
[#1732](https://github.com/iterative/vscode-dvc/pull/1732) by
122+
[@mattseddon](https://github.com/mattseddon)
61123

62124
### 🐛 Bug Fixes
63125

64-
- Prevent infinite loop when trying to open plots [#1727](https://github.com/iterative/vscode-dvc/pull/1727) by [@mattseddon](https://github.com/mattseddon)
65-
- Fix experiment stop button [#1731](https://github.com/iterative/vscode-dvc/pull/1731) by [@mattseddon](https://github.com/mattseddon)
126+
- Prevent infinite loop when trying to open plots
127+
[#1727](https://github.com/iterative/vscode-dvc/pull/1727) by
128+
[@mattseddon](https://github.com/mattseddon)
129+
- Fix experiment stop button
130+
[#1731](https://github.com/iterative/vscode-dvc/pull/1731) by
131+
[@mattseddon](https://github.com/mattseddon)
66132

67133
### 🔨 Maintenance
68134

69-
- Rearrange internals of base workspace webviews [#1706](https://github.com/iterative/vscode-dvc/pull/1706) by [@mattseddon](https://github.com/mattseddon)
135+
- Rearrange internals of base workspace webviews
136+
[#1706](https://github.com/iterative/vscode-dvc/pull/1706) by
137+
[@mattseddon](https://github.com/mattseddon)
70138

71139
## [0.2.15] - 2022-05-13
72140

73141
### 🚀 New Features and Enhancements
74142

75-
- Use contributed colors for some webview colors [#1697](https://github.com/iterative/vscode-dvc/pull/1697) by [@rogermparent](https://github.com/rogermparent)
143+
- Use contributed colors for some webview colors
144+
[#1697](https://github.com/iterative/vscode-dvc/pull/1697) by
145+
[@rogermparent](https://github.com/rogermparent)
76146

77147
### 🐛 Bug Fixes
78148

79-
- Do not reset deferred property when consumers are still waiting [#1695](https://github.com/iterative/vscode-dvc/pull/1695) by [@mattseddon](https://github.com/mattseddon)
80-
- Add placeholder when image is missing from comparison table data [#1699](https://github.com/iterative/vscode-dvc/pull/1699) by [@mattseddon](https://github.com/mattseddon)
149+
- Do not reset deferred property when consumers are still waiting
150+
[#1695](https://github.com/iterative/vscode-dvc/pull/1695) by
151+
[@mattseddon](https://github.com/mattseddon)
152+
- Add placeholder when image is missing from comparison table data
153+
[#1699](https://github.com/iterative/vscode-dvc/pull/1699) by
154+
[@mattseddon](https://github.com/mattseddon)
81155

82156
### 🔨 Maintenance
83157

84-
- Move init command from tracked tree into the extension [#1696](https://github.com/iterative/vscode-dvc/pull/1696) by [@mattseddon](https://github.com/mattseddon)
85-
- Add create release pr workflow [#1685](https://github.com/iterative/vscode-dvc/pull/1685) by [@mattseddon](https://github.com/mattseddon)
158+
- Move init command from tracked tree into the extension
159+
[#1696](https://github.com/iterative/vscode-dvc/pull/1696) by
160+
[@mattseddon](https://github.com/mattseddon)
161+
- Add create release pr workflow
162+
[#1685](https://github.com/iterative/vscode-dvc/pull/1685) by
163+
[@mattseddon](https://github.com/mattseddon)
86164

87165
## [0.2.14] - 2022-05-12
88166

extension/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,12 @@
436436
"category": "DVC",
437437
"icon": "$(list-selection)"
438438
},
439+
{
440+
"title": "%command.views.experimentsColumnsTree.selectColumns%",
441+
"command": "dvc.views.experimentsColumnsTree.selectColumns",
442+
"category": "DVC",
443+
"icon": "$(list-selection)"
444+
},
439445
{
440446
"title": "%command.views.experimentsTree.autoApplyFilters%",
441447
"command": "dvc.views.experimentsTree.autoApplyFilters",
@@ -697,6 +703,10 @@
697703
"command": "dvc.stopRunningExperiment",
698704
"when": "dvc.commands.available && dvc.project.available && dvc.runner.running"
699705
},
706+
{
707+
"command": "dvc.views.experimentsColumnsTree.selectColumns",
708+
"when": "dvc.commands.available && dvc.project.available"
709+
},
700710
{
701711
"command": "dvc.views.experimentsTree.applyExperiment",
702712
"when": "false"
@@ -1059,6 +1069,16 @@
10591069
"when": "view == dvc.views.experimentsTree && !dvc.experiments.webviewActive",
10601070
"group": "navigation@1"
10611071
},
1072+
{
1073+
"command": "dvc.views.experimentsColumnsTree.selectColumns",
1074+
"when": "view == dvc.views.experimentsColumnsTree",
1075+
"group": "navigation@2"
1076+
},
1077+
{
1078+
"command": "dvc.views.experimentsColumnsTree.selectColumns",
1079+
"group": "inline",
1080+
"when": "view == dvc.views.experimentsColumnsTree && dvc.commands.available && viewItem == dvcRoot"
1081+
},
10621082
{
10631083
"command": "dvc.runExperiment",
10641084
"when": "view == dvc.views.experimentsTree && !dvc.experiments.webviewActive && !dvc.runner.running && !dvc.experiment.checkpoints",

extension/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"command.showOutput": "Show DVC Output",
5353
"command.showPlots": "Show Plots",
5454
"command.stopRunningExperiment": "Stop Running Experiment",
55+
"command.views.experimentsColumnsTree.selectColumns": "Select Columns to Display in the Experiments Table",
5556
"command.views.experimentsFilterByTree.removeAllFilters": "Remove All Filters From Experiments Table",
5657
"command.views.experimentsFilterByTree.removeFilter": "Remove Filter From Experiments Table",
5758
"command.views.experimentsSortByTree.removeAllSorts": "Remove All Sorts From Experiments Table",

extension/src/commands/external.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export enum RegisteredCliCommands {
2727

2828
export enum RegisteredCommands {
2929
EXPERIMENT_AUTO_APPLY_FILTERS = 'dvc.views.experimentsTree.autoApplyFilters',
30+
EXPERIMENT_COLUMNS_SELECT = 'dvc.views.experimentsColumnsTree.selectColumns',
3031
EXPERIMENT_DISABLE_AUTO_APPLY_FILTERS = 'dvc.views.experimentsTree.disableAutoApplyFilters',
3132
EXPERIMENT_FILTER_ADD = 'dvc.addExperimentsTableFilter',
3233
EXPERIMENT_FILTER_REMOVE = 'dvc.views.experimentsFilterByTree.removeFilter',

extension/src/experiments/columns/model.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ export class ColumnsModel extends PathSelectionModel<Column> {
7777
)
7878
}
7979

80+
public hasColumns() {
81+
return this.data.length > 0
82+
}
83+
8084
private async transformAndSetColumns(data: ExperimentsOutput) {
8185
const [columns, paramsFiles] = await Promise.all([
8286
collectColumns(data),

extension/src/experiments/commands/register.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ const registerExperimentQuickPickCommands = (
131131
RegisteredCommands.EXPERIMENT_SELECT,
132132
(dvcRoot?: string) => experiments.selectExperiments(dvcRoot)
133133
)
134+
135+
internalCommands.registerExternalCommand(
136+
RegisteredCommands.EXPERIMENT_COLUMNS_SELECT,
137+
(dvcRoot?: string) => experiments.selectColumns(dvcRoot)
138+
)
134139
}
135140

136141
const registerExperimentRunCommands = (

extension/src/experiments/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { getInput } from '../vscode/inputBox'
3636
import { createTypedAccumulator } from '../util/object'
3737
import { setContextValue } from '../vscode/context'
3838
import { standardizePath } from '../fileSystem/path'
39+
import { pickPaths } from '../path/selection/quickPick'
3940

4041
export const ExperimentsScale = {
4142
...ColumnType,
@@ -267,6 +268,18 @@ export class Experiments extends BaseRepository<TableData> {
267268
return this.notifyChanged()
268269
}
269270

271+
public async selectColumns() {
272+
const columns = this.columns.getTerminalNodes()
273+
274+
const selected = await pickPaths('columns', columns)
275+
if (!selected) {
276+
return
277+
}
278+
279+
this.columns.setSelected(selected)
280+
return this.notifyChanged()
281+
}
282+
270283
public async autoApplyFilters(useFilters: boolean) {
271284
this.experiments.setSelectionMode(useFilters)
272285

@@ -398,6 +411,7 @@ export class Experiments extends BaseRepository<TableData> {
398411
columnWidths: this.columns.getColumnWidths(),
399412
columns: this.columns.getSelected(),
400413
hasCheckpoints: this.hasCheckpoints(),
414+
hasColumns: this.columns.hasColumns(),
401415
rows: this.experiments.getRowData(),
402416
sorts: this.experiments.getSorts()
403417
}
@@ -444,6 +458,8 @@ export class Experiments extends BaseRepository<TableData> {
444458

445459
case MessageFromWebviewType.REMOVE_EXPERIMENT:
446460
return this.removeExperiment(message.payload)
461+
case MessageFromWebviewType.SELECT_COLUMNS:
462+
return this.setColumnsStatus()
447463
default:
448464
Logger.error(`Unexpected message: ${JSON.stringify(message)}`)
449465
}
@@ -478,6 +494,15 @@ export class Experiments extends BaseRepository<TableData> {
478494
)
479495
}
480496

497+
private setColumnsStatus() {
498+
this.selectColumns()
499+
sendTelemetryEvent(
500+
EventName.VIEWS_EXPERIMENTS_TABLE_SELECT_COLUMNS,
501+
undefined,
502+
undefined
503+
)
504+
}
505+
481506
private addColumnSort(sort: SortDefinition) {
482507
this.experiments.addSort(sort)
483508
sendTelemetryEvent(

extension/src/experiments/webview/contract.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export type TableData = {
4949
columns: Column[]
5050
columnWidths: Record<string, number>
5151
hasCheckpoints: boolean
52+
hasColumns: boolean
5253
rows: Row[]
5354
sorts: SortDefinition[]
5455
}

extension/src/experiments/workspace.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ export class WorkspaceExperiments extends BaseWorkspaceWebviews<
101101
return this.getRepository(dvcRoot).selectExperiments()
102102
}
103103

104+
public async selectColumns(overrideRoot?: string) {
105+
const dvcRoot = await this.getDvcRoot(overrideRoot)
106+
if (!dvcRoot) {
107+
return
108+
}
109+
return this.getRepository(dvcRoot).selectColumns()
110+
}
111+
104112
public async autoApplyFilters(enable: boolean, overrideRoot?: string) {
105113
const dvcRoot = await this.getDvcRoot(overrideRoot)
106114
if (!dvcRoot) {

0 commit comments

Comments
 (0)