Skip to content

Inline comments in preview mode#2401

Merged
tf merged 12 commits intocodevise:masterfrom
tf:preview-inline-comments
Apr 22, 2026
Merged

Inline comments in preview mode#2401
tf merged 12 commits intocodevise:masterfrom
tf:preview-inline-comments

Conversation

@tf
Copy link
Copy Markdown
Member

@tf tf commented Apr 21, 2026

REDMINE-21261

@tf tf added this to the v17.2 milestone Apr 21, 2026
tf added 12 commits April 21, 2026 11:05
Add subject_range text column to pageflow_comment_threads.
Use Rails serialize with JSON coder on the model.
Permit nested subject_range in controller strong params.
Include subject_range in jbuilder JSON output.
Add subjectRange to postCreateCommentThreadMessage, ReviewSession.createThread,
NewThreadForm, ThreadList, Popover, and SelectedSubjectProvider so that text
range comments can flow from the UI through to the backend.
Content element types with inlineComments: true handle commenting
via their own UI. Skip the default AddCommentOverlay, do not set
inert on their content, and skip the yellow selected border.
Renders a non-interactive overlay with 'Select text to comment' hint,
styled similar to AddCommentOverlay. Used by the commenting EditableText
alternative for customSelectionRect elements.
Register a Slate-based read-only EditableText alternative via the
extension system. In add-comment mode it shows the AddCommentHint,
lets users select text, converts the DOM selection to a Slate range,
and triggers the Popover/NewThreadForm flow with subjectRange.
Highlighted text uses the commentHighlight decoration.

Also add contentElementPermaId to ContentElementAttributesProvider.
Add scenario verifying that text block elements show the 'Select text
to comment' hint instead of the default overlay button when entering
add comment mode.
Add preselect/clearPreselection to AddCommentModeProvider. When toggle
is called with a preselection present, apply it directly to the
SelectedSubjectProvider instead of entering active mode. This avoids
the flash of overlays when the user already has text selected.

Replace handleMouseUp and the pre-existing selection effect in the
commenting EditableText with a single selectionchange listener that:
- Keeps preselection in sync as the user selects text
- During active mode, captures the selection and opens the thread form
- Clears preselection (scoped by permaId) when selection collapses

Export useSelectedSubjectContext from SelectedSubjectProvider for use
by AddCommentModeProvider.
pointerdown fires on mobile scroll gestures, causing add-comment mode
and popovers to dismiss when the user scrolls. mousedown only fires
on actual taps/clicks.
Show a badge and clickable highlight for each comment thread anchored
to a text range in an EditableText. Clicking a highlight opens its
popover without starting a new thread, while selecting unannotated
text still offers to create one.

REDMINE-21261
@tf tf force-pushed the preview-inline-comments branch from 885a559 to fe595f8 Compare April 21, 2026 09:05
@tf tf merged commit 66f7080 into codevise:master Apr 22, 2026
18 checks passed
@tf tf deleted the preview-inline-comments branch April 22, 2026 10:20
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