Skip to content

Font Library: Paginate installed fonts - #86063

Open
Mustafabharmal wants to merge 3 commits into
WordPress:trunkfrom
Mustafabharmal:update/font-library-paginate-installed-fonts
Open

Mustafabharmal wants to merge 3 commits into
WordPress:trunkfrom
Mustafabharmal:update/font-library-paginate-installed-fonts

Conversation

@Mustafabharmal

Copy link
Copy Markdown
Contributor

What?

Closes #84688

Paginates the installed fonts in the Font Library's Library tab, the same way as the Install tab.

Why?

Since #84684, all installed font families are loaded and listed at once, so a site with many custom fonts gets a very long list. See #84684 (review).

How?

  • Theme and custom fonts are paginated as one list, theme fonts first, so every page has the same number of fonts. Each group's heading is only shown on the pages that include fonts from it.
  • The pagination controls and page size are extracted from the Install tab into a shared Pagination component, so both tabs look and behave the same. The standalone Appearance > Fonts page uses the same component.
  • Going back from a font shows the page that contains it, so focus returns to its card, also when the font was opened from Typography > Fonts.
  • The per_page: -1 query from Font Library: Load all installed font families #84684 is kept, like the template and pattern lists, which fetch all items and paginate on the client. This keeps fonts sorted alphabetically, and the installed variants check from Font Library: Mark installed font variants in font collections #84023 keeps working. Paginating the request itself would need orderby: title support in the font families REST endpoint, and can be done in a follow-up.

Testing Instructions

  1. Install enough custom font families to fill more than one page (for example, 20 from a font collection).
  2. Open the Site Editor > Styles > Typography > Manage fonts > Library.
  3. Page 1 lists the theme fonts followed by the first custom fonts. Later pages list only custom fonts, still sorted alphabetically.
  4. The pagination controls in the footer look and work the same as in the Install tab.
  5. Go to page 3, open a font, and go back. Page 3 is still shown and focus returns to the font.
  6. Close the modal, click a custom font near the end of the Typography > Fonts list, then go back. The page with that font is shown.
  7. Delete the only font on the last page. The previous page is shown.
  8. Check the Install tab and Appearance > Fonts. Pagination works as before.

Screenshots or screencast

Before After
image image

Use of AI Tools

Claude Code (Claude Opus 5.5) was used to investigate the issue, draft the fix, and draft this description. I reviewed all changes, ran the tests and verified the behaviour manually.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 Props

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: Mustafabharmal <mustafabharmal@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

This branch has not been deployed

No deployments
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: Paginate installed custom fonts

1 participant