Skip to content

Fix: Improve consistency of the Dashboard widgets when no-js#12677

Open
hbhalodia wants to merge 5 commits into
WordPress:trunkfrom
hbhalodia:fix/issue-65692
Open

Fix: Improve consistency of the Dashboard widgets when no-js#12677
hbhalodia wants to merge 5 commits into
WordPress:trunkfrom
hbhalodia:fix/issue-65692

Conversation

@hbhalodia

Copy link
Copy Markdown

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

Use of AI Tools

  • None

Screenshots

Before After
Screenshot 2026-07-24 at 1 27 45 PM Screenshot 2026-07-24 at 1 27 29 PM

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Copilot AI review requested due to automatic review settings July 24, 2026 07:59
@github-actions

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

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Improves the Dashboard’s widget presentation when JavaScript is disabled (“no-js”), aiming to avoid empty/awkward widget states and align no-js fallbacks across widgets.

Changes:

  • Add a no-js “no recent drafts” message to the Quick Draft / Recent Drafts area when there are no drafts.
  • Update the Events and News widget’s no-js messaging.
  • Adjust Site Health widget markup affecting what’s shown when JS is disabled.
Comments suppressed due to low confidence (1)

src/wp-admin/includes/dashboard.php:1383

  • This notice string is currently hardcoded (not translatable) and also spells “Javascript” instead of “JavaScript”. Since this is part of a core dashboard widget UI, it should use a translation function and consistent spelling.
	$community_events_notice  = '<p class="hide-if-js">' . ( 'The WordPress Events and News feeds require Javascript.' ) . '</p>';

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/wp-admin/includes/dashboard.php Outdated
?>
<div class="health-check-widget">
<div class="health-check-widget-title-section site-health-progress-wrapper loading hide-if-no-js">
<div class="health-check-widget-title-section site-health-progress-wrapper loading">

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That is in discussion here - https://core.trac.wordpress.org/ticket/65692#comment:3, to improve CSS it could be fine.

Copilot AI review requested due to automatic review settings July 24, 2026 08:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

src/wp-admin/includes/dashboard.php:1196

  • User-facing string uses "Javascript" rather than the standard "JavaScript" capitalization. This will be visible in the no-JS fallback notice for the Events and News widget.
		__( 'The WordPress Events and News feeds require JavaScript.' ),

src/wp-admin/includes/dashboard.php:1383

  • This notice string is currently hard-coded (not wrapped in a translation function), so it can’t be localized. It also uses "Javascript" instead of "JavaScript". Since adjacent strings in this notice are translated, this should be too for consistency and i18n coverage.
	$community_events_notice  = '<p class="hide-if-js">' . ( 'The WordPress Events and News feeds require JavaScript.' ) . '</p>';

src/wp-admin/includes/dashboard.php:2009

  • Removing hide-if-no-js here causes the Site Health progress wrapper to display in a perpetual loading state when JavaScript is disabled. The site-health script is responsible for removing the loading class and setting the progress label/bar; without JS this never updates, so the UI becomes misleading.
		<div class="health-check-widget-title-section site-health-progress-wrapper loading">

Copilot AI review requested due to automatic review settings July 24, 2026 08:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment on lines +664 to +666
echo '<div class="drafts hide-if-js">';
echo '<h2>' . __( 'There are no recent drafts.' ) . '</h2>';
echo '</div>';
Comment thread src/wp-admin/includes/dashboard.php Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 08:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

src/wp-admin/includes/dashboard.php:666

  • In no-JS mode the widget title is already “Your Recent Drafts”, so adding an inner

    here introduces a second heading level that can be confusing for screen reader heading navigation. Also, this is plain text output and should be escaped in HTML context.

			echo '<div class="drafts hide-if-js">';
			echo '<h2>' . __( 'There are no recent drafts.' ) . '</h2>';
			echo '</div>';

src/wp-admin/includes/dashboard.php:2009

  • Removing hide-if-no-js makes the progress “loading” indicator visible when JavaScript is disabled, but the loading state is only cleared by site-health.js (which won’t run in no-JS). That leaves a permanent loading UI in no-JS contexts.
		<div class="health-check-widget-title-section site-health-progress-wrapper loading">

Comment on lines 1195 to 1197
$loading .= wp_get_admin_notice(
__( 'This widget requires JavaScript.' ),
__( 'The WordPress Events and News feeds require JavaScript.' ),
array(
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.

2 participants