Repository navigation
docs(git-graph): write the palette index as the modulo it is - #1670
Merged
Merged
Conversation
The comment said the decoder paints `column * length`; the code paints `palette[column % palette.length]`. A multiplication would be meaningless — the index is the column taken modulo the palette size.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Correct the palette-contract comment in
packages/git-graph/src/palette.ts: the decoder indexes the palette withpalette[column % palette.length], notcolumn * length.Why
The old wording described an expression the decoder never used, so the comment documented behaviour that does not exist. This is a comment-only change: no executable line is touched, and the palette itself is unchanged.
Commits
Verification
git diff -U0 origin/main...dev-huichenshows every changed line inside the/** ... */block comment inpackages/git-graph/src/palette.ts(all additions and deletions start with*); no code line changed.npx tsc --noEmit -p packages/git-graph/tsconfig.json-> exit 0.User-visible changes
None: only a doc comment is corrected; rendering and palette values are unchanged.