Adds an empty state to the Commit Graph when no repository is open#5510
Conversation
🤖 Augment PR SummarySummary: Makes the Commit Graph reachable and useful when no Git repository is available by showing an in-view empty state instead of hiding the view/commands. Changes:
Technical Notes: The empty state is rendered in the Graph app when 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Pull request overview
Adds a “no repository open” empty-state experience for the Commit Graph and ensures the Graph view/commands remain reachable even when GitLens is in its gitlens:disabled (no repos) context.
Changes:
- Adds a Graph empty-state overlay with appropriate actions (desktop: Open Folder / Clone / Init; web: Open Folder / Open Remote Repository).
- Surfaces Graph commands in the Command Palette even when no repository is open, and keeps the Graph view available in that state.
- Removes the redundant “No repository detected” notification when opening the Graph, relying on the in-view empty state instead.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/webviews/plus/graph/protocol.ts | Extends the Graph webview state to include an isWeb flag for environment-specific empty-state actions. |
| src/webviews/plus/graph/graphWebview.ts | Sends empty-state Graph state when no repositories exist; now includes isWeb. |
| src/webviews/apps/plus/graph/stateProvider.ts | Plumbs isWeb into the reactive webview state. |
| src/webviews/apps/plus/graph/graph-app.ts | Renders the new empty-state overlay when repositories is empty. |
| src/webviews/apps/plus/graph/empty-state.ts | New Lit component implementing the empty-state UI and command actions. |
| src/commands/showView.ts | Avoids the “No repository detected” toast for the Graph and waits only for discovery. |
| package.json | Updates generated contributions so the Graph view is not hidden by gitlens:disabled. |
| contributions.json | Ensures Graph commands appear in Command Palette even with no repo; updates Graph view when clause. |
| CHANGELOG.md | Documents the new Commit Graph empty state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Adds an in-view empty state with Open a Folder, Clone a Repository, and Start a New Project actions; in web/virtual workspaces (e.g. vscode.dev) clone and new-project are replaced by Open Remote Repository - Makes the Commit Graph reachable when no repository is open — keeps the graph view available and surfaces the Show Commit Graph commands in the Command Palette - Skips the redundant "No repository detected" notification when opening the graph, since the in-view empty state now provides the guidance
2d5b280 to
2b4fc74
Compare
Description
Adds an empty state to the Commit Graph shown when no repository is open, guiding users to get started. Closes #5408.
isWebflag surfaced from the host).gitlens:disabledwhen there are zero repositories, which previously hid the graph view and filtered the Show Commit Graph commands out of the Command Palette. The graph view now stays available with no repo, and theShow Commit Graph/…in Editor/…Viewcommands are surfaced in the palette (matchingShow Home View), so the empty state is reachable via both the editor page and the bottom panel.Testing
Verified live in the Extension Development Host with no repository open:
isWebshows Open a Folder + Open Remote Repository.git.clonequick input); reactive transition works (opening a repo hides the overlay and renders the graph, closing it restores the empty state).