Use welcome view when the extension can't show TreeView
Problem to solve
There are several scenarios when the extension can't do any useful work:
- New VS Code window (no workspace is open)
- None of the open workspaces contains a configured GitLab project
- The personal access token hasn't been set up
- There workspace folder doesn't have initialized git repository #321 (closed)
For example, attempt to use the extension when there is no open project now results in an error message:
Proposal
Utilise the Welcome view available in for VS Code extensions:
Scenario 1: No token
Hey. Welcome to the GitLab Workflow extension. It seems that you have not yet set up your access token.
If you use GitLab.com, click [here](https://gitlab.com/profile/personal_access_tokens). If you have a self-managed GitLab, then:
1. Go to 'Settings'
2. Click 'Access Tokens' on the left navigation menu
3. Click on 'Add a personal access token'
Now you can set your token by clicking on the following button
[Set Personal Access Token](command:gl.setToken)
To learn more, please [read our docs](https://gitlab.com/gitlab-org/gitlab-vscode-extension#setup).
-
mention that the token needs read_user
andapi
scopes to fix #230 (closed)
Once this scenario is implemented, we should not show the "add token" info message during every extension startup. It was bothering users: #279 (closed)
Scenario 2: No GitLab project
It seems like your current workspace doesn't contain a GitLab project (or the project has been moved).
Scenario 3: No open project
In order to use the GitLab Worfklow extension, please open a folder containing a GitLab project.
[Open GitLab project folder](command:vscode.open)
Further details
There is a small POC implemented in welcome-poc
branch.
Examples
extension | screenshot |
---|---|
source control (no open workspace) | |
source control (no git repository) | |
debugger |
Edited by Tomas Vik (OOO back on 2024-09-23)