Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai 2aa46f21bf test(settings): include agentButton in the commit settings defaults shape 2026-11-20 13:29:14 +08:00
l0ng-ai 7310d0ab01 feat(vcs): setting to hide the Generate Commit Message with Agent button
Version Control › Commit › Commit Message Generation gets "Show the Generate Commit Message
with Agent button" (on by default). Off, the button above the commit message is hidden in
the Commit tool window and dialog; the action stays available from Find Action and its
shortcut.
2026-11-20 13:21:55 +08:00
8 змінених файлів з 34 додано та 2 видалено

No files matched your search

+3
Переглянути файл
@@ -176,6 +176,8 @@ pub struct CommitSettings {
pub agent_model: String,
/// That model's thinking level for commit messages; empty keeps the agent's.
pub agent_effort: String,
/// Show the Generate Commit Message with Agent button above the commit message.
pub agent_button: bool,
}
impl Default for CommitSettings {
@@ -201,6 +203,7 @@ impl Default for CommitSettings {
agent: String::new(),
agent_model: String::new(),
agent_effort: String::new(),
agent_button: true,
}
}
}
+1
Переглянути файл
@@ -850,6 +850,7 @@ mod tests {
"agent": "",
"agentModel": "",
"agentEffort": "",
"agentButton": true,
})
);
}
+2
Переглянути файл
@@ -3770,6 +3770,8 @@ export type CommitSettings = {
agentModel?: string,
/** That model's thinking level for commit messages; empty keeps the agent's. */
agentEffort?: string,
/** Show the Generate Commit Message with Agent button above the commit message. */
agentButton?: boolean,
};
export type Commit_Deserialize = {
+17 -2
Переглянути файл
@@ -6,6 +6,8 @@
import { createElement } from "react";
import { registerActions } from "@/platform/actions";
import { useProject } from "@/platform/project";
import { clearContext, setContext } from "@/platform/context";
import { onWorkflowSettingsChange, workflowSettings } from "@/platform/workflowSettings";
import { executeAction } from "@/platform/actions";
import { lazyComponent, lazyWhen } from "@/ui";
import { isVirtualUri } from "@/platform/virtualDocs";
@@ -47,6 +49,18 @@ import { replyActions } from "./replyActions";
export { activateSettingsPages } from "./settingsPages";
function trackAgentButtonSetting(): () => void {
setContext("commitAgentButton", workflowSettings().vcs.commit.agentButton);
const stop = onWorkflowSettingsChange(
(s) => s.vcs.commit.agentButton,
(on) => setContext("commitAgentButton", on),
);
return () => {
stop();
clearContext("commitAgentButton");
};
}
export function activate(): () => void {
const sync = (root: string | null | undefined) => {
disconnect();
@@ -153,12 +167,13 @@ export function activate(): () => void {
accepts: (type) => type === TASK_DRAG,
drop: ({ payload }) => void executeAction("agents.openTaskInEditor", payload),
}),
// The button above the commit message (the Commit tool window and dialog).
// The button above the commit message (the Commit tool window and dialog), unless turned off.
trackAgentButtonSetting(),
registerMenuSlotItem("commitMessage", {
action: "agents.generateCommitMessage",
label: "Generate Commit Message with Agent",
icon: "toolwindow-agents",
when: "projectOpen && vcsAvailable",
when: "projectOpen && vcsAvailable && commitAgentButton",
}),
registerStatusItem({ id: "agents.status", align: "right", priority: 3, title: "Agents", component: AgentsStatus }),
registerMenuGroup({
+5
Переглянути файл
@@ -643,6 +643,11 @@ export const VCS_PAGES: PageSpec[] = [
{
title: "Commit Message Generation",
options: [
{
kind: "toggle",
key: "vcs.commit.agentButton",
label: "Show the Generate Commit Message with Agent button",
},
{
kind: "custom",
label: "Agent",
+1
Переглянути файл
@@ -2265,6 +2265,7 @@
"Finished": "Finished",
"Only while the tab cannot be seen. A command stopped with Ctrl-C, shell startup and short commands stay quiet; a non-zero exit always reports its code.": "Only while the tab cannot be seen. A command stopped with Ctrl-C, shell startup and short commands stay quiet; a non-zero exit always reports its code.",
"Generate Commit Message with Agent": "Generate Commit Message with Agent",
"Show the Generate Commit Message with Agent button": "Show the Generate Commit Message with Agent button",
"Has the coding agent you work with review the changes about to be committed and write the commit message.": "Has the coding agent you work with review the changes about to be committed and write the commit message.",
"No changes to describe": "No changes to describe",
"Include changes in the commit first.": "Include changes in the commit first.",
+1
Переглянути файл
@@ -8666,6 +8666,7 @@
"Exited with code {code}": "退出代码 {code}",
"Only while the tab cannot be seen. A command stopped with Ctrl-C, shell startup and short commands stay quiet; a non-zero exit always reports its code.": "仅当标签页不可见时通知。用 Ctrl-C 停止的命令、shell 启动和短命令保持安静;非零退出始终报告退出代码。",
"Generate Commit Message with Agent": "使用智能体生成提交消息",
"Show the Generate Commit Message with Agent button": "显示“使用智能体生成提交消息”按钮",
"Has the coding agent you work with review the changes about to be committed and write the commit message.": "让您正在使用的编程智能体审查即将提交的更改并撰写提交消息。",
"No changes to describe": "没有可描述的更改",
"Include changes in the commit first.": "请先在提交中包含更改。",
+4
Переглянути файл
@@ -69,6 +69,8 @@ export interface CommitSettingsValid {
agentModel: string;
/** That model's thinking level for commit messages; empty keeps the agent's. */
agentEffort: string;
/** Show the Generate Commit Message with Agent button above the commit message. */
agentButton: boolean;
}
export interface VcsSettingsValid {
@@ -316,6 +318,7 @@ export const DEFAULT_WORKFLOW: WorkflowSettings = {
agent: "",
agentModel: "",
agentEffort: "",
agentButton: true,
},
confirmation: {
onCreate: "ask",
@@ -488,6 +491,7 @@ export function validateVcs(raw: unknown): VcsSettingsValid {
agent: text(c.agent, d.commit.agent),
agentModel: text(c.agentModel, d.commit.agentModel),
agentEffort: text(c.agentEffort, d.commit.agentEffort),
agentButton: bool(c.agentButton, d.commit.agentButton),
},
confirmation: {
onCreate: oneOf(conf.onCreate, confirm, d.confirmation.onCreate),