Skip to content

Commit 963f831

Browse files
authored
Initially expand commit entries in the experiments tree (#2996)
1 parent 3ff46ed commit 963f831

File tree

1 file changed

+12
-3
lines changed
  • extension/src/experiments/model

1 file changed

+12
-3
lines changed

extension/src/experiments/model/tree.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ export class ExperimentsTree
182182
private formatExperiment(experiment: ExperimentAugmented, dvcRoot: string) {
183183
return {
184184
collapsibleState: experiment.hasChildren
185-
? this.getCollapsibleState(experiment.displayNameOrParent)
185+
? this.getInitialCollapsibleState(
186+
experiment.type,
187+
experiment.displayNameOrParent
188+
)
186189
: TreeItemCollapsibleState.None,
187190
command: {
188191
arguments: [{ dvcRoot, id: experiment.id }],
@@ -234,8 +237,14 @@ export class ExperimentsTree
234237
this.expandedExperiments[description] = expanded
235238
}
236239

237-
private getCollapsibleState(description?: string) {
238-
if (description && this.expandedExperiments[description]) {
240+
private getInitialCollapsibleState(
241+
type: ExperimentType,
242+
description?: string
243+
) {
244+
if (
245+
(description && this.expandedExperiments[description]) ||
246+
type === ExperimentType.BRANCH
247+
) {
239248
return TreeItemCollapsibleState.Expanded
240249
}
241250
return TreeItemCollapsibleState.Collapsed

0 commit comments

Comments
 (0)