backnotprop / backnotprop/plannotator

Bug: diff annotations only capture clicked line instead of full selection

Open
#991 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.7k
Forks
649
Avg merge
11h 12m
Merged PRs (30d)
109

Description

## Summary

In `plannotator review`, annotations created from selected code inside the diff do not capture the full selected range. When a multi-line or larger code fragment is selected, clicking the `+` annotation button or clicking the selected code creates an annotation/comment for only the single line that was clicked.

## Reproduction steps

1. Open the code review UI with `plannotator review` on a diff that contains changed code.
2. Select a code fragment in the diff that spans more than the single line you plan to click.
3. Click the `+` annotation button for the selection, or click on the selected code to create an annotation.
4. Observe the text/range that is added to the annotation/comment.

## Expected behavior

The created annotation should include the entire selected code fragment. If the user selected multiple lines or a larger range within the diff, that full selected range should be used as the annotation target/comment context, not just the line that received the click.

## Notes

This looks like the diff annotation action may be falling back to the clicked line instead of reading the current browser/text selection. Possible places to check: review diff selection handling, the `+` annotation affordance in the diff viewer, and any line-level click handler that maps an annotation to a single diff row.

## Environment

- Surface: `plannotator review` / code review UI
- OS from reporter session: macOS / Darwin arm64
- Local package version observed in checkout: `0.21.0`
- Browser: Chrome

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in the `plannotator review` code review UI with a multi-line selection. Read the review diff selection handling, the `+` annotation affordance, and the line-level click handler mentioned in the report. Done means annotations created from either the button or selected code include the complete selected range rather than only the clicked line.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.