Skip to content

Fix: Bug: Empty space shown for Model field when saved provider no longer exists#552

Merged
dkotter merged 4 commits into
WordPress:developfrom
hbhalodia:fix/issue-551
May 15, 2026
Merged

Fix: Bug: Empty space shown for Model field when saved provider no longer exists#552
dkotter merged 4 commits into
WordPress:developfrom
hbhalodia:fix/issue-551

Conversation

@hbhalodia
Copy link
Copy Markdown
Contributor

@hbhalodia hbhalodia commented May 14, 2026

What?

Closes #551

Why?

  • PR removes the extra empty space, when provider and model are selected, and then provider is removed, it shows blank space in model selection area in settings.

How?

  • PR checks for current providers fetched and what is stored in settings. If current providers does not have that data, the field would not render.

Use of AI Tools

AI assistance: Yes
Tool(s): GitHub Copilot, Claude
Model(s): Claude Opus 4.6
Used for: Used for issue creation and PR description, plus review the approach.

Testing Instructions

  1. Open Developer Settings for any feature.
  2. Select a provider from the Provider dropdown.
  3. Select a model from the Model dropdown.
  4. Remove the selected provider (e.g., deactivate/delete the provider integration).
  5. Return to Developer Settings for the same feature.
  6. You would see there is no extra spacing.

Screenshots or screencast

Before After
Image Screenshot 2026-05-14 at 12 43 19 PM

Changelog Entry

Fixed - Empty space shown for Model field when saved provider no longer exists in developer settings.

Open WordPress Playground Preview

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 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: hbhalodia <hbhalodia@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 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.21%. Comparing base (94f5d40) to head (8b3d41a).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #552      +/-   ##
=============================================
+ Coverage      71.20%   71.21%   +0.01%     
- Complexity      1150     1151       +1     
=============================================
  Files             67       67              
  Lines           5563     5565       +2     
=============================================
+ Hits            3961     3963       +2     
  Misses          1602     1602              
Flag Coverage Δ
unit 71.21% <ø> (+0.01%) ⬆️

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.

Copy link
Copy Markdown
Collaborator

@dkotter dkotter left a comment

Choose a reason for hiding this comment

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

Thanks for the fixing this, tested and works as expected.

The one thing worth discussing is right now this properly hides the Model dropdown in the situation where someone removes a Connector. But when we make the AI request, we still try and use that Connector even though it doesn't exist.

While you could argue that's expected, the fact that we show the Provider dropdown as being set to Default is confusing here.

I wonder if we should output an error message above that dropdown letting the user know their previous chosen provider no longer exists and they need to update that our the feature won't work.

Or maybe add a new option to the dropdown in this scenario that has the previously set provider name and some helper text, like OpenAI - note this provider no longer exists and should be reset

@jeffpaul
Copy link
Copy Markdown
Member

I wonder if we should output an error message above that dropdown letting the user know their previous chosen provider no longer exists and they need to update that our the feature won't work.

I'd prefer this path

@hbhalodia
Copy link
Copy Markdown
Contributor Author

hbhalodia commented May 15, 2026

Thanks for the review @dkotter @jeffpaul, I have updated the PR to add the Warning Notice above the dropdown. Could you please review the PR?

Below is how it would be,
Screenshot 2026-05-15 at 2 54 45 PM

Let me know if copy text needs to be updated? or warning needs to be changed to error?

Update: I just noticed that, we have some place used Notice from @wordpress/ui. I am updating the PR to use the same here, so we can have less tech debt while we migrate/move from components to ui on the developerSettings page.

Ref -

ai/routes/ai-home/stage.tsx

Lines 1028 to 1049 in 7888332

<Notice.Root intent="error">
<Notice.Description>
{ ! PAGE_DATA.hasCredentials
? __(
'The AI plugin requires a valid AI Connector to function properly. Verify you have one or more AI Connectors configured.',
'ai'
)
: __(
'The AI plugin requires a valid AI Connector to function properly. Please review the AI Connectors you have configured to ensure they are valid.',
'ai'
) }
</Notice.Description>
{ PAGE_DATA.connectorsUrl && (
<Notice.Actions>
<Notice.ActionLink
href={ PAGE_DATA.connectorsUrl }
>
{ __( 'Manage Connectors', 'ai' ) }
</Notice.ActionLink>
</Notice.Actions>
) }
</Notice.Root>

Screenshot 2026-05-15 at 3 14 51 PM

Thanks,

@hbhalodia hbhalodia requested a review from dkotter May 15, 2026 09:26
Copy link
Copy Markdown
Collaborator

@dkotter dkotter left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the work here!

@dkotter dkotter merged commit 19ae2eb into WordPress:develop May 15, 2026
18 checks passed
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.

Bug: Empty space shown for Model field when saved provider no longer exists

3 participants