feat(archive): load archived tasks as users scroll - #3819
Merged
Conversation
Generated-By: PostHog Code Task-Id: 536c4778-77ff-478c-9cbc-69fd42a1a586
|
😎 Merged successfully - details. |
|
React Doctor found 9 issues in 1 file · 9 warnings. 9 warnings
Reviewed by React Doctor for commit |
richardsolomou
marked this pull request as ready for review
July 26, 2026 03:13
Contributor
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
packages/ui/src/features/archive/ArchivedTasksView.tsx:258-264
**Filtered results stall pagination**
When a search or repository filter matches no task in the loaded prefix but matches a task on a later page, `virtualRows` is empty and `lastVirtualRowIndex` remains undefined, so this effect never loads the next page and the view permanently displays “No matching tasks.”
### Issue 2 of 2
packages/ui/src/features/archive/ArchivedTasksView.tsx:542
**Sorting covers only loaded prefix**
When the user observes or changes the Created/Archived sort before every page is loaded, this slice excludes later tasks before client-side sorting runs, causing globally earlier rows to remain absent and the displayed ordering to change as scrolling loads more pages.
Reviews (1): Last reviewed commit: "Add infinite loading for archived tasks" | Re-trigger Greptile |
Generated-By: PostHog Code Task-Id: 536c4778-77ff-478c-9cbc-69fd42a1a586
Generated-By: PostHog Code Task-Id: 536c4778-77ff-478c-9cbc-69fd42a1a586
Contributor
|
✅ Visual changes approved by @richardsolomou — baseline updated in 1 changed. |
1 updated Run: 66940286-cef9-4569-aa5b-23467196322c Co-authored-by: richardsolomou <2622273+richardsolomou@users.noreply.github.com>
k11kirky
approved these changes
Jul 26, 2026
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.
Problem
Opening the archive requests details for up to 500 tasks before the user scrolls. Large archives pay that cost even when only the first rows are visible.
Changes
I load task summaries in batches of 50 when the virtualized list approaches the unfiltered loaded boundary. Filtering and sorting use the complete archive metadata before limiting rendered rows, while filtered results do not fetch every remaining page. Page offsets count requested task IDs so missing summaries cannot stall pagination.
Screenshot: N/A, there are no visual changes.
How did you test this?
pnpm --dir packages/ui exec vitest run src/features/archive/archiveListPagination.test.ts src/features/archive/useArchivedTaskSummaries.test.tspnpm --filter @posthog/ui typecheckpnpm exec biome check packages/ui/src/features/archive/ArchivedTasksView.tsx packages/ui/src/features/archive/archiveListPagination.ts packages/ui/src/features/archive/archiveListPagination.test.tsAutomatic notifications
Created with PostHog Code