(null)
useRememberedPageScroll(activeTab?.id, {
node: root,
panelSelector: '[data-slot="list-page-view-body"]',
})
const tabBodyFillsViewport = Boolean(
activeTab && LIST_PAGE_VIEWPORT_FILL_VIEWS.has(activeTab.viewType),
)
/** Hide lifecycle/Add-view toolbar when table-only + single tab (opt-in multi-view). */
const showViewsToolbar =
!hideViewsToolbar &&
(tabs.length > 1 ||
resolveSupportedViews(supportedViewTypes, TABLE_ONLY_HUB_SUPPORTED_VIEWS).length > 1)
const { viewsViewportRef, openViewLabels, visibleViewCount } = useViewsRowFit(
tabs.length,
showViewsToolbar,
)
const { canShedViews, shownViews, hiddenViews } = computeShownViews(
tabs,
activeTabId,
showViewsToolbar,
visibleViewCount,
)
const editViewFromRef = React.useMemo(
() => (tablePropertiesRef ? createListPageEditViewHandler(tablePropertiesRef) : undefined),
[tablePropertiesRef]
)
const resolvedOnEditView = onEditView ?? editViewFromRef
const actions = {
addView,
removeTab,
updateTab,
duplicateTab,
openRename: review.openRename,
openReview: review.openReview,
}
return (
<>
{/*
Block wrapper (not a flex column): sticky view tabs must not be flex
items of `PrimaryPageTemplate`'s content column — stretch/overflow
interactions made Tokens and other hubs lose sticky while Library looked fine.
*/}
{/* ── Views toolbar (not tablist: settings/close are not tabs — WCAG 1.3.1 / ARIA) ── */}
{showViewsToolbar ? (
) : null}
{/* ── Content — keyed by tab so each view tab owns its height (no stale min-height).
Page-scroll views (table / list / board) grow with `[data-page-scroll]`.
Viewport-fill views (folder / panel / tree / dashboard) use flex-1 + internal pane scroll. ── */}
{/* ── Export ──────────────────────────────────────────────── */}
resolveExportTotal(exportTotalRows, getTabCount, activeTab)}
/>
review.setReviewOpen(false)}
getTabCount={getTabCount}
/>
>
)
}