From 393f06fa88dbd75812d97d2fb9bfab9b5e65c165 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Thu, 3 Dec 2026 00:46:00 +0000 Subject: [PATCH] Chat find: re-register a highlight whose shared entry another text removed Co-Authored-By: Claude Opus 5.5 --- .../features/chat/ui/transcript/chat_find_highlight.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/lib/features/chat/ui/transcript/chat_find_highlight.dart b/app/lib/features/chat/ui/transcript/chat_find_highlight.dart index d4219007..96dea40c 100644 --- a/app/lib/features/chat/ui/transcript/chat_find_highlight.dart +++ b/app/lib/features/chat/ui/transcript/chat_find_highlight.dart @@ -143,7 +143,11 @@ class _ChatFindHighlightState extends State { void _register(ChatFindTargets? targets, String? rowKey) { final next = rowKey == null ? null : (rowKey, widget.text); if (identical(targets, _targets) && next == _registered) { - if (next != null) targets!.texts[next.$1]![next.$2] = widget.rects; + // Another text with the same row and string may have unregistered + // the shared entry; put it back. + if (next != null) { + targets!.texts.putIfAbsent(next.$1, () => {})[next.$2] = widget.rects; + } return; } _unregister();