close
Skip to content

Hide empty provider capabilities section#616

Merged
dkotter merged 4 commits into
WordPress:developfrom
ekamran:shifteq/hide-empty-provider-capabilities-section
May 26, 2026
Merged

Hide empty provider capabilities section#616
dkotter merged 4 commits into
WordPress:developfrom
ekamran:shifteq/hide-empty-provider-capabilities-section

Conversation

@ekamran
Copy link
Copy Markdown
Contributor

@ekamran ekamran commented May 23, 2026

What?

Hides the dashboard widget's Provider Capabilities section when no provider capability rows can be rendered.

Why?

The AI Capabilities dashboard widget already conditionally renders some UI based on available content. For example, the Abilities Explorer link only appears when that feature is enabled.

The Provider Capabilities section was different: it could render the section heading even when no provider capability rows were available. This left an empty section in the dashboard widget, which looked incomplete.

How?

This updates the provider capabilities rendering so it first collects providers that have renderable capabilities.

If no provider rows are available, the section is not rendered. If provider capabilities are available, the heading and rows continue to render as before.

A regression test was added for the empty provider capability state.

Testing Instructions

Automated checks run locally:

npm run lint:php -- includes/Admin/Dashboard/AI_Capabilities_Widget.php tests/Integration/Includes/Dashboard/AI_Capabilities_WidgetTest.php
npm run test:php -- --filter AI_Capabilities_WidgetTest
npm run lint:php:stan -- includes/Admin/Dashboard/AI_Capabilities_Widget.php tests/Integration/Includes/Dashboard/AI_Capabilities_WidgetTest.php
git diff --check

Result:

  • PHP coding standards passed.
  • Focused PHPUnit test passed.
  • PHPStan passed.
  • Diff whitespace check passed.

Manual verification:

  1. Open the WordPress dashboard.
  2. Confirm the AI Capabilities widget is visible.
  3. With no provider capabilities available to render, confirm the widget does not show an empty Provider Capabilities section.
  4. When provider capabilities are available, confirm the section still renders normally.

Screenshots/Screencast

Before

The Provider Capabilities heading appeared even though no provider capability rows were shown.

BEFORE

After

The empty Provider Capabilities section is no longer rendered.

AFTER

Use of AI Tools

AI assistance: Yes
Tool(s): ChatGPT / Codex
Used for: Repository review, reproduction planning, implementation guidance, test updates, and local verification. I reviewed the changes, tested the behavior locally, and take responsibility for the final submission.

Open WordPress Playground Preview

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 23, 2026

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ekamran <ekamran@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.01%. Comparing base (a21b69d) to head (9724cf5).

Files with missing lines Patch % Lines
...ncludes/Admin/Dashboard/AI_Capabilities_Widget.php 95.65% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #616      +/-   ##
=============================================
+ Coverage      73.41%   74.01%   +0.59%     
- Complexity      1734     1736       +2     
=============================================
  Files             85       85              
  Lines           7486     7492       +6     
=============================================
+ Hits            5496     5545      +49     
+ Misses          1990     1947      -43     
Flag Coverage Δ
unit 74.01% <95.65%> (+0.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

jeffpaul
jeffpaul previously approved these changes May 26, 2026
Copy link
Copy Markdown
Member

@jeffpaul jeffpaul left a comment

Choose a reason for hiding this comment

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

Tests well via Playground, thanks!

@jeffpaul jeffpaul requested a review from dkotter May 26, 2026 15:09
@dkotter dkotter merged commit 485c884 into WordPress:develop May 26, 2026
18 checks passed
@github-project-automation github-project-automation Bot moved this from Needs review to Done in WordPress AI Planning & Roadmap May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants