Scope git history to current diagram by default

- History panel defaults to "This diagram" / "All" toggle
- "This diagram" filters git log to commits that touched only that
  diagram's JSON file (git log -- diagrams/0001_*.json)
- Automatically switches to "All" when no diagram is open
- Restore flow still works per-commit, per-file

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-24 20:07:05 -04:00
parent 072e620d56
commit 0bbcaa8ee5
5 changed files with 46 additions and 6 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ const api = {
},
git: {
status: () => apiFetch("/git/status"),
log: () => apiFetch("/git/log"),
log: (diagram_id) => apiFetch(diagram_id != null ? `/git/log?diagram_id=${diagram_id}` : "/git/log"),
commit: (message, diagram_id) => apiFetch("/git/commit", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ message, diagram_id: diagram_id ?? null }) }),
push: () => apiFetch("/git/push", { method: "POST" }),
history: (hash) => apiFetch(`/git/history/${hash}`),