Align editor comments visibility settings with preview - #2479
Merged
Conversation
Move CommentDisplayFilterProvider from frontend/commenting to review/, so the editor's sidebar and preview iframe can share the mechanics of the preview's resolution toggle. The provider itself now only carries the context; useStoredCommentDisplayFilter keeps the resolution in local storage under a caller-chosen key, so the editor and the preview remember their setting separately.
Add a resolution prop to ThreadList: 'unresolved' drops the resolved threads together with their count pill, 'all' shows them expanded behind it. A thread the reviewer picked stays listed either way, so that following a resolved comment from the activity feed does not end up in an empty list.
Offer the resolution filter of the preview toolbar as two menu items beside the comments view's activity button. The setting lives on the entry, so both sidebar tabs and (later) the preview read the same resolution, and is remembered across editor sessions. Resolved threads and their count pill leave the entry-wide list while it shows unresolved threads only; headings and type separators left without threads go with them.
The selection tab keeps its fold, so the reviewer can still peek at resolved threads of the current selection without turning them on everywhere. The filter only decides whether it starts out open.
Hand the sidebar's resolution over to the preview iframe, on every reload and whenever the reviewer picks another one, and let the section and content element badges follow it. A subject whose threads are all resolved reads as grey, the same as in the published entry's preview mode.
Let the highlight overlay and the badge column of an editable text follow the editor's filter, so that text a resolved thread refers to reads as grey instead of staying unmarked until the thread is picked.
Add a checkbox to the comments view menu that stops comments from being displayed on anything the reviewer has not selected: no badge dots on sections and content elements, no highlights and badges on commented text. What reads as selected keeps its comments: a selected section or content element shows its badge, the selection rect of an editable text shows the comments of the blocks it spans, and the thread opened from the sidebar keeps marking the text it refers to, so a comment can still be followed into the preview. Put the other way around, nothing displays that would have been a mere dot. Framed as "always show comments" and checked by default, mirroring the preview toolbar's show/hide toggle. The menu holds more than the resolution filter now, so its title speaks of comment display.
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