feat(git-graph): VS Code-style git graph with commit actions in History modal (#1431)

* feat(types): add parents to GitLogEntry and new commit action types

* feat(git): add parent hashes and --all flag to getLog

* fix(git): move record separator to start of log format string

* feat(git): add checkoutCommit server function and route

* feat(git): add cherryPick server function and route

* feat(git): add revertCommit server function and route

* feat(git): add resetToCommit server function and route

* fix(tests): make git service tests branch-name portable, add error path tests

* feat(client): add checkoutCommit, cherryPick, revertCommit, resetToCommit API wrappers

* feat(git-graph): add lane assignment algorithm with tests

* feat(git-graph): add GitGraphSegment per-row SVG renderer

* feat(i18n): add locale strings for git graph action buttons

* fix(git-graph): handle lane convergence, fix SVG path coords, add connector tests

* feat(git-graph): add ref badges and action buttons to HistoryCommitRow

* fix(git-graph): add loading guards to reset actions, use theme tokens for ref badges

* fix(git-graph): conditional hooks, stale graph log, conflict handling, i18n

* fix(types): replace toBeDefined with toBeTruthy, fix toast API usage

* fix(lint): remove unused variables

* fix(git-graph): fix SVG height causing 150px row spacing

* fix(git-graph): smooth bezier curves, fill row height, round line caps

* fix(git-graph): non-scaling-stroke fixes bezier white spaces, sort curves on top

* fix(git-graph): remove viewBox scaling, match SVG height to actual row height

* fix(git-graph): ResizeObserver tracks actual row height, eliminates SVG height mismatch

* feat(git-graph): replace SVG with Canvas for graph rendering

* fix(git-graph): isolate canvas from flex layout to prevent replaced-element height leak

* feat(git-graph): align action buttons, add confirmation popups for all actions

* fix(git-graph): address code review findings CR-001 through CR-005

- CR-001: VS Code getGitLog now forwards 'all' option and parses %P parents
- CR-002: VS Code bridge/gitService implement checkoutCommit, cherryPick,
  revertCommit, resetToCommit with conflict detection and hard-reset guard
- CR-003: server-side commit hash validated with /^[0-9a-fA-F]{7,40}$/
  in both routes.js and service.js; 12 new rejection tests added
- CR-004: cherry-pick/revert conflict path now refreshes fetchStatus/
  fetchBranches/fetchLog; conflict toast uses i18n keys in all 7 locales
- CR-005: corrected O(n) comment to O(n x lanes)

* fix(i18n): add zh-TW locale and common.language.traditionalChinese key to all locales

upstream/main added zh-TW.ts after branch diverged; CI type-check fails
when PR is merged because zh-TW.ts was missing all gitView.history.actions.*
keys and loadMore/loadingMore. Also adds common.language.traditionalChinese
to en.ts and all 6 non-English files to match upstream en.ts.

* fix: harden git history actions

* feat: split git history graph view

* chore: remove git graph planning docs

---------

Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
Erman HAVUÇ
2026-05-27 00:13:25 +03:00
committed by GitHub
co-authored by Bohdan Triapitsyn
parent cc3d1bd63c
commit 52ffe9daef
26 changed files with 2373 additions and 111 deletions
+31
View File
@@ -504,11 +504,39 @@ export const dict: Record<I18nKey, string> = {
"gitView.header.identityTooltip": "Ідентичність Git",
"gitView.header.noIdentity": "Ідентичність не вибрано",
"gitView.header.noProfiles": "Немає доступних профілів для застосування.",
"gitView.header.repositoryViews": "Перегляди репозиторію",
"gitView.header.removeRemoteAria": "Видалити remote",
"gitView.header.removeRemoteTitle": "Видалити remote",
"gitView.header.upstreamSynced": "синхронізовано",
"gitView.header.upstreamTooltip": "Порівняно з {target}.",
"gitView.header.upstreamTooltipTracking": "Порівняно з {target}. Основні індикатори синхронізації все ще відображають {tracking}.",
"gitView.history.actions.cancelButton": "Скасувати",
"gitView.history.actions.checkoutConfirm": "Перейти на цей коміт як detached HEAD?",
"gitView.history.actions.cherryPickConfirm": "Застосувати cherry-pick цього коміту до поточної гілки?",
"gitView.history.actions.conflictToastDescription": "Конфлікти у: {files}. Розв'яжіть їх вручну й закомітьте або скасуйте через git cherry-pick/revert --abort.",
"gitView.history.actions.conflictToastTitle": "Конфлікт",
"gitView.history.actions.confirmButton": "Підтвердити",
"gitView.history.actions.mergeConfirm": "Змерджити цей коміт у поточну гілку?",
"gitView.history.actions.rebaseConfirm": "Перебазувати поточну гілку на цей коміт?",
"gitView.history.actions.resetHardConfirm": "Hard reset — HEAD переміститься, усі незакомічені зміни буде остаточно втрачено.",
"gitView.history.actions.resetMixedConfirm": "Mixed reset — HEAD переміститься, зміни буде прибрано зі stage.",
"gitView.history.actions.resetSoftConfirm": "Soft reset — HEAD переміститься, staged-зміни збережуться.",
"gitView.history.actions.revertConfirm": "Підготувати revert цього коміту?",
"gitView.history.actions.checkout": "Checkout",
"gitView.history.actions.cherryPick": "Cherry-pick",
"gitView.history.actions.createBranch": "Створити гілку тут",
"gitView.history.actions.createBranchConfirm": "Створити",
"gitView.history.actions.createBranchPlaceholder": "Назва гілки",
"gitView.history.actions.detachedHead": "Checkout виконано (detached HEAD)",
"gitView.history.actions.merge": "Merge у поточну",
"gitView.history.actions.rebase": "Rebase на цей",
"gitView.history.actions.reset": "Reset...",
"gitView.history.actions.resetHard": "Hard — втратити всі зміни",
"gitView.history.actions.resetHardConfirmButton": "Втратити зміни",
"gitView.history.actions.resetMixed": "Mixed — прибрати зі stage",
"gitView.history.actions.resetSoft": "Soft — зберегти staged",
"gitView.history.actions.revert": "Revert",
"gitView.history.binary": "Бінарний",
"gitView.history.binaryNoDiff": "Бінарний файл — diff недоступний",
"gitView.history.commitsPlaceholder": "Пошук комітів",
@@ -518,6 +546,8 @@ export const dict: Record<I18nKey, string> = {
"gitView.history.largeDiffTitle": "Великий diff ({count} змінених рядків)",
"gitView.history.loadingDiff": "Завантаження diff...",
"gitView.history.loadingFiles": "Завантаження файлів...",
"gitView.history.loadMore": "Завантажити ще",
"gitView.history.loadingMore": "Завантаження...",
"gitView.history.logSize100": "Розмір журналу 100",
"gitView.history.logSize25": "Розмір журналу 25",
"gitView.history.logSize50": "Розмір журналу 50",
@@ -526,6 +556,7 @@ export const dict: Record<I18nKey, string> = {
"gitView.history.renamedNoDiff": "Перейменований файл — diff не підтримується",
"gitView.history.renderDiffAnyway": "Показати все одно",
"gitView.history.title": "Історія",
"gitView.graph.title": "Граф",
"gitView.integrate.checking": "Перевірка…",
"gitView.integrate.cherryPickAbortedToast": "Cherry-pick перервано",
"gitView.integrate.cherryPickConflictDescription": "Вирішіть конфлікти cherry-pick, щоб продовжити.",