Skip to content

Adds an empty state to the Commit Graph when no repository is open#5510

Merged
ianhattendorf merged 1 commit into
mainfrom
5408-empty-graph-state-when-no-repo
Jul 16, 2026
Merged

Adds an empty state to the Commit Graph when no repository is open#5510
ianhattendorf merged 1 commit into
mainfrom
5408-empty-graph-state-when-no-repo

Conversation

@ianhattendorf

@ianhattendorf ianhattendorf commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

Adds an empty state to the Commit Graph shown when no repository is open, guiding users to get started. Closes #5408.

  • Empty-state overlay with a primary Open a Folder action and secondary Clone a Repository / Start a New Project actions. In web/virtual workspaces (e.g. vscode.dev), clone and new-project are replaced by a single Open Remote Repository action (driven by an isWeb flag surfaced from the host).
  • Reachability when no repo: GitLens marks itself gitlens:disabled when 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 the Show Commit Graph / …in Editor / …View commands are surfaced in the palette (matching Show Home View), so the empty state is reachable via both the editor page and the bottom panel.
  • Removes the redundant "No repository detected" notification when opening the graph — the in-view empty state now provides the guidance.
image

Testing

Verified live in the Extension Development Host with no repository open:

  • Empty state renders in both the editor page and the bottom-panel view; desktop shows the three actions, isWeb shows Open a Folder + Open Remote Repository.
  • Buttons execute their commands end-to-end (e.g. Clone → git.clone quick input); reactive transition works (opening a repo hides the overlay and renders the graph, closing it restores the empty state).
  • All Show Commit Graph commands appear in the Command Palette with no repo, and no "No repository detected" toast is shown.

@augmentcode

augmentcode Bot commented Jul 16, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: 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:

  • Adds a <gl-graph-empty-state> overlay with “Open a Folder” plus secondary actions (Clone / Init on desktop; Open Remote Repository on web).
  • Keeps the Graph view contributed/visible even when GitLens marks itself gitlens:disabled due to zero repositories.
  • Surfaces “Show Commit Graph” commands in the Command Palette regardless of repository presence.
  • Removes the redundant “No repository detected” notification when opening the Graph view and instead waits for repo discovery to complete.
  • Plumbs an isWeb flag from the host into the graph webview state and protocol for environment-specific empty-state actions.
  • Updates generated contributions/package metadata and the changelog accordingly.

Technical Notes: The empty state is rendered in the Graph app when repositories.length === 0 and uses command URIs for the actions.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/webviews/plus/graph/graphWebview.ts
Comment thread CHANGELOG.md Outdated


- 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
@ianhattendorf ianhattendorf force-pushed the 5408-empty-graph-state-when-no-repo branch from 2d5b280 to 2b4fc74 Compare July 16, 2026 01:10
@ianhattendorf ianhattendorf merged commit f6bbdc9 into main Jul 16, 2026
6 checks passed
@ianhattendorf ianhattendorf deleted the 5408-empty-graph-state-when-no-repo branch July 16, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty Graph State when No Repo

2 participants