Inline comments in preview mode#2401
Merged
tf merged 12 commits intocodevise:masterfrom Apr 22, 2026
Merged
Conversation
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
885a559 to
fe595f8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
REDMINE-21261