Repository navigation
Notes: show an unseen-notes count badge on the All notes toggle - #81951
adamsilverstein wants to merge 16 commits into
Conversation
Opening a post gave no hint that collaborators had left notes since the last visit: the toolbar toggle looked the same for zero notes, ten read ones, and three fresh ones. Count the unresolved note threads whose newest activity postdates the current user's last look at the post, excluding their own notes, and show that count over the pinned toggle. Persist the per-post timestamp in the existing preferences store - which already rides on the `persisted_preferences` user meta - rather than adding a read-tracking API for one feature. Record the newest `date_gmt` the user was actually shown rather than the current time, so the comparison cannot be thrown off by clock skew between the browser and the server. Fixes #81940.
Assert the badge against real note data: a collaborator's note counts, the user's own does not, resolved threads are excluded, and the count truncates to "9+" while the toggle still announces the exact number. Every case asserts the rendered count rather than only its absence, so the spec cannot pass with the badge missing entirely.
|
Size Change: +1.96 kB (+0.02%) Total Size: 7.92 MB 📦 View Changed
|
Once a collaborator's note arrives, the toggle's accessible name carries the unseen count, so an `exact` match on "All notes" no longer finds it. That is precisely the scenario these three tests set up, and all three were failing on the badge change. Also point both CHANGELOG entries at the pull request rather than the issue, which is what the CHANGELOG check looks for.
|
Flaky tests detected in 15ea8a0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/32539117348 should remove not allowed blocks from the block manager in
|
Once no complementary area is active, the floating notes panel puts itself up and shows every unresolved thread. Someone can read all of them there and never touch "All notes", leaving a badge that never clears - and a badge that never clears teaches people to ignore it. Selecting a thread expands it, so it is the point where reading is demonstrated rather than assumed. The finer expansions - "Show more" on a clamped note, "N more replies" on a collapsed thread - are left alone: each implies a selection, and a post whose notes are short and reply-free offers nothing to expand at all. The add-note form reports itself as the selected note, so require a real thread id; authoring a note is not reading anyone else's.
…es-badge # Conflicts: # packages/interface/CHANGELOG.md
…es-badge # Conflicts: # packages/editor/README.md # packages/editor/src/components/collab-sidebar/constants.js # packages/editor/src/components/collab-sidebar/hooks.js # packages/editor/src/components/collab-sidebar/test/utils.jsdom.test.js # packages/interface/CHANGELOG.md
Trunk upgraded Prettier, which tab-indents the closing paren of a multi-line ternary branch. Reformat the two badge call sites so the format check passes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CdtuWidg1XBK8cpYLNSWxF
A release on trunk renamed the heading the entry sat under, leaving it stranded in a published version. Everything below the first published heading must match trunk byte for byte. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CdtuWidg1XBK8cpYLNSWxF
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +3 kB (+0.04%) Total Size: 8.52 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
|
Gave this a quick test locally with some filler data. I wish there was an easier way to test with multiple people first to catch any edge case. I wonder if instead of trying to show a number of unread, we could just indicate general unread Notes. I could see wanting to open Notes, look at a few, then come back and see the rest of the unread. I also didn't see any indication of which Notes were unread when testing either. |
|
Thanks for the PR! In my opinion it'll be helpful to highlight the unread notes briefly when the panel opens since we're showing the count in badge.
This can be a common workflow for users & will be beneficial if we can support it, although I wonder if that's possible with the current approach as for that we'll have to track read status across each note individually. |
|
On mobile, the badge is visible but since the notes panel toggle isn't, clicking on the badge doesn't open the notes panel. Screen.Recording.2026-10-08.at.4.20.16.PM.movIt'll be better to hide the badge on mobile. On a side note, there might be quite a few opportunities to improve the experience on mobile (eg. clipped collaborators popover on mobile). But they're outside of scope of this PR. |
I'm open to just showing a blue dot without a count
Right, this PR only addresses show that there are unread notes, we don't actually track which ones you have read, only which notes were added since you last opened the post. While not ideal, I still feel is an improvement over having nop indication at all.
@yashjawale any suggestions or ideas on how this highlighting would work? notes might not be on the first page, so I'm not sure this would work consistently.
Right, its not possible with the current approach. Fully tracking read notes would be more complex; I'm open to the idea but would prefer to lint the scope of this initial PR. That said if the consensus is the feasture doesn't really help much without that, I can revisit.
Oh, good catch, I'll fix that.
Feel free to open separate issues for each improvement opportunity you noticed! |
…es-badge # Conflicts: # packages/editor/src/components/collab-sidebar/constants.js # packages/editor/src/components/collab-sidebar/hooks.js # packages/editor/src/components/collab-sidebar/index.jsx # packages/interface/CHANGELOG.md
Pinned toggles are hidden below the small breakpoint, but the badge wrapper stayed visible, leaving a count floating over nothing that opens the sidebar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QjT9Yj6cHrjktdMGdQq37b
Selecting a noted block now selects its thread, which counts as reading it, so start the new note on a block of its own. Also cover the badge hiding on mobile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QjT9Yj6cHrjktdMGdQq37b
One approach I can think of is to highlight the unread notes with a yellow background tint as soon as the panel opens, similar to how slack does when we click on a message from the "Activity" panel. And then un-highlight them when they appear within the visible viewport. Something along the lines of...
While this won't cover the use case in #81951 (comment) as all notes will be counted as read when panel opens. It can still be a useful temporary visual cue on client side. |
|
Also if #81951 (comment) is implemented... Perhaps it'll be better to show a dot instead of count on indicator, as that won't indicate that we're keeping track of unseen notes. It'll just be a "Some activity has happened since you last opened the panel" indicator. Ideally the unseen threads should also be expanded when one of their messages is highlighted similar to #84060 |
Only a per-post timestamp is stored, so the badge can say something is new but not which notes were read. Show a dot instead of a count, and when All notes opens, highlight the threads that were unseen with their replies expanded, fading each once it has been in view for a moment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QjT9Yj6cHrjktdMGdQq37b
|
Claude pushed changes to address the latest feedback. I'm away from my laptop for a day - I'll loop back to review and test when I am back. |
|
Thanks! Rn we're highlighting entire thread which has the reply, for large threads it leaves a large yellow patch on screen when the panel opens. Perhaps it'll be better to highlight the individual replies? |
The 15.2.0 release renamed the Unreleased heading, stranding this PR's entry under a published version and failing the changelog check. Claude-Session: https://claude.ai/code/session_01RmMwj4CN9cF8b1Sx58Pvik
Claude Code wrote the code here and drafted this description:
AI Use
Code and description both came out of a back and forth with 🤖 Claude Code. I will review and test.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QjT9Yj6cHrjktdMGdQq37b