Skip to content

feat: infinite scroll on shared folder/project pages - #160

Merged
vishwajeet-13 merged 1 commit into
bwhtech:developfrom
vishwajeet-13:feat/shared-page-infinite-scroll
Sep 7, 2026
Merged

feat: infinite scroll on shared folder/project pages#160
vishwajeet-13 merged 1 commit into
bwhtech:developfrom
vishwajeet-13:feat/shared-page-infinite-scroll

Conversation

@vishwajeet-13

Copy link
Copy Markdown
Collaborator

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) — an IntersectionObserver on a sentinel <div> at the end of the grid (rootMargin: 600px)
  • a request ref tracking { page, append }; loadMore() bumps the page and calls assetsCall.reload()
  • onSuccess accumulates into assets with name-dedupe; reachedEnd when a page adds nothing
  • the pager markup is replaced by a small spinner that only renders while hasMore

No backend change — get_shared_folder_assets / get_shared_project_assets already paginate.

Verified (local, 42-asset shared folder)

shared folder, all 42 loaded by scrolling

🤖 Generated with Claude Code

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-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown

Greptile Summary

This PR replaces Previous/Next pagination on guest shared project and folder pages with sentinel-driven infinite scrolling.

  • Accumulates paginated assets while deduplicating by asset name.
  • Stops loading when all reported assets are present or a page contributes no new assets.
  • Preserves preview and download actions over the accumulated list.
  • Needs bounded error handling to prevent automatic load-more retries from looping during request failures.

Confidence Score: 4/5

This 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 hasMore remains true, creating a request loop during persistent failures.

Files Needing Attention: frontend/src/pages/SharedProjectPage.vue

Important Files Changed

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.

Fix all with Greploop Fix All in Claude Code Fix All in Codex

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

Comment on lines +330 to +331
void assetsCall.reload().finally(() => {
loadingMore.value = false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

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.

Fix in Claude Code Fix in Codex

@vishwajeet-13
vishwajeet-13 merged commit 96ee879 into bwhtech:develop Sep 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant