From 396239621dab502002ba8590bfe8df4b4b1b69b1 Mon Sep 17 00:00:00 2001 From: Jonathan Carter Date: Fri, 29 May 2020 09:38:04 -0700 Subject: [PATCH] Always show tree view --- CHANGELOG.md | 4 ++++ package.json | 8 +++++++- src/tree/index.ts | 4 ++-- src/tree/nodes.ts | 11 ----------- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca2dd8a..599c60a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.0.30 (05/28/2020) + +- Changed the `CodeTour` tree to be always visible by default, as long as you have one or more workspaces opened. + ## v0.0.29 (05/27/2020) - Fixed an issue with URI handling on Windows diff --git a/package.json b/package.json index 3874fe6..2fdd74c 100644 --- a/package.json +++ b/package.json @@ -492,10 +492,16 @@ { "id": "codetour.tours", "name": "CodeTour", - "when": "codetour:hasTours || codetour:inTour" + "when": "workspaceFolderCount != 0" } ] }, + "viewsWelcome": [ + { + "view": "codetour.tours", + "contents": "In order to create a guided walkthrough, you can begin recording a tour for the currently opened workspace ([Learn More](https://github.com/vsls-contrib/codetour#recording-tours)).\n\n[Record Tour](command:codetour.recordTour)\n\nYou can also open tours that were shared with you by others ([Learn More](https://github.com/vsls-contrib/codetour#opening-tours)).\n\n[Open Tour File](command:codetour.openTourFile)\n\n[Open Tour URL](command:codetour.openTourUrl)" + } + ], "jsonValidation": [ { "fileMatch": "*.tour", diff --git a/src/tree/index.ts b/src/tree/index.ts index 3ae822a..d822561 100644 --- a/src/tree/index.ts +++ b/src/tree/index.ts @@ -9,7 +9,7 @@ import { } from "vscode"; import { EXTENSION_NAME } from "../constants"; import { store } from "../store"; -import { CodeTourNode, CodeTourStepNode, RecordTourNode } from "./nodes"; +import { CodeTourNode, CodeTourStepNode } from "./nodes"; class CodeTourTreeProvider implements TreeDataProvider, Disposable { private _disposables: Disposable[] = []; @@ -46,7 +46,7 @@ class CodeTourTreeProvider implements TreeDataProvider, Disposable { async getChildren(element?: TreeItem): Promise { if (!element) { if (!store.hasTours && !store.activeTour) { - return [new RecordTourNode()]; + return undefined; } else { const tours = store.tours.map( tour => new CodeTourNode(tour, this.extensionPath) diff --git a/src/tree/nodes.ts b/src/tree/nodes.ts index dd5e5e7..50169a8 100644 --- a/src/tree/nodes.ts +++ b/src/tree/nodes.ts @@ -129,14 +129,3 @@ export class CodeTourStepNode extends TreeItem { this.contextValue = contextValues.join("."); } } - -export class RecordTourNode extends TreeItem { - constructor() { - super("Record new tour..."); - - this.command = { - command: `${EXTENSION_NAME}.recordTour`, - title: "Record Tour" - }; - } -}