Skip to content

On This Day dashboard widget follow up - #14866

Open
peterwilsoncc wants to merge 35 commits into
WordPress:trunkfrom
peterwilsoncc:do/65116-otd-follow-up
Open

peterwilsoncc wants to merge 35 commits into
WordPress:trunkfrom
peterwilsoncc:do/65116-otd-follow-up

Conversation

@peterwilsoncc

@peterwilsoncc peterwilsoncc commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Makes the following changes to the On This Day dashboard widget:

  • Displays up to 100 posts
  • Sets the feature as opt-in, per my comment on the ticket regarding the potential for these features to be upsetting.
  • Adds a wp prefix in a bunch of places (mainly IDs and classes)
  • tidy up the test suite a bit to include assertion messages, remove remove_filter where it's not needed, use the get_echo() helper.

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

Use of AI Tools

  • Claude Opus 5.5 Medium
  • Not used for source changes
  • Used for the following in the test suite:
    • Clean up to use get_echo() helper
    • Adding unique message parameters to tests with multiple assertions
    • drafting the tests for opt-in, opt-out and pre choice tests
    • drafting each test summary

@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.

Comment thread src/js/_enqueues/admin/postbox.js Outdated
Comment on lines +366 to +372
$( '#wp-on-this-day-posts-form form button' ).on( 'click.postboxes', function( event ) {
event.preventDefault();
var enabled = '1' === $( this ).prop( 'value' );

postboxes.setOnThisDayDisplay( enabled );
postboxes.save_on_this_day_display( enabled );
} );

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this better in another location?

@peterwilsoncc
peterwilsoncc marked this pull request as ready for review October 26, 2026 01:50
@github-actions

github-actions Bot commented Oct 26, 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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @joen.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Props peterwilsoncc, westonruter, fcoveram, annezazu, audrasjb.

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Comment thread src/js/_enqueues/admin/postbox.js Outdated
Comment thread src/wp-admin/includes/ajax-actions.php Outdated
Comment thread src/wp-admin/includes/ajax-actions.php Outdated
Comment thread src/wp-admin/includes/class-wp-screen.php Outdated
Comment thread src/wp-admin/includes/dashboard.php Outdated
Comment thread src/wp-admin/includes/dashboard.php Outdated
Comment thread src/wp-admin/includes/dashboard.php Outdated
Comment thread src/wp-admin/includes/dashboard.php Outdated
Comment thread src/wp-admin/includes/screen.php Outdated
Co-authored-by: Weston Ruter <westonruter@gmail.com>
@github-actions

This comment has been minimized.

Co-authored-by: Weston Ruter <westonruter@gmail.com>
@peterwilsoncc

peterwilsoncc commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

@propsbot add Joen

peterwilsoncc and others added 2 commits October 26, 2026 14:16
Co-authored-by: Weston Ruter <westonruter@gmail.com>
@fcoveram

Copy link
Copy Markdown

It works as expected. I just noticed two things

Spacing at the bottom of the widget

There is an extra space at the bottom of the widget that's unnecessary. I that that removing it with a last-child property is sufficient.

CleanShot 2026-10-26 at 15 11 47@2x

Zebra stripping in different heights

The white and grey rows have different sizes (respectively, red and green in the screenshot). I see in Chrome's inspector there is a bottom margin of 6px that pushes the white rows higher.

CleanShot 2026-10-26 at 15 17 23@2x

As suggested in this comment in the trac ticket, it would be great to have the filter options.

@annezazu

Copy link
Copy Markdown

This seems to be working well. I don't feel strongly around opt in vs opt out and I also think just being able to opt out at all is what's needed. Thinking about my own use case, I have a number of quite upsetting posts on my blog and none are tagged/categorized in a way where I could easily track them down, without needing to go back through all of them to tag them with the same thing (sounds awful to do). I do like the idea of hiding individual posts though as that feels like a more likely use case to start.

I found one minor inconsistency to clean up where if you opt in then opt out, there's an extra line in the widget that doesn't appear on a fresh install.

Opting in with this PR:

Screenshot 2026-10-26 at 9 56 08 AM

Post opt out with this PR:

Screenshot 2026-10-26 at 9 56 44 AM

View of 7.1:

See the extra line at the bottom
Screenshot 2026-10-26 at 9 56 16 AM

@peterwilsoncc

Copy link
Copy Markdown
Contributor Author

Night brain figured out the cause of the extra line, I'll push some commits to fix it over the next few days.

At present the opt-in form only displays on days which feature OTD posts. This is so turning the feature on results in a display. I can modify it to display placeholder text when a user toggle the display (and only when they toggle). Is that useful?

@peterwilsoncc

Copy link
Copy Markdown
Contributor Author

...over the next few days.

Hours... not days. I guess I am still waking up.

@audrasjb

Copy link
Copy Markdown
Contributor

This looks good to me, event if I don't have a strong opinion about he opt-in/opt-out feature. Yes I read your previous comment before, but I'm not that convinced that we need to complexify the interface and the technical implementation that much. But I don't have strong feelings against the proposal, too 🤷

@peterwilsoncc

Copy link
Copy Markdown
Contributor Author

I've pushed some changes to fix the following:

  • extra space at end of widget
  • modified the list item styles to avoid the spacing (caused by an interaction with common.css) in the zebra striping

@peterwilsoncc

Copy link
Copy Markdown
Contributor Author

As suggested in this comment in the trac ticket, it would be great to have the filter options.

@fcoveram Agreed but I think that can be a stretch goal post beta 2. I think it will add a lot more complexity to the widget.

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.

5 participants