Skip to content

Render plugin annotations inline in the diff - #200

Merged
C-Hipple merged 2 commits into
mainfrom
claude/inline-annotations-diff-8jnv5b
Jul 31, 2026
Merged

Render plugin annotations inline in the diff#200
C-Hipple merged 2 commits into
mainfrom
claude/inline-annotations-diff-8jnv5b

Conversation

@C-Hipple

Copy link
Copy Markdown
Owner

Plugin annotations were only listed flat on the plugin output surfaces.
They now also render in the review diff, collapsed by default the same
way comment threads are: an annotated line carries a flag badge in the
gutter coloured by its most severe annotation, hovering previews them,
and clicking expands a card below the line showing each annotation's
severity, source plugin, and text. A toolbar button expands or collapses
every annotation at once.

annotation_utils owns the anchoring. An annotation lands on the line
whose head-side number matches it, since plugins read the PR's head
state. Annotations that no row can carry — a line outside any hunk, or
one that only exists on the base side — collapse onto their file's
header, labelled with the line they point at, instead of disappearing;
only annotations naming a file absent from the diff are left to the
plugins drawer alone.

The index is built from the plugin outputs the review view already
loads rather than the PR payload's identical annotations field, so
rerunning a plugin from the drawer refreshes the diff without reloading
the PR. Successful runs only, matching the server's aggregation.

The badge gutter widens from 22px to 46px when a PR has annotations:
badges are right-aligned and overflow left into the page padding, which
the page clips, so at the narrow width a line carrying both a comment
and an annotation lost its annotation badge off the left edge.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01L7cxExfCW67NpgfiohsjwV

claude added 2 commits July 31, 2026 01:40
Plugin annotations were only listed flat on the plugin output surfaces.
They now also render in the review diff, collapsed by default the same
way comment threads are: an annotated line carries a flag badge in the
gutter coloured by its most severe annotation, hovering previews them,
and clicking expands a card below the line showing each annotation's
severity, source plugin, and text. A toolbar button expands or collapses
every annotation at once.

annotation_utils owns the anchoring. An annotation lands on the line
whose head-side number matches it, since plugins read the PR's head
state. Annotations that no row can carry — a line outside any hunk, or
one that only exists on the base side — collapse onto their file's
header, labelled with the line they point at, instead of disappearing;
only annotations naming a file absent from the diff are left to the
plugins drawer alone.

The index is built from the plugin outputs the review view already
loads rather than the PR payload's identical annotations field, so
rerunning a plugin from the drawer refreshes the diff without reloading
the PR. Successful runs only, matching the server's aggregation.

The badge gutter widens from 22px to 46px when a PR has annotations:
badges are right-aligned and overflow left into the page padding, which
the page clips, so at the narrow width a line carrying both a comment
and an annotation lost its annotation badge off the left edge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7cxExfCW67NpgfiohsjwV
The annotation badge shared the comment gutter, which had to widen from
22px to 46px to fit both — shifting every line number and every line of
code in a PR that had annotations. The badge now caps the right-hand end
of the line instead, so the gutter goes back to 22px and an annotated
diff lays out exactly like an unannotated one.

The cap is opaque, painting the row's own tint over the diff background,
and the line's text is clipped where the cap begins: an unwrapped line
longer than the viewport used to spill past its box and reappear on the
far side of the badge. Nothing readable is lost — the page clips that
overflow at the viewport edge regardless.

It sticks to the visible right edge, so on mobile — where the diff
scrolls horizontally — the badge stays reachable however far into a long
line you have scrolled. Its hover preview is pinned to the badge's right
edge now that it opens at the edge of the page; the file-header badge
keeps its left-anchored preview.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7cxExfCW67NpgfiohsjwV
@C-Hipple
C-Hipple merged commit 59bc3d4 into main Jul 31, 2026
7 checks passed
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.

2 participants