feat: infinite scroll on shared folder/project pages - #160
Conversation
Replaces the Previous/Next pager on the guest share page with the same infinite-scroll pattern the project/folder grid already uses: an IntersectionObserver sentinel (useInfiniteScroll), a request ref that tracks page + append, and onSuccess accumulation with name-dedupe. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N6kPRDGo6QbcVcc8DPkMTf
Greptile SummaryThis PR replaces Previous/Next pagination on guest shared project and folder pages with sentinel-driven infinite scrolling.
Confidence Score: 4/5This PR is not safe to merge until failed infinite-scroll requests stop automatically retrying without a bound or backoff. Clearing the infinite-scroll busy state after every failed reload retriggers loading while the sentinel remains visible and Files Needing Attention: frontend/src/pages/SharedProjectPage.vue
|
| Filename | Overview |
|---|---|
| frontend/src/pages/SharedProjectPage.vue | Implements infinite-scroll pagination correctly on successful requests, but failed load-more requests can trigger an unbounded automatic retry cycle. |
Prompt To Fix All With AI
### Issue 1
frontend/src/pages/SharedProjectPage.vue:330-331
**Failed requests retry forever**
When a load-more request fails while the sentinel remains visible, this `finally` block clears `loadingMore`. The infinite-scroll watcher immediately tries again because the sentinel still intersects and `hasMore` remains true. A persistent network or server error therefore creates an unbounded retry loop that can flood the shared-assets endpoint. Handle the failure or prevent automatic retries until a new user or observer event occurs.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat: infinite scroll on shared folder/p..." | Re-trigger Greptile
| void assetsCall.reload().finally(() => { | ||
| loadingMore.value = false |
There was a problem hiding this comment.
When a load-more request fails while the sentinel remains visible, this finally block clears loadingMore. The infinite-scroll watcher immediately tries again because the sentinel still intersects and hasMore remains true. A persistent network or server error therefore creates an unbounded retry loop that can flood the shared-assets endpoint. Handle the failure or prevent automatic retries until a new user or observer event occurs.
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/pages/SharedProjectPage.vue
Line: 330-331
Comment:
**Failed requests retry forever**
When a load-more request fails while the sentinel remains visible, this `finally` block clears `loadingMore`. The infinite-scroll watcher immediately tries again because the sentinel still intersects and `hasMore` remains true. A persistent network or server error therefore creates an unbounded retry loop that can flood the shared-assets endpoint. Handle the failure or prevent automatic retries until a new user or observer event occurs.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
What
The guest share page (
/vms/shared/folder/…,/vms/shared/…) used Previous / Next buttons — clicking through a page at a time. This swaps that for infinite scroll.How
Reuses the exact pattern the project/folder grid already runs (
useProjectBrowser+useInfiniteScroll):useInfiniteScroll(sentinel, loadingMore, hasMore, loadMore)— anIntersectionObserveron a sentinel<div>at the end of the grid (rootMargin: 600px)requestref tracking{ page, append };loadMore()bumps the page and callsassetsCall.reload()onSuccessaccumulates intoassetswith name-dedupe;reachedEndwhen a page adds nothinghasMoreNo backend change —
get_shared_folder_assets/get_shared_project_assetsalready paginate.Verified (local, 42-asset shared folder)
🤖 Generated with Claude Code