Skip to content

feat(git-graph)!: add per-commit slots and move apply, clean and conflict marks to them - #467

Merged
vite-hub[bot] merged 6 commits into
mainfrom
feat/git-graph-commit-slots
Nov 18, 2026
Merged

vite-hub[bot] merged 6 commits into
mainfrom
feat/git-graph-commit-slots

Conversation

@onmax

@onmax onmax commented Nov 18, 2026

Copy link
Copy Markdown
Owner

A ::git-graph mostly shows a plain git tree, but the block read and drew git cherry and git cherry-pick output as a built-in feature: numbered pick dots, rings, a status legend, and conflict notes. That took a big share of the parser and the docs for one use case, and it couldn't say anything else about a commit, like a review, a CI result, or "reverted later".

This PR adds a #commit-<sha> slot that puts one line of Markdown under that commit's row, and removes the cherry-pick parsing. A backport now reads the git log of every branch, with each result written in the fix's slot. The slot matches the hash as the log prints it, or any prefix of four characters or more. It needs the commit- prefix because Comark drops slot names that start with a digit.

Breaking (0.x): git cherry, git switch, and git cherry-pick output in the block isn't drawn anymore. The plugin reports it under a new rule, comark/git-graph/unread-command, and says to move the result into a #commit-<sha> slot. comark/git-graph/unknown-branch is gone, and comark/git-graph/unknown-commit now reports a slot whose hash the log doesn't show. The .cgg-pick, .cgg-has, and .cgg-note[data-status] markup is gone too; .cgg-note is now the slot's line.

Before and after in all four renderers, light and dark: https://drop.vitehub.dev/d/rtf4nz12yz2m/before-after

Validation:

  • vp test run test/ in packages/git-graph: 21 passed. The HTML, Vue, React, and Svelte renders of a block with a #commit-<sha> slot give the same markup; Svelte is now server-rendered in the test instead of only compiled.
  • A #commit-8bb4fd2 note renders on this branch and not on main's source.
  • playwright test e2e/git-graph.e2e.ts: 2 passed, including a note that stays one line at 360px.
  • Both new doctor pages' examples: the incorrect one reports only its rule, the correct one nothing (checked with the git-graph plugin alone).
  • vp lint and the root typecheck: nothing in the changed files. I didn't run pnpm ready, since the typecheck needs every package built.

Not checked: a full docs build. One thing I noticed that is not from this PR: under a host's unlayered line-height rule on div (the e2e's prose host), a note collapses to about 2px, and main's conflict notes do the same.

🤖 Generated with Claude Code

…lict marks to them

A #commit-<sha> slot puts one line of Markdown under that commit in every
renderer. The block now reads only git log: git cherry and git cherry-pick
output is no longer drawn, and the plugin reports it under the new
comark/git-graph/unread-command rule. comark/git-graph/unknown-branch is
removed, and comark/git-graph/unknown-commit now reports a slot whose hash
the log doesn't show.

BREAKING CHANGE: git cherry, git switch and git cherry-pick output in a
git graph is no longer drawn. Write each result in a #commit-<sha> slot.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-18T15:06:14.121176Z
We couldn’t complete this review. Comment @codex review to try again.
1aa6844 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

A commit note can silently land on the wrong row. The new notes can also be clipped entirely under the prose styles already used in the browser tests.

Approach: Replacing backport-specific parsing with Markdown slots is a good simplification, provided each slot resolves to the same commit regardless of which rows are visible.

Reviewed changes across the parser, renderers, docs, and tests.

  • Commit notes: Reviewed hash matching, row layout, max-count, and rendering across HTML, Vue, React, and Svelte.
  • Transcript migration: Reviewed the removal of pick markers, the replacement lint rule, and the updated examples and agent reference.
  • Verification: All 21 git-graph package tests and both Playwright tests passed. Docs content preparation passed; the full docs build was not run.

ℹ️ P2 — Class: public API descriptions advertise removed parsing

The npm package description and the gitGraph preset option still advertise automatic pick results from pasted Git output. A reader following that guidance now gets an unread-command diagnostic instead of the promised marks.

Technical details
# Update the public descriptions for the breaking change

