From 419733e19e955e08c74fa67e07dc6942cf22d335 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Oct 2026 14:07:21 +0000 Subject: [PATCH] refactor(docs): virtualize icon overviews with @tanstack/vue-virtual Replace @vueuse/core's useVirtualList, which assumed a fixed 64px row height, with useWindowVirtualizer from @tanstack/vue-virtual in the icons and categories overviews. - Rows are measured after render, so stretched grid cells and category headings no longer make the content jump while scrolling. - Scroll against the window with the list's page offset as scroll margin, instead of forwarding window scroll events by hand. - Match the column count to the CSS auto-fill grid. - Scroll to a category below the sticky search bar. Shared logic lives in composables/useIconGridVirtualizer.ts. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01G9u8FiKAWTfN2uj8sqzqSi --- .../icons/IconsCategoryOverview.vue | 94 +++++++---- .../theme/components/icons/IconsOverview.vue | 79 ++++++--- .../composables/useIconGridVirtualizer.ts | 153 ++++++++++++++++++ .../theme/composables/useScrollToCategory.ts | 12 +- docs/package.json | 1 + pnpm-lock.yaml | 19 ++- 6 files changed, 291 insertions(+), 67 deletions(-) create mode 100644 docs/.vitepress/theme/composables/useIconGridVirtualizer.ts diff --git a/docs/.vitepress/theme/components/icons/IconsCategoryOverview.vue b/docs/.vitepress/theme/components/icons/IconsCategoryOverview.vue index e3aab9189..6eb7d1ed2 100644 --- a/docs/.vitepress/theme/components/icons/IconsCategoryOverview.vue +++ b/docs/.vitepress/theme/components/icons/IconsCategoryOverview.vue @@ -1,5 +1,5 @@