From 8979e0e3777666ce4b9811d527aabb4c3d48dc43 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 29 May 2026 14:03:49 -0400 Subject: [PATCH] refactor(I4): extract useInfiniteScroll composable; migrate 6 consumers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The IntersectionObserver-on-a-sentinel infinite-scroll pattern was copy- pasted in 7 places. New composables/useInfiniteScroll(sentinelRef, cb) owns the observer lifecycle (attach on mount, re-attach when the ref changes, disconnect on unmount). Migrated GalleryGrid, MasonryGrid (gallery+showcase), ArtistPostsTab, ArtistsView, TagsView, SeriesManageView. PostsView left manual on purpose — its anchored mode does bidirectional scroll-position preservation that doesn't fit the simple composable. I4(a) (timestamps) is effectively already done: the UTC displays were converted earlier; the remaining toLocaleString uses already render local time, so they're left as-is rather than churned for format-only consistency. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../src/components/artist/ArtistPostsTab.vue | 18 +++--------- .../src/components/discovery/MasonryGrid.vue | 20 ++++--------- .../src/components/gallery/GalleryGrid.vue | 22 ++++----------- frontend/src/composables/useInfiniteScroll.js | 28 +++++++++++++++++++ frontend/src/views/ArtistsView.vue | 18 ++++-------- frontend/src/views/SeriesManageView.vue | 11 +++----- frontend/src/views/TagsView.vue | 19 ++++--------- 7 files changed, 57 insertions(+), 79 deletions(-) create mode 100644 frontend/src/composables/useInfiniteScroll.js diff --git a/frontend/src/components/artist/ArtistPostsTab.vue b/frontend/src/components/artist/ArtistPostsTab.vue index d628f62..1a5fbc6 100644 --- a/frontend/src/components/artist/ArtistPostsTab.vue +++ b/frontend/src/components/artist/ArtistPostsTab.vue @@ -28,10 +28,11 @@