Skip to content

feat(archive): load archived tasks as users scroll - #3819

Merged
trunk-io[bot] merged 4 commits into
mainfrom
posthog-code/infinite-archived-tasks
Jul 26, 2026
Merged

feat(archive): load archived tasks as users scroll#3819
trunk-io[bot] merged 4 commits into
mainfrom
posthog-code/infinite-archived-tasks

Conversation

@richardsolomou

@richardsolomou richardsolomou commented Jul 26, 2026

Copy link
Copy Markdown
Member

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.ts
  • pnpm --filter @posthog/ui typecheck
  • pnpm exec biome check packages/ui/src/features/archive/ArchivedTasksView.tsx packages/ui/src/features/archive/archiveListPagination.ts packages/ui/src/features/archive/archiveListPagination.test.ts

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Generated-By: PostHog Code
Task-Id: 536c4778-77ff-478c-9cbc-69fd42a1a586
@trunk-io

trunk-io Bot commented Jul 26, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown

React Doctor found 9 issues in 1 file · 9 warnings.

9 warnings

src/features/archive/ArchivedTasksView.tsx

Reviewed by React Doctor for commit 58fe370.

@richardsolomou richardsolomou changed the title Add infinite loading for archived tasks feat(archive): add infinite loading Jul 26, 2026
@richardsolomou
richardsolomou requested a review from a team July 26, 2026 03:13
@richardsolomou
richardsolomou marked this pull request as ready for review July 26, 2026 03:13
@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix 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

Comment thread packages/ui/src/features/archive/ArchivedTasksView.tsx
Comment thread packages/ui/src/features/archive/ArchivedTasksView.tsx Outdated
Generated-By: PostHog Code
Task-Id: 536c4778-77ff-478c-9cbc-69fd42a1a586
Generated-By: PostHog Code
Task-Id: 536c4778-77ff-478c-9cbc-69fd42a1a586
@richardsolomou richardsolomou changed the title feat(archive): add infinite loading feat(archive): load archived tasks as users scroll Jul 26, 2026
@posthog

posthog Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Visual changes approved by @richardsolomou — baseline updated in 58fe370.

View this run in PostHog

1 changed.

1 updated
Run: 66940286-cef9-4569-aa5b-23467196322c

Co-authored-by: richardsolomou <2622273+richardsolomou@users.noreply.github.com>
@trunk-io
trunk-io Bot merged commit c531d06 into main Jul 26, 2026
32 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/infinite-archived-tasks branch July 26, 2026 20:43
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.

2 participants