Skip to content

Add a Notes section in the Dashboard Activity widget - #13076

Open
mcrisp1972 wants to merge 17 commits into
WordPress:trunkfrom
mcrisp1972:ticket/65890
Open

Add a Notes section in the Dashboard Activity widget#13076
mcrisp1972 wants to merge 17 commits into
WordPress:trunkfrom
mcrisp1972:ticket/65890

Conversation

@mcrisp1972

@mcrisp1972 mcrisp1972 commented Aug 16, 2026

Copy link
Copy Markdown

We are adding notes posted to blocks in the editor to the Recent Activity widget in the admin dashboard.

Trac ticket: https://core.trac.wordpress.org/ticket/65890

Testing

Tool to create many notes: https://github.com/t-hamano/notes-data-generator

https://playground.wordpress.net/wordpress.html?pr=13076

Screenshot

image

More screenshots

Claude seeded a site with notes and captured the widget in each state:

The test site has six posts carrying note threads: several threads have replies, some threads are resolved, one post has every thread resolved, and one post belongs to another author.

The Activity widget with five posts that have open notes. Each row links to the post, counts the open threads on it, and is dated by the newest note or reply on that post.

Activity widget showing the Recent Notes section with five posts

Where those counts come from. The same post in the editor: four open threads, two of them with replies, and the resolved threads below the divider. The dashboard reads "4 open notes" for it.

Editor sidebar listing four open note threads and the resolved ones

Eight more states

A post with one open thread uses the singular string.

Recent Notes listing a single post with one open note

Every thread resolved on every post, so the Notes section is not rendered at all and the rest of the widget is unchanged.

Activity widget with no Recent Notes section

A thread replied to minutes ago on a six-day-old note sorts to the top, dated by the reply rather than by the note that opened the thread.

Recent Notes ordered by the most recent reply

Dates across the year: today, earlier this year, and last year, which picks up the year.

Recent Notes rows dated today, earlier this year, and last year

Long titles, a post with 24 open notes, and an untitled draft in the same list.

Recent Notes with a wrapping title, a 24 note count, and a no title row

Signed in as an author who can only edit their own post: the posts they cannot edit drop out of the list, notes and all.

Activity widget for an author, listing only their own post

At 420px wide, the three columns tighten and the count wraps rather than overflowing.

Activity widget at mobile width

The whole dashboard for context.

Full dashboard with the Activity widget

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props mcrisp1972, ancawonka, aosmichenko, adamsilverstein.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

aosmichenko and others added 7 commits August 16, 2026 13:36
WP_Comment exposes its columns as strings, so passing comment_post_ID
straight to _draft_or_post_title() and get_edit_post_link() fails static
analysis. It also repeated an error pattern the PHPStan baseline records
once for the comments widget, pushing that entry out of date.
Comment thread src/wp-admin/includes/dashboard.php Outdated
@adamsilverstein adamsilverstein changed the title Ticket/65890 Add a Notes section in the Dashboard Activity widget Aug 16, 2026
Tallying the open notes of the displayed posts loaded every one of those
notes just to count rows, an unbounded query on a busy post. Query each
post's count instead, which returns a single value and skips priming the
comment and meta caches.
Covers the edit link, the post title and its placeholder, escaping, the
open note count and its singular and plural forms, and the relative date
each row ends with, including its use of the timezone of the site.

The dashboard had no test coverage of its own before this.
…old.

A note is created on hold and is approved when it is resolved, so the row
tests now create their notes the way the editor does.

Adds coverage of the listing itself: the open note count, which posts are
listed and in what order, and the exclusion of resolved threads, replies
and regular comments.
The section queried the notes that start a thread and dated each post by
one of those, so a thread opened weeks ago and replied to this morning
was dated weeks ago, and sorted below a thread nobody had touched since
it was opened.

Query replies too, and date each post by the most recent note or reply in
a thread that is still open. Resolving a thread approves the note that
starts it while its replies stay on hold, so the thread a reply belongs to
is checked before the reply counts as activity. The threads are primed in
one query per page rather than fetched one at a time.

Also pass 'orderby' => 'none' to the open note counts, which do not need
the ordering, matching get_comment_count().
@adamsilverstein

adamsilverstein commented Aug 16, 2026

Copy link
Copy Markdown
Member

Working on this a few points emerged:

  • Rather than showing recent Notes, we decided to show the Posts with the most recent notes or replies. There is no "Notes" screen to link to, when you have a new note, the main action is to view the note on the edit post screen.
  • Showing the most recent date is tricky, we need only unresolved threads, which is recorded at the top level note - but we still want the date from the most recent reply. This complicated querying for the notes to get what we needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants