From 6e28d1530aa08b878f5082bbcd85a95f84f830e8 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 14 Feb 2026 21:34:49 -0800 Subject: chore: update build artifacts and finalize test improvements --- .../coverage/src/components/FeedItems.tsx.html | 254 +++++++++++++-------- 1 file changed, 154 insertions(+), 100 deletions(-) (limited to 'frontend/coverage/src/components/FeedItems.tsx.html') diff --git a/frontend/coverage/src/components/FeedItems.tsx.html b/frontend/coverage/src/components/FeedItems.tsx.html index f6b7493..9811743 100644 --- a/frontend/coverage/src/components/FeedItems.tsx.html +++ b/frontend/coverage/src/components/FeedItems.tsx.html @@ -23,30 +23,30 @@
- 88.97% + 89.23% Statements - 113/127 + 116/130
- 75.3% + 76.19% Branches - 61/81 + 64/84
- 86.2% + 87.09% Functions - 25/29 + 27/31
- 88.69% + 89.07% Lines - 102/115 + 106/119
@@ -296,7 +296,25 @@ 231 232 233 -234  +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252        @@ -304,78 +322,78 @@       -27x -27x -27x +36x +36x +36x   -27x -27x -27x -27x -27x -27x +36x +36x +36x +36x +36x +36x   -27x -8x -1x -  -7x -7x -  -8x +36x +11x +3x   8x 8x   -8x +11x +  +11x +11x +  +11x 2x -6x +9x 1x     -8x -1x +11x +3x       -8x -8x +11x +11x       -8x +11x   -8x +11x         -8x -8x +11x +11x       -8x -8x -8x +11x +11x +11x     -8x +11x   -7x +10x     -7x -  +10x   -6x -1x   -5x +9x +3x   6x -6x -6x +  +9x +9x +9x     1x @@ -384,20 +402,21 @@       -27x -7x -7x +36x +8x +8x       -27x -2x -2x -2x   +36x +5x +5x +5x     -27x +  +36x 2x   3x @@ -409,7 +428,7 @@       -27x +36x 1x   2x @@ -421,22 +440,29 @@       -27x -23x -3x +36x +31x +6x   -3x -2x -2x -2x -2x -2x +6x +5x +5x +5x +5x +5x 1x   -2x +5x +    +  +  +5x 2x   +  +5x +  1x     @@ -455,25 +481,19 @@       -23x -23x +31x +31x         -27x -24x   -2x +36x   -2x -1x -1x +31x   1x   -  -  1x 1x 1x @@ -488,29 +508,45 @@       -24x -15x -15x +  +31x +  +1x +1x +1x +      -24x -24x   -24x     -27x -14x +31x +31x +31x   -13x   +31x +31x   +31x +31x +31x         +36x 21x   +20x +  +  +  +  +  +  +44x +        @@ -620,6 +656,7 @@ export default function FeedItems() { useEffect(() => { fetchItems(); setSelectedIndex(-1); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [feedId, tagName, filterFn, searchParams]);     @@ -668,6 +705,13 @@ export default function FeedItems() { } scrollToItem(nextIndex); } +  + // If we're now on the last item and there are more items to load, + // trigger loading them so the next 'j' press will work + if (nextIndex === items.length - 1 && hasMore && !loadingMore) { + fetchItems(String(items[items.length - 1]._id)); + } +  return nextIndex; }); I} else if (e.key === 'k') { @@ -690,22 +734,16 @@ export default function FeedItems() {   window.addEventListener('keydown', handleKeyDown); return () => window.removeEventListener('keydown', handleKeyDown); - }, [items]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [items, hasMore, loadingMore]);       useEffect(() => { - const observer = new IntersectionObserver( + // Observer for marking items as read + const itemObserver = new IntersectionObserver( (entries) => { entries.forEach((entry) => { - // Infinity scroll sentinel - if (entry.target.id === 'load-more-sentinel') { - Eif (entry.isIntersecting && !loadingMore && hasMore && items.length > 0) { - fetchItems(String(items[items.length - 1]._id)); - } - return; - } -  // If item is not intersecting and is above the viewport, it's been scrolled past Eif (!entry.isIntersecting && entry.boundingClientRect.top < 0) { const index = Number(entry.target.getAttribute('data-index')); @@ -720,16 +758,32 @@ export default function FeedItems() { }, { root: null, threshold: 0 } ); +  + // Observer for infinite scroll (less aggressive, must be fully visible) + const sentinelObserver = new IntersectionObserver( + (entries) => { + entries.forEach((entry) => { + Eif (entry.isIntersecting && !loadingMore && hasMore && items.length > 0) { + fetchItems(String(items[items.length - 1]._id)); + } + }); + }, + { root: null, threshold: 1.0 } + );   items.forEach((_, index) => { const el = document.getElementById(`item-${index}`); - Eif (el) observer.observe(el); + Eif (el) itemObserver.observe(el); });   const sentinel = document.getElementById('load-more-sentinel'); - if (sentinel) observer.observe(sentinel); + if (sentinel) sentinelObserver.observe(sentinel);   - return () => observer.disconnect(); + return () => { + itemObserver.disconnect(); + sentinelObserver.disconnect(); + }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [items, loadingMore, hasMore]);   if (loading) return <div className="feed-items-loading">Loading items...</div>; @@ -769,7 +823,7 @@ export default function FeedItems() {