## Affected sites
- [packages/git-graph/package.json:4](https://github.com/onmax/comark-ui/blob/1aa68441904fd22caf1dfea5fcd1e20258a45711/packages/git-graph/package.json#L4) — still promises which branches have each fix from pasted output.
- [packages/ui/src/index.ts:139](https://github.com/onmax/comark-ui/blob/1aa68441904fd22caf1dfea5fcd1e20258a45711/packages/ui/src/index.ts#L139) — still advertises picks from `git cherry` and `git cherry-pick`.

## Required outcome
- Describe `git log` as the input and explicit `#commit-<sha>` notes as the way to show backport results.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/git-graph/src/index.ts Resolved
Comment thread packages/git-graph/src/styles.ts Resolved
Comment thread packages/git-graph/src/read.ts Resolved
@vite-hub

vite-hub Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Last seen running 2026-11-18T21:59:59.959Z 0s
View session Last seen running 2026-11-18T21:40:57.742Z 0s
View session Completed 2026-11-18T21:19:44.927Z 7m 31s
View session Cancelled 2026-11-18T20:02:48.749Z 20m 18s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

this host is full; svc-fleet@servarica: full (3/3)

View session

Pushed ab672dc and resolved the P1 review thread. Mixed-width Git logs now connect parents and deduplicate commits without conflating distinct full hashes or misplacing notes. Both reported cases passed with real Git output, all 28 package tests passed, and lint reported no issues in edited files. The previous e2e run was canceled during WebKit dependency installation before tests began; fresh checks are pending.

Session

Pull request evidence changed.

Session

Pull request evidence changed.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Pasting a short git log and a long git log into the same graph can now split a single branch or draw the same commit twice.

Reviewed changes in cf5cf63:

  • Resolved notes before limiting rows. Kept printed hashes for matching, added an ambiguity diagnostic, and updated the docs and Doctor example.
  • Kept notes visible under host prose styles. Verified that a short note stays readable and a long note truncates without moving the commit dots.
  • Preserved unsupported-command diagnostics. Reported unsupported commands even when no log was pasted and updated the package and preset descriptions.

All 25 Git graph package tests and both Chromium tests passed. The new Doctor examples also produced the expected diagnostics in a focused linter check. The mixed-format regression was reproduced separately with real Git output and the HTML renderer.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/git-graph/src/read.ts Resolved
@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@467

comark-badge

pnpm add https://pkg.pr.new/comark-badge@467

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@467

comark-cards

pnpm add https://pkg.pr.new/comark-cards@467

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@467

comark-cast

pnpm add https://pkg.pr.new/comark-cast@467

comark-charts

pnpm add https://pkg.pr.new/comark-charts@467

comark-chat

pnpm add https://pkg.pr.new/comark-chat@467

comark-chips

pnpm add https://pkg.pr.new/comark-chips@467

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@467

comark-code

pnpm add https://pkg.pr.new/comark-code@467

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@467

comark-colors

pnpm add https://pkg.pr.new/comark-colors@467

comark-comments

pnpm add https://pkg.pr.new/comark-comments@467

comark-critic

pnpm add https://pkg.pr.new/comark-critic@467

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@467

comark-details

pnpm add https://pkg.pr.new/comark-details@467

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@467

comark-diff

pnpm add https://pkg.pr.new/comark-diff@467

comark-embed

pnpm add https://pkg.pr.new/comark-embed@467

comark-fields

pnpm add https://pkg.pr.new/comark-fields@467

comark-figure

pnpm add https://pkg.pr.new/comark-figure@467

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@467

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@467

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@467

comark-github

pnpm add https://pkg.pr.new/comark-github@467

comark-icon

pnpm add https://pkg.pr.new/comark-icon@467

comark-include

pnpm add https://pkg.pr.new/comark-include@467

comark-keys

pnpm add https://pkg.pr.new/comark-keys@467

comark-links

pnpm add https://pkg.pr.new/comark-links@467

comark-linter

pnpm add https://pkg.pr.new/comark-linter@467

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@467

comark-mark

pnpm add https://pkg.pr.new/comark-mark@467

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@467

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@467

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@467

comark-media

pnpm add https://pkg.pr.new/comark-media@467

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@467

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@467

comark-outline

pnpm add https://pkg.pr.new/comark-outline@467

comark-properties

pnpm add https://pkg.pr.new/comark-properties@467

comark-qr

pnpm add https://pkg.pr.new/comark-qr@467

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@467

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@467

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@467

comark-sources

pnpm add https://pkg.pr.new/comark-sources@467

comark-steps

pnpm add https://pkg.pr.new/comark-steps@467

comark-table

pnpm add https://pkg.pr.new/comark-table@467

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@467

comark-tests

pnpm add https://pkg.pr.new/comark-tests@467

comark-time

pnpm add https://pkg.pr.new/comark-time@467

comark-ui

pnpm add https://pkg.pr.new/comark-ui@467

comark-xref

pnpm add https://pkg.pr.new/comark-xref@467

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@467

commit: 12ee62d

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

An ambiguous first-parent abbreviation can make a known merge disappear and put its side branch on the main lane.

Reviewed changes in ab672dc since the previous review:

  • Reconciled short and long hashes. Verified with real Git output that the original split-branch and duplicate-row cases are fixed.
  • Preserved printed spellings for notes. Checked that both spellings resolve to the same row and that distinct full hashes remain separate.
  • Changed how unresolved parents are handled. Reproduced a lost merge and branch label with real Git output. All 28 Git graph package tests passed.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/git-graph/src/read.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. No P0 or P1 findings remain.

Reviewed changes in 61ea64b since the previous Pullfrog review:

  • Preserved parent positions. An unresolved first parent now stops the mainline walk without hiding the known second-parent edge.
  • Added regression coverage. Verified that the merge dot and side-branch label render whether the side branch still has a ref or has been deleted. All 30 git-graph package tests passed, and a separate HTML render check covered omitted first and second parents.

Pullfrog  | View workflow run | Using gpt-6.2-sol(high) | 𝕏

@vite-hub
vite-hub Bot merged commit 087d758 into main Nov 18, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the feat/git-graph-commit-slots branch November 18, 2026 22:11
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant