Skip to content

SidebarSectionCounts

SidebarSectionCounts = Partial<Record<SidebarSection, number>>

Defined in: packages/core/src/sidebarSectionCountsCookie.ts:27

The admin sidebar’s last-settled item count per section — the <Suspense> fallback (AdminSidebarSkeleton, @vexcms/react’s AdminLayout) reads this server-side so it can render each section’s header AND exactly as many skeleton rows as that section is about to settle with, instead of one fixed generic row count that pops into a different shape (headers appearing, far more/fewer rows) once the real, permission-filtered nav items arrive — the same “skeleton reproduces the settled shape” contract ListViewSkeletonRowCountMap already established for a list view’s own <Suspense> fallback.

A section is only written once its OWN real item count is known (never a partial/intermediate value) — 0 is a valid, explicitly-remembered count: that section’s header stays hidden on the NEXT first paint too, the same way AppSidebar already hides it today once auth resolves, until the caller regains access to at least one item in it.