/**
* Commit Options popup (the gear next to Commit, after IDEA's): Git author and
* sign-off, before-commit modifications, Git hooks and the commit checks. The
* checks are the Settings › Version Control › Commit values, edited in place.
*/
import type { ReactNode, RefObject } from "react";
import { executeAction } from "@/platform/actions";
import { call, commands, isTauri } from "@/platform/ipc";
import { loadSettings } from "@/platform/project";
import { useWorkflowSettings } from "@/platform/workflowSettings";
import { Checkbox, Input, Popup, T } from "@/ui";
import { useCommit } from "./commitStore";
import styles from "./CommitView.module.css";
type CommitCheck = "reformat" | "optimizeImports" | "cleanup" | "analyzeCode" | "checkTodo";
async function setCheck(key: CommitCheck, value: boolean) {
if (!isTauri()) return;
try {
await call(commands.settingsSet("global", `vcs.commit.${key}`, JSON.stringify(value)));
await loadSettings();
} catch {
// keep the previous value
}
}
function Section({ title, children }: { title: string; children: ReactNode }) {
return (