From 37cbe59551f8fbb285059423c92ecd3a6008c2c2 Mon Sep 17 00:00:00 2001 From: claude code agent 227 Date: Sun, 21 Jun 2026 15:50:15 +0300 Subject: [PATCH] feat(git-sync): client 'Git sync' provenance badge + git in runtime image (Phase D) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - page-history history-item: a lastUpdatedSource==='git-sync' version renders a neutral gray 'Git sync' badge (git-merge icon), NOT the agent badge/deep-link (it is not an agent edit). +2 i18n keys. - Dockerfile: install git in the installer (runtime) stage โ€” VaultGit shells out to git, so assertGitAvailable() needs the binary at runtime. Client tsc clean. Co-Authored-By: Claude Opus 4.8 --- Dockerfile | 3 +- .../public/locales/en-US/translation.json | 2 ++ .../page-history/components/history-item.tsx | 35 ++++++++++++++++++- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 34e5b17f..0fd5dbf4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,9 @@ RUN pnpm build FROM base AS installer +# git: required by the git-sync VaultGit (shells out to git) RUN apt-get update \ - && apt-get install -y --no-install-recommends curl bash \ + && apt-get install -y --no-install-recommends curl bash git \ && rm -rf /var/lib/apt/lists/* WORKDIR /app diff --git a/apps/client/public/locales/en-US/translation.json b/apps/client/public/locales/en-US/translation.json index 9bf33fcf..ec1b2bdf 100644 --- a/apps/client/public/locales/en-US/translation.json +++ b/apps/client/public/locales/en-US/translation.json @@ -1171,6 +1171,8 @@ "Ran tool {{name}}": "Ran tool {{name}}", "AI-agent": "AI-agent", "Edited by AI agent on behalf of {{name}}": "Edited by AI agent on behalf of {{name}}", + "Git sync": "Git sync", + "Synced from Git on behalf of {{name}}": "Synced from Git on behalf of {{name}}", "Endpoints": "Endpoints", "where we fetch models": "where we fetch models", "All endpoints are OpenAI-compatible. Point the Base URL at OpenAI, OpenRouter, a local Ollama, or any self-hosted server.": "All endpoints are OpenAI-compatible. Point the Base URL at OpenAI, OpenRouter, a local Ollama, or any self-hosted server.", diff --git a/apps/client/src/features/page-history/components/history-item.tsx b/apps/client/src/features/page-history/components/history-item.tsx index c39430d1..03a0c0f7 100644 --- a/apps/client/src/features/page-history/components/history-item.tsx +++ b/apps/client/src/features/page-history/components/history-item.tsx @@ -1,5 +1,5 @@ import { Text, Group, UnstyledButton, Avatar, Tooltip, Badge } from "@mantine/core"; -import { IconSparkles } from "@tabler/icons-react"; +import { IconSparkles, IconGitMerge } from "@tabler/icons-react"; import { CustomAvatar } from "@/components/ui/custom-avatar.tsx"; import { formattedDate } from "@/lib/time"; import classes from "./css/history.module.css"; @@ -107,6 +107,34 @@ function AiAgentBadge({ ); } +/** + * Badge marking a version written by the git-sync VaultGit pull (provenance ยง8.1). + * Like {@link AiAgentBadge} it is ADDITIVE โ€” shown next to the human author โ€” + * but a git-sync edit is NOT an agent edit, so it is rendered as a small, neutral + * badge with NO deep-link (there is no AI chat behind it). + */ +function GitSyncBadge({ authorName }: { authorName?: string }) { + const { t } = useTranslation(); + + const tooltip = t("Synced from Git on behalf of {{name}}", { + name: authorName ?? "", + }); + + return ( + + } + > + {t("Git sync")} + + + ); +} + const HistoryItem = memo(function HistoryItem({ historyItem, index, @@ -126,6 +154,7 @@ const HistoryItem = memo(function HistoryItem({ const contributors = historyItem.contributors; const hasContributors = contributors && contributors.length > 0; const isAgentEdit = historyItem.lastUpdatedSource === "agent"; + const isGitSyncEdit = historyItem.lastUpdatedSource === "git-sync"; return ( )} + + {isGitSyncEdit && ( + + )} );