Skip to content

Add File Annotations submenu to the editor gutter context menu#5437

Open
GREFITH wants to merge 1 commit into
gitkraken:mainfrom
GREFITH:feature/2682-gutter-toggle-annotations
Open

Add File Annotations submenu to the editor gutter context menu#5437
GREFITH wants to merge 1 commit into
gitkraken:mainfrom
GREFITH:feature/2682-gutter-toggle-annotations

Conversation

@GREFITH

@GREFITH GREFITH commented Jul 3, 2026

Copy link
Copy Markdown

Summary

Closes #2682.

Adds the existing File Annotations submenu (Toggle File Blame, Toggle File Heatmap, Toggle File Changes, Clear File Annotations) to the editor's line number (gutter) context menu, matching the experience already available via the editor text-area context menu and IDEs like IntelliJ IDEA.

  • Reuses the existing gitlens/editor/annotations submenu rather than duplicating commands
  • Gated by a new gitlens.menus.editorGutter.blame setting (default true), following the same pattern as the existing editorGutter.compare / editorGutter.remote / editorGutter.share settings
  • Added the corresponding checkbox to the Settings UI (General > Menus > Editor Gutter Context Menu)

Test plan

  • pnpm run check (type-aware lint + typecheck) passes
  • pnpm run build (extension host + webviews + unit tests) compiles successfully
  • Verified in a local Extension Development Host: right-clicking the gutter next to a tracked file's line shows the "File Annotations" submenu with Blame/Heatmap/Changes/Clear options
  • Confirmed the new setting can be toggled off via Settings UI to hide the menu item

Copilot AI review requested due to automatic review settings July 3, 2026 13:30

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 the existing File Annotations submenu to VS Code’s editor gutter (line number) context menu, gated by a new gitlens.menus.editorGutter.blame setting, aligning the gutter experience with the editor text-area context menu.

Changes:

  • Adds gitlens/editor/annotations submenu to editor/lineNumber/context, controlled by config.gitlens.menus.editorGutter.blame.
  • Extends MenuConfig.editorGutter to include the new blame boolean and sets its default to true.
  • Exposes the new toggle in the Settings webview under General → Menus → Editor Gutter Context Menu.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/webviews/apps/settings/categories/general.ts Adds a Settings UI checkbox for menus.editorGutter.blame.
src/config.ts Extends MenuConfig.editorGutter to include the blame toggle.
package.json Updates configuration schema/defaults and contributes the submenu to editor/lineNumber/context.
contributions.json Adds the submenu placement for gitlens/editor/annotations into editor/lineNumber/context (source for generated contributions).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Closes gitkraken#2682. Reuses the existing File Annotations submenu (blame,
heatmap, changes toggles, and clear) in the editor's line number
(gutter) context menu, gated by a new gitlens.menus.editorGutter.blame
setting (default on), matching the existing compare/remote/share
gutter menu settings.
@GREFITH GREFITH force-pushed the feature/2682-gutter-toggle-annotations branch from b497949 to ea8d991 Compare July 3, 2026 13:43
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.

Need to add "toggle file annotation" item to the context menu of gutter

2 participants