Skip to content

Commit

Permalink
Add command to disable timeline grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
mullr committed Nov 7, 2023
1 parent d3b440b commit 7fd0db8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
3 changes: 2 additions & 1 deletion vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ This extension contributes the following settings:

- Start the background build process: `npm run watch`
- Regenerate the api stubs: `npm run codegen`
- Do typechecking: `npm lint`
- Do typechecking: `npm run lint`
- Fix formatting, some type stuff: `npm run fix`
18 changes: 14 additions & 4 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,19 @@
"group": "navigation@1"
},
{
"command": "auxon.timelines.groupTimelinesByNameComponents",
"command": "auxon.timelines.disableTimelineGrouping",
"when": "view == auxon.timelines",
"group": "7_modification@1"
},
{
"command": "auxon.timelines.setGroupingAttrs",
"when": "view == auxon.timelines",
"group": "7_modification@1"
"group": "7_modification@2"
},
{
"command": "auxon.timelines.groupTimelinesByNameComponents",
"when": "view == auxon.timelines",
"group": "7_modification@3"
},
{
"command": "auxon.events.refresh",
Expand Down Expand Up @@ -250,15 +255,20 @@
"icon": "$(refresh)"
},
{
"command": "auxon.timelines.groupTimelinesByNameComponents",
"title": "Group timelines by name components",
"command": "auxon.timelines.disableTimelineGrouping",
"title": "Show timelines in flat list",
"icon": "$(refresh)"
},
{
"command": "auxon.timelines.setGroupingAttrs",
"title": "Group timelines by attribute",
"icon": "$(refresh)"
},
{
"command": "auxon.timelines.groupTimelinesByNameComponents",
"title": "Group timelines by name components",
"icon": "$(refresh)"
},
{
"command": "auxon.timelines.inspect",
"title": "Inspect Timeline"
Expand Down
13 changes: 11 additions & 2 deletions vscode/src/timelines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ export class TimelinesTreeDataProvider implements vscode.TreeDataProvider<Timeli
vscode.commands.registerCommand("auxon.timelines.transitionGraphForSelection", () =>
this.transitionGraphForSelection()
),
vscode.commands.registerCommand("auxon.timelines.disableTimelineGrouping", () =>
this.disableTimelineGrouping()
),
vscode.commands.registerCommand("auxon.timelines.setGroupingAttrs", () => this.setGroupingAttrs()),
vscode.commands.registerCommand("auxon.timelines.groupTimelinesByNameComponents", () =>
this.groupTimelinesByNameComponents()
Expand Down Expand Up @@ -199,9 +202,9 @@ export class TimelinesTreeDataProvider implements vscode.TreeDataProvider<Timeli
});
}

groupTimelinesByNameComponents() {
async disableTimelineGrouping() {
this.workspaceState.setGroupingAttrKeys([]);
this.workspaceState.setGroupByTimelineNameComponents(true);
this.workspaceState.setGroupByTimelineNameComponents(false);
this.refresh();
}

Expand All @@ -219,6 +222,12 @@ export class TimelinesTreeDataProvider implements vscode.TreeDataProvider<Timeli
this.refresh();
}

groupTimelinesByNameComponents() {
this.workspaceState.setGroupingAttrKeys([]);
this.workspaceState.setGroupByTimelineNameComponents(true);
this.refresh();
}

async getAvailableTimelineAttrKeys(): Promise<string[]> {
switch (this.usedSegmentConfig.type) {
case "All":
Expand Down

0 comments on commit 7fd0db8

Please sign in to comment.