Repository navigation
Notes: show an unseen-notes indicator beside post titles on the post list screen #81948
Description
Claude drafted this companion to #81940 from my outline:
What problem does this address?
Sibling to #81940, which adds an unseen-notes count badge inside the editor. That badge only helps once you have already opened a post. On the post list screen there is still no way to tell which posts have new notes waiting - you have to open each post to find out.
Google Docs has the equivalent affordance one level up: in Drive, files with unread comment activity are marked so you know which documents need attention before opening them.
Prior work
- The post-list case was raised in the review of Notes: Feature to discover unread notes #80250: track a last-activity timestamp per post partly so "posts with new comments" could be surfaced on the post list screen.
- Show Discussions outside Editor #71622 proposed showing avatars for unresolved discussions in the post list; its PR Show open discussion indicators on posts page #71743 rendered an avatar stack inline after the post title and post states. The placement worked well and is the model here; the mechanism (a custom
WP_Posts_List_Tablesubclass swapped in viawp_list_table_class_name, with a per-row comments query) is what kept it from landing. - Show an unseen-notes count badge on the Notes toggle, like Google Docs #81940 defines the unseen-count semantics and persistence this issue reuses.
Proposed solution
Mark posts that have unseen note activity for the current user on the post list screen (edit.php) with an indicator rendered inline after the post title and its post states (where "— Draft" appears), following #71743's avatar placement: a blue dot, or a blue dot within a small note bubble (design input welcome). The indicator reuses the exact counting logic, persistence, and number treatment from #81940 - same per-user last-seen timestamp, same "own activity never counts" rule, same "9+" cap.
Placement: inline after the title and post states
Render the indicator in the title cell, immediately after the post states - the same spot #71743 put its avatars. A dedicated slim column beside the title was considered and set aside: that approach was tried and did not work well in practice.
To get there without #71743's list-table subclass, append the indicator through the display_post_states filter, which outputs inside the title cell right where the avatars rendered:
- No core class is replaced, so it coexists with plugins that also filter
wp_list_table_class_nameor the columns. - The title string itself is never modified, so plugins filtering
the_titleor the title column are unaffected. - Post states already accept markup from plugins (Elementor and others render icons there), so an inline badge is established practice.
If the post-states filter proves too constraining for the interactive markup (see requirement 3), the fallback is #71743's subclass with the render kept to one injected call - but the filter should be exhausted first.
Requirements
- Same semantics as Show an unseen-notes count badge on the Notes toggle, like Google Docs #81940: count unresolved note threads with activity newer than the user's last-seen timestamp for that post, excluding the user's own activity.
- Same number treatment: show the count in the badge, cap the display at "9+", announce the exact count to assistive tech (e.g. "3 unseen notes").
- Interaction: clicking the indicator opens the post in the editor with the Notes sidebar open (deep link), so the badge is an entry point, not just a marker.
- Performance: unseen state for a page of posts must come from a single query (latest note activity per post id compared against the user's timestamps) - no per-row queries, unlike Show open discussion indicators on posts page #71743's per-row
get_comments(). - Scope: only post types where notes are enabled, only for users who can read the post's notes.
- Clearing: opening the post's notes clears the indicator through the shared timestamp from Show an unseen-notes count badge on the Notes toggle, like Google Docs #81940 - no separate state.
Acceptance criteria
- A post with note activity since my last visit shows the indicator with the correct count inline after its title and post states on
edit.php. - Posts with no unseen activity (including only my own activity) show nothing.
- Counts of 10+ display as "9+"; the accessible name carries the exact number.
- Clicking the indicator lands in the editor with the Notes sidebar open.
- Opening a post's notes clears its indicator on the next list view, with no separate bookkeeping beyond the Show an unseen-notes count badge on the Notes toggle, like Google Docs #81940 timestamp.
- The list screen issues no additional query per row, verified against a screen of 20+ posts.
- A plugin filtering the title column (e.g. appending to
the_title) or adding its own post states does not disturb the indicator, and vice versa.
Proposed implementation plan
- Shared logic: land after (or with) Show an unseen-notes count badge on the Notes toggle, like Google Docs #81940's persistence; expose a helper that returns unseen counts for an array of post ids for the current user in one query.
- Indicator: PHP in
lib/compat/hookingdisplay_post_statesfor notes-enabled post types, appending the badge markup with the count and the deep link; bulk-prime the counts once per screen. - Styles: small stylesheet for the badge treatment (blue dot / bubble per the design outcome), enqueued only on list screens for enabled post types.
- Tests: PHPUnit coverage for the count helper (bulk query, permission checks, own-activity exclusion) and an e2e verifying the indicator, the deep link, and clearing.
Out of scope
- The DataViews-based lists in the site editor and dashboard - worth a follow-up so the two list surfaces stay in sync, but the classic list table is the target here.
- Avatars of note authors in the list (Show Discussions outside Editor #71622's original design) - the badge position could host that treatment later.
Open questions
- Blue dot alone, or dot-in-bubble with the count? A bare dot matches Drive; a counted bubble matches the in-editor badge from Show an unseen-notes count badge on the Notes toggle, like Google Docs #81940.
- Should a "has notes, all seen" state render anything (e.g. a muted bubble), or stay strictly new-activity-only (proposed)?
AI Use
The description came out of a back and forth with 🤖 Claude Code; no code in this issue.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields🏗️ In Progress
Activity
yashjawale commentedon Oct 13, 2026
Attached an implementation for this at #84620, building upon the timestamp in #81951 toggle badge PR.
Perhaps its better to wait till that one lands.