From 952b9808ec2147ff1213973609e449591575c044 Mon Sep 17 00:00:00 2001 From: Milan Ricoul Date: Thu, 19 Feb 2026 16:27:20 +0100 Subject: [PATCH 1/5] docs(README): add doc about version key --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 39c8cdf..68af1d5 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,10 @@ function register_collection() { \Blockparty\Icons\register_icon_collection( 'my_collection', [ - 'label' => 'My custom icons collection', - 'type' => 'sprite', - 'source' => get_stylesheet_directory() . '/dist/icons/sprite.svg', + 'label' => 'My custom icons collection', + 'type' => 'sprite', + 'source' => get_stylesheet_directory() . '/dist/icons/sprite.svg', + 'version' => wp_get_theme()->get( 'Version' ), // Optional: cache busting for sprite URL ] ); } @@ -41,6 +42,7 @@ This is an example for adding a SVG sprite as a source. If you want to add icons | `label` | Label of the collection. | | `source` | Path to the SVG sprite file or folder containing SVG files. | | `type` | | +| `version` | Optional. Version string used for cache busting (e.g. theme version). When set, the sprite URL is appended with a `?v=...` query parameter. | ## How to develop From b4e4d4e81462c1a15a3b256648dbc43e9c0323c7 Mon Sep 17 00:00:00 2001 From: mricoul Date: Thu, 19 Feb 2026 19:40:19 +0100 Subject: [PATCH 2/5] feat(icon-modal): improve search results display --- src/components/icon-modal.js | 44 +++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/src/components/icon-modal.js b/src/components/icon-modal.js index 6518760..e89a25f 100644 --- a/src/components/icon-modal.js +++ b/src/components/icon-modal.js @@ -21,7 +21,7 @@ import { TabPanel, TextHighlight, } from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; +import { __, sprintf } from '@wordpress/i18n'; import { Icon, settings } from '@wordpress/icons'; import { useSelect, useDispatch } from '@wordpress/data'; import { store as preferencesStore } from '@wordpress/preferences'; @@ -468,13 +468,7 @@ function IconModal( { collections, onClose, handleIconSelectButtonClick } ) { ( () => { const filteredCollections = collectionsArr.filter( ( c ) => { - // During search, show all collections (even if empty) - // Otherwise, only show collections with icons or loading - if ( - debouncedSearchInput.trim() - ) { - return true; - } + // Only show collections that have results or are still loading return ( c.icons?.length > 0 || c.loading @@ -504,14 +498,42 @@ function IconModal( { collections, onClose, handleIconSelectButtonClick } ) { ); } + const isSearching = + !! debouncedSearchInput.trim(); + const firstCollectionWithResults = + filteredCollections.find( + ( c ) => c.icons?.length > 0 + ); + const initialTabName = + firstCollectionWithResults?.name ?? + filteredCollections[ 0 ]?.name; + return ( ( { name: c.name, - title: capitalize( - c.name - ), + title: isSearching + ? sprintf( + /* translators: 1: collection name, 2: number of results */ + __( + '%1$s (%2$d)', + 'blockparty-icons' + ), + capitalize( + c.name + ), + c.icons + ?.length ?? + 0 + ) + : capitalize( + c.name + ), } ) ) } > From 3064841adcfa71fad4a44ea38532d69ef527cc04 Mon Sep 17 00:00:00 2001 From: mricoul Date: Fri, 20 Feb 2026 09:30:27 +0100 Subject: [PATCH 3/5] feat: remove unseen error message --- src/components/icon-modal.js | 40 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/src/components/icon-modal.js b/src/components/icon-modal.js index e89a25f..a3e9e54 100644 --- a/src/components/icon-modal.js +++ b/src/components/icon-modal.js @@ -306,10 +306,17 @@ function IconModal( { collections, onClose, handleIconSelectButtonClick } ) {