Add plugin annotation support to code review diff rendering - #202
Merged
Conversation
Plugins can attach line-level annotations to the PR diff via the response contract, but the Emacs client ignored them. Now the review buffer renders the GetPR annotations aggregate inline: - Annotations are inserted after delta-wash (like review comments), so the washer's syntax painting is untouched; compact indicators are appended at line end without rewriting the line. - They start collapsed to a right-aligned <A: plugin> indicator. Toggling comments open with H expands annotations along with them, and the new crs-toggle-annotations command (A) toggles them on their own. - With the cursor on an annotated line, the echo area previews the annotations; the indicator carries them in a crs-annotations text property so the post-command hook needs no re-parsing. - An annotation anchors to its head-side line, matching the web client. Lines the diff can't show attach to the file's first hunk header (labelled with the target line); files outside the diff are skipped. - Plugin output buffers now show the parsed contract body instead of raw JSON stdout and list each plugin's annotations sorted by file and line, via a shared crs--insert-plugin-output-entry helper. - Severity tags and indicators get their own washer faces. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AX28EsRRuZrRKfyR6yHmrT
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.
Summary
Adds support for rendering plugin annotations in the code review diff buffer. Annotations are line-level metadata attached by plugins (e.g., security checks, linting) that anchor to specific lines in the PR's HEAD side. They render as compact
<A: plugin>indicators when collapsed, or full annotation blocks when expanded, similar to how comments work.Changes
crs--buffer-annotationsandcrs--buffer-show-annotationstrack annotation state; annotations start collapsed by defaultcrs--insert-annotations-into-bufferinserts annotations into the washed diff, anchoring to HEAD-side linescrs-annotationstext property for echo-area previewcrs-toggle-annotationscommand (bound toA) expands/collapses all annotations; toggling comments also syncs annotation visibilitycrs--maybe-show-collapsed-commentsrefactored to preview both comments and annotations when hovering over compact indicatorscrs--insert-plugin-output-entry(new) centralizes plugin output formatting and lists annotations sorted by file and linewasher-annotation-{face,error,warning,info}-face)docs/plugins.mdwith annotation rendering behaviorTest Plan
https://claude.ai/code/session_01AX28EsRRuZrRKfyR6yHmrT