Unread comments - #2474
Open
tf wants to merge 17 commits into
Open
Conversation
Records per user and entry when a comment thread was last read. Keyed by comment thread perma id rather than record id so read state survives comment threads being copied to a new revision.
Accepts a batch of comment thread perma ids so the client can coalesce read marks into a single request. Perma ids that do not belong to the entry are ignored.
Delivered as a separate map keyed by thread perma id instead of a field on each thread, so responses that render a single thread cannot clobber read state in the client.
Read marks are collected and sent as a single debounced request instead of one request per thread. Failed requests keep their perma ids pending so the next flush retries them.
Read marks flow from the UI to the session like other mutations and come back as state changes. Reads live in their own context so that marking a thread read does not invalidate the thread lists.
Comments written by the reviewer never count as unread, and nothing counts as unread while the current user is still unknown, so lists do not briefly show every thread as new.
A thread counts as read after staying in the middle of the viewport long enough to read it, so scrolling past leaves it unread. Threads hiding their replies are left alone until expanded. Splits Thread-spec into topic specs under Thread/features, since a flat spec file and a features directory for the same unit must not coexist.
Adds a dot to the thread badge and names the unread count for screen readers, so subjects carrying comments the reviewer has not seen stand out before their threads are opened.
Threads mark themselves read while on screen, so markers derived from live read state would vanish from under the reviewer mid-read. Thread lists freeze read state on mount instead, and the popover freezes badge and list together so the dot clears on close, where it reads as confirmation rather than as something moving while reading. The read signal keeps using live state: deriving it from the snapshot would leave the thread unread no matter how often it was marked.
A dot locates the thread carrying unseen comments, and the expand control names how many of the replies it hides are new. A thread shown on its own gets no dot: the badge that opened the list already says the same thing next to it.
Marks where the unseen part of an expanded thread starts. Left out when the thread is new all through, since the thread marker already says so and a divider at the very top would only repeat it.
Badges in the editor preview collapse to a bare dot when their element is not the current one. Carrying the unread dot on top of that would show two dots, and a subject with unseen comments is worth the space of the full badge.
Threads carry no read records until someone reads them, so every comment that already existed would show up as unread the moment read tracking starts. Users get a baseline instead: the migration sets it to rollout time for existing users, and creation time for everyone after, which keeps the backlog from turning unread for people joining later too.
The comments item at the sidebar root shows an indicator dot while the entry holds comments the user has not seen, so they do not have to open the comments view to find out. Adds an indicatorAttribute option to registerMainMenuItem rather than a comment specific hook, and keeps an entry attribute in sync with the review session to drive it.
The review interface is bundled separately just like the frontend and entry state, so importing it relatively inlines a second copy along with its React contexts. The rule listed only the other two, which is how such an import reached the editor unnoticed.
Counts unresolved topics and the comments the user has not seen for a whole page of entries at once, so a list can show an indicator without querying per row.
Marks entries carrying unresolved topics with the comment icon of the review interface, and marks the indicator when comments have gone unseen. The tooltip names topics, new topics and new replies. The title cell now holds more than the link, so the index table domino reads the title from the link itself.
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