Skip to content

Handle deleted comment thread subjects - #2453

Merged
tf merged 10 commits into
codevise:masterfrom
tf:orphan-threads
Jul 27, 2026
Merged

Handle deleted comment thread subjects#2453
tf merged 10 commits into
codevise:masterfrom
tf:orphan-threads

Conversation

@tf

@tf tf commented Jul 27, 2026

Copy link
Copy Markdown
Member

REDMINE-21261

tf added 10 commits July 27, 2026 15:40
Move the EntryStateProvider and collection watching from
EntryCommentsView up into the shared ReviewView base, so every review
sidebar panel can resolve entry structure — such as the section a
comment subject lives in — not just the comments list.

REDMINE-21261
Add a section_perma_id column to comment threads and carry it through
the review API. This lets a thread record the section its subject
belongs to, so later changes can keep a comment in context when its
content element is deleted.

REDMINE-21261
Persist the perma id of a comment subject's section when creating a
thread, and place threads by their subject while relocating a thread
whose content element was deleted to that section — so the comment
stays visible in context. Threads whose section is also gone fall back
to the top-level orphans.

REDMINE-21261
When a content element batch persists, set the section perma id of the
threads on that section's elements. A thread whose element was moved
here from another section then relocates to the correct section once
the element is deleted.

REDMINE-21261
After a content element batch saves, mirror the server-side section
reconcile into the in-memory ReviewSession so threads on the section's
content elements carry the right sectionPermaId. A moved thread then
stays relocatable to the correct section even if its content element is
deleted in the same session.

REDMINE-21261
Compute the entry-structure × threads join once in a
LocatedCommentThreadsProvider and share it; useLocatedCommentThreads
reads the context. Wire the provider into the editor ReviewView and the
commenting and inline-editing entry decorators.

Fold orphaned threads (whose content element was deleted) into their
section's list in final display order, flagged with `orphaned` and
leading the section; orphans whose section is also gone lead the first
section so they stay reachable. Expose a bySubject index and include
orphans in the flat list and chapter counts.

REDMINE-21261
Reads a subject's threads from the shared LocatedCommentThreadsProvider —
for a section including the orphaned threads folded into it — and filters
by resolution and range. Replaces useSectionCommentThreads: review
components can read threads by subject (with orphans) from the context
map instead of re-scanning review state, keeping resolution/range
filtering out of the components. Export matchesResolution for it.

REDMINE-21261
A thread whose content element was deleted stays in context under its
section but reads as a reply to nothing. Render a hint above the first
comment noting it refers to a deleted element, driven by the thread's
`orphaned` flag set during placement.

REDMINE-21261
Instead of receiving threads as props, ThreadList and ThreadsBadge read
their subject's threads from the LocatedCommentThreadsProvider via
useLocatedCommentThreadsForSubject. The located threads already include a
section's orphans (folded in, flagged, on top) and are ordered and
range-sorted there, so the components keep no resolution filtering or
sorting — ThreadList just splits resolved from active and Thread renders
the deleted-element hint from the flag. Callers revert to passing the
subject: Popover, the commenting and inline-editing decorators, and the
EntryCommentsView/SelectionCommentsView thread lists.

REDMINE-21261
A section's list holds the orphaned threads of its deleted content
elements, so the navigator now offers them as targets that step to the
section (an orphan's own subject no longer exists in the preview) and the
toolbar counts them. The section popover opens with the orphan
highlighted.

REDMINE-21261
@tf tf added this to the v17.2 milestone Jul 27, 2026
@tf
tf merged commit f05ab31 into codevise:master Jul 27, 2026
18 checks passed
@tf
tf deleted the orphan-threads branch July 27, 2026 14:05
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