feat(vcs): add a global Enable Git integration switch (#6704)

Settings > Version Control > Git gets an Enable Git integration master toggle (global, on by default). While it is off the IDE discovers no repositories and runs no git: status, log, blame, fetch, clone, GitHub, the MCP git tools, plugin repository access and agent worktrees refuse to run, and the Git menu, Get from Version Control, the Git, Commit and GitHub Actions tool windows, Git actions and the branch widget are hidden. Turning it back on restores them without reopening the project. Settings pages gain a reusable master toggle that disables the page's sections, and MenuConfig gains a hidden list applied to the native and in-app menus.

Co-authored-by: bertyhell <[email protected]>
Цей коміт міститься в:
Bert Verhelstтаbertyhell authored and GitHub committed 2026-11-29 15:45:38 +08:00
1 джерело 68e3adde99
коміт d897236bd7
30 files changed
+505 -92

No files matched your search

+32 -25
Переглянути файл
@@ -11,6 +11,7 @@
import "./ui/palette.css";
import { registerActions, type Action } from "@/platform/actions";
import { setContext } from "@/platform/context";
import { whileGitEnabled } from "@/platform/gitEnabled";
import { lazyComponent } from "@/ui";
import { githubCloneSource } from "./clone/source";
import {
@@ -325,30 +326,6 @@ export function activate(): () => void {
setContext("githubPrTab", "list");
const disposers = [
activateSettingsPages(),
registerCloneSource(githubCloneSource),
registerGitLogChecks(lazyComponent(() => import("./LogCommitChecks").then((m) => m.LogCommitChecks))),
registerToolWindow({
id: WINDOW,
title: "Pull Requests",
icon: "toolwindow-pull-requests",
anchor: "left",
order: 2,
stripe: "onUse",
component: lazyView("PullRequestsToolWindow"),
headerContent: lazyView("PullRequestsTabs"),
headerActions: lazyView("PullRequestsHeaderActions"),
headerMenu: useHeaderMenu,
}),
registerToolWindow({
id: ACTIONS_WINDOW,
title: "GitHub Actions",
icon: "github",
anchor: "bottom",
stripe: "onUse",
component: lazyComponent<{ id: string }>(() =>
import("./actions/ActionsToolWindow").then((m) => m.ActionsToolWindow),
),
}),
registerEditorKind({
kind: TIMELINE_KIND,
component: lazyComponent(() => import("./timeline/TimelineEditor").then((m) => m.TimelineEditor)),
@@ -357,7 +334,37 @@ export function activate(): () => void {
icon: (input) => runtime?.timeline.icon(input) ?? "github-timeline",
}),
registerOverlay({ id: "github.dialogs", component: GithubDialogHost }),
registerActions(actions().map((a) => ({ ...a, run: a.run ?? (async (c) => (await load()).runs[a.id]!(c)) }))),
// Pull requests, GitHub clone and actions need Git (Settings › Git › Enable Git integration).
whileGitEnabled(() => {
const git = [
registerCloneSource(githubCloneSource),
registerGitLogChecks(lazyComponent(() => import("./LogCommitChecks").then((m) => m.LogCommitChecks))),
registerToolWindow({
id: WINDOW,
title: "Pull Requests",
icon: "toolwindow-pull-requests",
anchor: "left",
order: 2,
stripe: "onUse",
component: lazyView("PullRequestsToolWindow"),
headerContent: lazyView("PullRequestsTabs"),
headerActions: lazyView("PullRequestsHeaderActions"),
headerMenu: useHeaderMenu,
}),
registerToolWindow({
id: ACTIONS_WINDOW,
title: "GitHub Actions",
icon: "github",
anchor: "bottom",
stripe: "onUse",
component: lazyComponent<{ id: string }>(() =>
import("./actions/ActionsToolWindow").then((m) => m.ActionsToolWindow),
),
}),
registerActions(actions().map((a) => ({ ...a, run: a.run ?? (async (c) => (await load()).runs[a.id]!(c)) }))),
];
return () => git.reverse().forEach((d) => d());
}),
];
// Review mode follows the current branch: start once the window is up.
const idle = typeof requestIdleCallback === "function" ? requestIdleCallback : (f: () => void) => setTimeout(f, 200);