Files
pdfcraft/crates
mtlcl410andClaude Opus 5.5 a0254022cf M5: selecting from anywhere but a page press forgets the group member a press picked
CommentView remembered the group member a press on the page picked, so
Delete acts on the member clicked, as Acrobat desktop does. The memory
outlived the selection it came from: after choosing the group's card in
the Comments panel, a deletion, an undo or a selection made by a tool,
Delete still took the member clicked earlier.

Every selection now goes through CommentView::select(), which clears the
remembered member; pick() (a press on the page: the Select tool's press
and click, and the context-menu press) is the only place that sets it.
The panel's cards and their Delete, Delete and Backspace, Escape, the
context menus (Delete, Flatten comments), deletion and undo
(annotation_deleted, history_stepped), the drawing tools, the measuring
panel and the control channel use select().

Test: choosing_the_groups_card_makes_delete_act_on_the_card_not_the_member_clicked
(ui-egui). With select() leaving the member in place it fails: the Circle
clicked earlier goes instead of the Square the card shows
(left: ["Square"], right: ["Circle"]).

CodeRabbit review on #4358.

(cherry picked from commit a24b5ae4e8)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyG234xeYkJfr41E6iP
2026-11-03 06:15:53 +08:00
..
…
…
…
…