Skip to content

Font Library: Show contextual warning when deleting a font that is in use#78153

Open
dhruvikpatel18 wants to merge 1 commit into
WordPress:trunkfrom
dhruvikpatel18:feat/adjust-font-deletion-warning
Open

Font Library: Show contextual warning when deleting a font that is in use#78153
dhruvikpatel18 wants to merge 1 commit into
WordPress:trunkfrom
dhruvikpatel18:feat/adjust-font-deletion-warning

Conversation

@dhruvikpatel18
Copy link
Copy Markdown
Contributor

@dhruvikpatel18 dhruvikpatel18 commented May 11, 2026

Closes #55175

What?

Updates the delete confirmation dialog in the Font Library to show a stronger, context-aware warning when the font being deleted is currently assigned to a style target (body text, headings, elements, or blocks) in the site's global styles.

Why?

Previously, the delete confirmation dialog showed the same generic message regardless of whether the font was actively used anywhere on the site.

That gave no indication to the user that deleting the font would have a visible impact on their site — pages using that font would silently fall back to the default font with no warning. This was flagged in the FSE Outreach Program's Final Touches testing call as confusing and potentially destructive behaviour.

Testing Instructions

  1. Open the Site Editor.
  2. Navigate to Styles → Typography → Text and assign a custom installed font (e.g. "AR One Sans") as the font family. Save the changes.
  3. Open Fonts → Library (the font library modal).
  4. Select the font you just assigned (e.g. "AR One Sans").
  5. Click the Delete button.
  6. Confirm the dialog now shows the in-use warning message mentioning the font is currently used in site styles and that the site will fall back to the default font.
  7. Cancel the dialog. Now go back to Styles → Typography → Text and remove the font assignment (set it back to Default). Save.
  8. Open the font library again, select the same font, and click Delete.
  9. Confirm the dialog now shows the original generic confirmation message (no in-use warning).
  10. Verify deleting in both cases still works correctly, the font is removed and the success notice appears.

Screenshots or screencast

Screen.Recording.2026-05-11.at.3.57.09.PM.mov

@dhruvikpatel18 dhruvikpatel18 marked this pull request as ready for review May 12, 2026 04:35
@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.

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: dhruvikpatel18 <dhruvik18@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>

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

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

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.

Font Library: adjust warning when a font is in use and is about to be deleted

1 participant