Skip to content

feat(panel): a comment under a changed line continues the line's band in Files changed - #4225

Merged
luke-agent[bot] merged 2 commits into
mainfrom
luke/annotation-band
Oct 20, 2026
Merged

luke-agent[bot] merged 2 commits into
mainfrom
luke/annotation-band

Conversation

@dastratakos

@dastratakos dastratakos commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This is PR 3 of 3 for the approved "Code annotations: one card" design (v3). It follows #4203 and is independent of #4214. In Files changed, an annotation row under a changed line keeps that line's band, so a comment in the middle of an added block reads as standing in it rather than cutting it in two.

  • Done the simple way, not with stage-cli's per-slot generated :has(slot[name=…]) rules. Pierre 1.5.2 does not expose the line type on [data-line-annotation] (its value is hunk,lineIndex), and its numbers-column buffer drops the line type too.
    • Marking: the bundle marks each row, and its paired [data-gutter-buffer="annotation"], with one attribute, data-band="addition|deletion" (diff-view/annotation-bands.ts). It does this in the list's existing onPostRender dress, every time Pierre draws a file.
    • Where the band comes from: the line's own data-line-type, read from the row right before the annotation, since Pierre always pushes a line and then its annotation row. That keeps the panel contract unchanged.
    • Pairing: each buffer is paired with the row in the same position, within each [data-content] and its sibling [data-gutter].
  • Static rules in LOOK_CSS:
    • Grounds: the row's code ground and the buffer's numbers ground are the line's own, mixed exactly as Pierre mixes them (88/80% for the content, 91/85% for the numbers, against the same overrides). I measured both in the browser, and they equal the added line's and its number cell's computed colours.
    • Change bar: drawn where Indicators is set to bars, solid for additions and a 2px stripe for deletions. Classic indicators draw nothing in the row.
  • Backgrounds off: nothing is marked (the marking reads pre[data-background]), so the row keeps the plain ground and a mark from before is taken off.
  • Selection keeps priority: lit lines stay blue above, and the band continues behind the card.
  • No pre { isolation: auto } fix: I saw no highlight painting over a card.

Evidence

Screenshots come from a harness that runs the real AgentPullRequestTab, with the real diff bundle (Pierre plus the highlight worker) and the built styles.css. The fixture is an added block with a comment on line 13, inside it.

  • tsc --noEmit (panel): clean.
  • ./scripts/oxlint.sh: 0 warnings, 0 errors.
  • biome check: clean on the changed files.
  • pnpm knip: clean.
  • ./scripts/repository-checks.sh: passed. Every Pierre variable the rules read has a Luke-token fallback.
  • vitest src/diff-view: 30/30.
  • cd apps/desktop && node scripts/build.mjs: bundle budget passes.

New test, annotation-bands.test.ts (2 tests), on Pierre's unified markup:

  • notes under a removed line and an added line get deletion and addition on both the row and its buffer, and a note under a context line gets nothing
  • with Backgrounds off, nothing is marked, and an earlier mark is taken off

Screenshots

Neutral (before) Band continued (after)
900px, dark
900px, light
360px, dark
360px, light
Hover: lit lines stay blue, band behind the card (dark) (light)

Invariants

  • Every behavior change has, in this PR, the test that fails without it; no change-detector test added.
  • No new as assertion, raw async primitive, or Effect run outside the edges.
  • Test count: +2.
  • The diff bundle's header doc names the band (diff-view/index.ts).
  • PRIVACY.md unchanged.

Made with Luke

View guided diff Turn on auto-fix

… in Files changed

A note's row under an added or removed line, and its buffer in the numbers'
column, are marked with that line's band as Pierre draws the file
(diff-view/annotation-bands.ts), read off the line's own type; the diff's
look paints the row's code and numbers as the line's, mixed as Pierre mixes
them, with the change bar beside them where bars mark a change, solid for
an addition and striped for a deletion. With backgrounds off nothing is
marked, and lit lines stay blue above while the band runs on behind the card.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
luke-web Ready Ready Preview Oct 20, 2026 9:38pm UTC

Request Review

luke-agent Bot pushed a commit that referenced this pull request Oct 20, 2026
@luke-agent
luke-agent Bot marked this pull request as ready for review October 20, 2026 21:31
@luke-agent
luke-agent Bot enabled auto-merge October 20, 2026 21:31
devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

Devin Review

Comment thread packages/panel/src/diff-view/index.ts Resolved
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit a8ee155 Oct 20, 2026
12 checks passed
@luke-agent
luke-agent Bot deleted the luke/annotation-band branch October 20, 2026 21:53

This branch was successfully deployed

1 active deployment
Preview — d194899e Deployed Oct 20, 2026 by vercel[bot]
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