Render plugin annotations inline in the diff - #200
Merged
Conversation
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
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.
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