Skip to content

Fix edge cases in inline comment range ref tracking#2414

Merged
tf merged 2 commits intocodevise:masterfrom
tf:range-ref-fix
May 7, 2026
Merged

Fix edge cases in inline comment range ref tracking#2414
tf merged 2 commits intocodevise:masterfrom
tf:range-ref-fix

Conversation

@tf
Copy link
Copy Markdown
Member

@tf tf commented May 7, 2026

REDMINE-21261

tf added 2 commits May 7, 2026 08:57
After a delete-merge migrated a thread to a path that didn't exist
in the previous value, the highlight stopped tracking subsequent
edits — the rebuild ran from `useCachedValue`'s `onReset` against
the still-old `editor.children` (Slate's `<Slate>` only replaces
them on the next render), so `isValidRange` skipped the migrated
range and no rangeRef was created. `resetRangeRefs` now just drops
the stale refs and arms a flag that a second effect consumes on
the following render, by which point the value flip has landed.

REDMINE-21261
The reviewSession state provider produces a new threads array on
every session change, including the round-trip echo of a debounced
save that carries the just-saved subjectRange. Tying the unref
cleanup to that array unref'd the live rangeRef and rebuilt it at
the saved position, snapping the highlight backward and discarding
keystrokes the user made during the network round-trip.

REDMINE-21261
@tf tf added this to the v17.2 milestone May 7, 2026
@tf tf merged commit bcf2f5c into codevise:master May 7, 2026
18 checks passed
@tf tf deleted the range-ref-fix branch May 7, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant