Repository navigation
Description
What happened?
When writing a longer comment in the Annotate comment composer, the visual position of the text caret can become horizontally misaligned with its actual position in the text.
The issue seems to occur only after the textarea has grown enough to become scrollable and several additional lines have been entered. It does not start immediately when the vertical scrollbar first appears.
Once the issue occurs, the caret can appear significantly farther to the right than the actual insertion point. For example:
Last characters of the comment |
Here's a quick screencap (just let my hands roll over the keyboard lol). Here it's happening right when the scrollbar shows up
Screenshot_2026-09-13_17-45-57.mp4
However, the underlying cursor position remains correct. Pressing Backspace immediately deletes the actual last character rather than anything corresponding to the apparent space between the text and the rendered caret.
The amount of visual offset is also not constant. While continuing to type across additional lines, I have observed the offset becoming larger, returning to zero on another line, and then appearing again with a different offset later.
This makes editing longer comments very difficult. When moving the cursor backwards through existing text using the arrow keys, the visible caret position does not reliably indicate which character the cursor is actually positioned at. To correct something earlier in the comment, I effectively have to estimate the logical cursor position or delete text until I reach the location I want to edit.
Steps to reproduce
- Open a comment composer in Annotate.
- Type enough text for the textarea to reach its maximum height and display a vertical scrollbar.
- Continue manually typing for several additional lines.
- Observe the caret position while text wraps and new lines are added.
- Once the issue occurs, move the caret backwards through the text using the arrow keys and try editing an earlier character.
In my tests, the issue did not allways occur immediately when the scrollbar appeared. It appeared only after several more manually entered lines (approximately three additional lines in multiple tests).
I also could not reliably reproduce it by repeatedly pasting a copied word followed by a space until the textarea became scrollable. After doing that, however, continuing to type manually for several more lines eventually caused the visual caret offset to appear.
Expected behavior
The rendered caret should always correspond to the actual insertion point in the text, regardless of:
- how many lines the comment contains,
- whether the textarea is scrollable,
- line wrapping,
- or whether content was typed or pasted.
Actual behavior
The logical cursor position remains correct, but the rendered caret intermittently appears horizontally offset from that position in longer, scrollable comments.
The size of the offset can change between lines. It may increase over subsequent lines, temporarily disappear, and then appear again.
Text insertion, deletion, and cursor movement still operate on the logical cursor position, so this appears to be a visual caret/rendering issue rather than corruption of the underlying text or selection state.
Additional information
- OS:
Windows 11, Plannotator invoked from WSL2 - Browser:
Brave 1.95.101 (Official Build) (64-bit), Chromium 153.0.8010.37 - Display scaling / browser zoom:
Windows 125%, browser zoom 100% - Reproducible at 100% browser zoom:
yes
Plannotator version
0.27.12
OS
Windows
Agent
Claude Code
Where did it happen?
Annotate
Activity
fix(ui): keep the composer text overlay aligned with the textarea whe…