paginate open streams #252
Reference in New Issue
Block a user
Delete Branch "paginate-open-streams"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary by CodeRabbit
Bug Fixes
New Features
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
4ab5069d-93dd-41b7-9c58-fcb43e4241c4📥 Commits
Reviewing files that changed from the base of the PR and between
0604b260d2and89d78246d3.📒 Files selected for processing (1)
js/desktop/src/App.tsx🚧 Files skipped from review as they are similar to previous changes (1)
📝 Walkthrough
Walkthrough
Adds a portable platform.deepLink API (getPending, onNavigate) with Electron and web implementations; App uses it to fetch pending deep links and subscribe to navigation with error logging. Unifies stream pagination to a single limit state for both statuses. NetworkRoot now always writes the
statusquery parameter.Changes
Platform and feature updates
js/desktop/src/lib/platform/types.tsPlatforminterface extended withdeepLinkcapability providinggetPending(): Promise<string | null>andonNavigate(callback): () => void.js/desktop/src/lib/platform/electron.ts,js/desktop/src/lib/platform/web.tsgetPendingandonNavigatetowindow.electronDeepLinkmethods; web implementation stubsgetPendingto resolvenullandonNavigateto return a no-op unsubscribe.js/desktop/src/App.tsxDeepLinkNavigationListenernow callsplatform.deepLink.getPending()and navigates only when a path exists, logs errors vialogError, and subscribes viaplatform.deepLink.onNavigate()with cleanup.js/desktop/src/hooks/use-stream-particles.tsINITIAL_PAGE_SIZE/PAGE_INCREMENTand a singlelimitstate;canLoadMoreusesstreams.length >= limitandloadMoreincrementslimit.js/desktop/src/features/network-root.tsxsetStatusTabnow always sets thestatusquery parameter (includingopen) instead of deleting it; two inline layout comments were removed.Sequence Diagram
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
App.tsxand related platform API usage; overlaps with the platform.deepLink consumption.electronDeepLinkIPC/preload/main routing that complements the renderer changes in this PR.Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
paginate-open-streamsComment
@coderabbitai helpto get the list of available commands and usage tips.Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
83437b28-ff74-41ed-8b53-30374668f0be📥 Commits
Reviewing files that changed from the base of the PR and between
f38835ceeeand0604b260d2.📒 Files selected for processing (6)
js/desktop/src/App.tsxjs/desktop/src/features/network-root.tsxjs/desktop/src/hooks/use-stream-particles.tsjs/desktop/src/lib/platform/electron.tsjs/desktop/src/lib/platform/types.tsjs/desktop/src/lib/platform/web.ts⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 280
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 187
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 9928
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 4013
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 942
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 42
🏁 Script executed:
Repository: flowy-live/llink
Length of output: 42
Fix missing
logErrorimport inDeepLinkNavigationListenerjs/desktop/src/App.tsx(line 65) callslogError, but the file has no import.logErroris exported from@/lib/errors(js/desktop/src/lib/errors.ts), and other desktop files import it from there—so this call will fail at runtime (and/or typecheck).Add:
import { logError } from '@/lib/errors';🤖 Prompt for AI Agents
✅ Addressed in commit
89d7824⚠️ Potential issue | 🟠 Major | ⚡ Quick win
Pagination
limitdoes not reset whenstatuschanges.When the user switches between the "open" and "closed" tabs, the
limitstate persists. If a user loads several pages of closed streams (e.g., limit reaches 60), then switches to the open tab, the hook will immediately query for 60 open streams instead of starting fresh at 12. This causes unnecessary over-fetching and changes the previous behavior that reset pagination on tab switch.🛠️ Proposed fix to reset limit on status change
Then add a reset effect after the
useState:📝 Committable suggestion
🤖 Prompt for AI Agents