1- use crate :: constants:: { SKIP_EXTRA_PROP , TYPE_PRIORITIES } ;
1+ use crate :: constants:: { CATALOG_PAGE_SIZE , SKIP_EXTRA_PROP , TYPE_PRIORITIES } ;
22use crate :: models:: common:: {
33 compare_with_priorities, eq_update, resource_update_with_vector_content, ResourceAction ,
44 ResourceLoadable ,
@@ -28,6 +28,9 @@ pub trait CatalogResourceAdapter {
2828 fn resource ( ) -> & ' static str ;
2929 fn catalogs ( manifest : & Manifest ) -> & [ ManifestCatalog ] ;
3030 fn selectable_priority ( ) -> SelectablePriority ;
31+ fn page_size ( ) -> Option < usize > {
32+ None
33+ }
3134}
3235
3336impl CatalogResourceAdapter for MetaItemPreview {
@@ -40,6 +43,9 @@ impl CatalogResourceAdapter for MetaItemPreview {
4043 fn selectable_priority ( ) -> SelectablePriority {
4144 SelectablePriority :: Type
4245 }
46+ fn page_size ( ) -> Option < usize > {
47+ Some ( CATALOG_PAGE_SIZE )
48+ }
4349}
4450
4551impl CatalogResourceAdapter for DescriptorPreview {
@@ -485,7 +491,11 @@ fn selectable_update<T: CatalogResourceAdapter>(
485491 page. content
486492 . as_ref ( )
487493 . and_then ( |content| content. ready ( ) )
488- . filter ( |content| !content. is_empty ( ) )
494+ . filter ( |content| {
495+ T :: page_size ( )
496+ . map ( |page_size| content. len ( ) == page_size)
497+ . unwrap_or_else ( || !content. is_empty ( ) )
498+ } )
489499 . map ( |content| content. len ( ) )
490500 } )
491501 . collect :: < Option < Vec < _ > > > ( )
0 commit comments