docs(git-sync): document GIT_SYNC_* env vars; fix stale/non-English comments (PR #119 review)

Addresses the documentation/convention warnings from the #119 review:
- .env.example: add the GIT-SYNC block (9 GIT_SYNC_* vars with defaults), noting
  GIT_SYNC_SERVICE_USER_ID is required when sync is enabled.
- yjs-body-merge.ts: translate the Russian review note in the docstring to
  English (comments-only-in-English rule).
- persistence.extension.ts: correct the stale "git-sync writes are full-body
  replaces" rationale — a git-sync write is now a block-level merge into the live
  doc, which is why it is debounced like a human edit rather than snapshotted.
- history-item.tsx: the GitSyncBadge version is created on the PUSH path (writing
  the git body back into the doc), not by the pull — fix the comment.
- edit-space-form.tsx: log the raw error in the git-sync toggle catch instead of
  swallowing it (AGENTS.md).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
claude code agent 227
2026-06-24 00:53:07 +03:00
parent 807ff1f5f5
commit 8fa32e8438
5 changed files with 52 additions and 8 deletions

View File

@@ -7,11 +7,12 @@ interface GitSyncBadgeProps {
}
/**
* Badge marking a version written by the git-sync data plane — a VaultGit pull
* applied through the native datasource (provenance §8.1). Like {@link AiAgentBadge}
* it is ADDITIVE — shown next to the human author, never replacing them. A
* git-sync edit is NOT an agent edit and has no chat to deep-link into, so it is
* a small, neutral, non-clickable label.
* Badge marking a version produced by git-sync (provenance §8.1). The history
* version is created on the PUSH path — when an incoming git body is written back
* into the Docmost doc — not by the pull itself. Like {@link AiAgentBadge} it is
* ADDITIVE — shown next to the human author, never replacing them — but a git-sync
* edit is NOT an agent edit and has no chat to deep-link into, so it is a small,
* neutral, non-clickable label.
*/
export function GitSyncBadge({ authorName }: GitSyncBadgeProps) {
const { t } = useTranslation();

View File

@@ -52,6 +52,9 @@ export function EditSpaceForm({ space, readOnly }: EditSpaceFormProps) {
});
} catch (err) {
setGitSyncEnabled(previous); // revert on failure
// The mutation surfaces a toast via onError; still log the raw error so it
// is not silently swallowed (AGENTS.md).
console.error("Failed to toggle git-sync for space", err);
}
};