add pagination & remote search flow for remote storage#9708
Draft
Light2Dark wants to merge 3 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
2 issues found across 16 files
Architecture diagram
sequenceDiagram
participant UI as React UI (StorageInspector)
participant Hook as useStorageEntries Hook
participant State as Jotai Store (state.ts)
participant API as Server API (commands.py)
participant Backend as StorageBackend (storage.py)
participant Obstore as Obstore (S3/GCS)
participant Fsspec as FsspecFilesystem (local/SFTP)
Note over UI,Fsspec: Storage List with Pagination
UI->>Hook: Expand directory or section
Hook->>State: Check cache (entriesByPath)
alt Cache miss
State-->>Hook: No cached entries
Hook->>API: NEW: listEntries(namespace, prefix, limit, pageToken=null)
API->>Backend: list_entries(prefix, limit, page_token)
alt Obstore backend
Backend->>Obstore: list_with_delimiter(prefix)
Obstore-->>Backend: Raw entries (may be truncated at 1000)
Backend->>Backend: _paginate_entries(offset=0, limit)
Backend-->>API: StorageListResult(entries, nextPageToken, mayHaveMore)
else Fsspec backend
Backend->>Fsspec: ls(prefix, detail=True)
Fsspec-->>Backend: File list
Backend->>Backend: _paginate_entries(offset=0, limit)
Backend-->>API: StorageListResult(entries, nextPageToken)
end
API-->>Hook: NEW: StorageEntriesNotification(entries, nextPageToken, mayHaveMore)
Hook->>State: NEW: setEntries({entries, nextPageToken, mayHaveMore})
State-->>Hook: entries, hasMore, mayHaveMore
Hook-->>UI: Render entries + "Load more" button
else Cache hit
State-->>Hook: Cached entries + pagination metadata
Hook-->>UI: Render entries
alt hasMore (nextPageToken != null)
UI->>Hook: Show "Load more" button
else mayHaveMore (no token, but may exist)
UI->>Hook: Show "May exist more" indicator
end
end
Note over UI,Hook: Load More Click
alt hasMore is true
UI->>Hook: loadMore()
Hook->>Hook: setIsLoadingMore(true)
Hook->>API: NEW: listEntries(namespace, prefix, limit, pageToken=nextPageToken)
API->>Backend: list_entries(prefix, limit, page_token)
alt Obstore backend
Backend->>Obstore: list_with_delimiter(prefix)
Obstore-->>Backend: Raw entries
Backend->>Backend: _paginate_entries(offset=parseInt(pageToken), limit)
Backend-->>API: StorageListResult(entries, nextPageToken, mayHaveMore)
else Fsspec backend
Backend->>Fsspec: ls(prefix, detail=True)
Fsspec-->>Backend: File list
Backend->>Backend: _paginate_entries(offset=parseInt(pageToken), limit)
Backend-->>API: StorageListResult(entries, nextPageToken)
end
API-->>Hook: NEW: StorageEntriesNotification(entries, nextPageToken, mayHaveMore)
Hook->>State: NEW: setEntries({entries, append:true, nextPageToken, mayHaveMore})
State-->>Hook: Appended entries + updated metadata
Hook-->>UI: Render appended entries
alt Has more pages
UI->>Hook: Keep "Load more" button
else No more pages but mayHaveMore
UI->>Hook: Show "Maybe more" indicator
end
end
Note over Hook,State: Error Handling
alt Load more fails
Hook->>Hook: catch error -> setLoadMoreError
Hook-->>UI: Show error message with retry
UI->>Hook: loadMore() retry
end
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Contributor
There was a problem hiding this comment.
2 issues found across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
Related to #9662
Screen.Recording.2026-05-28.at.10.24.22.AM.mov
📋 Pre-Review Checklist
✅ Merge Checklist