Skip to content

ref(conversations): Simplify useConversation to single query#116277

Closed
obostjancic wants to merge 1 commit into
masterfrom
ref/conversations-simplify-useconversation
Closed

ref(conversations): Simplify useConversation to single query#116277
obostjancic wants to merge 1 commit into
masterfrom
ref/conversations-simplify-useconversation

Conversation

@obostjancic
Copy link
Copy Markdown
Member

@obostjancic obostjancic commented May 27, 2026

Replace useInfiniteQuery with useQuery now that the backend returns all spans in a single {"data": [...]} response without pagination.

Removes page accumulation, fetchNextPage, MAX_PAGES, and the useEffect that auto-fetched subsequent pages. The hook now reads spans from data.data instead of flattening across pages.

Depends on #116087 (backend lands first).

Refs TET-2388

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 27, 2026

TET-2388

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.58%

Replace useInfiniteQuery with useQuery now that the backend returns
all spans in a single {data: [...]} response without pagination.

- Remove page accumulation, fetchNextPage, MAX_PAGES logic
- Remove useEffect for auto-fetching next pages
- Read spans from data.data instead of pages.flatMap
- Update mock responses in tests to match new envelope format

Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
@obostjancic obostjancic force-pushed the ref/conversations-simplify-useconversation branch from 82d2303 to 3626e45 Compare May 27, 2026 09:44
@obostjancic
Copy link
Copy Markdown
Member Author

No longer needed — keeping pagination since conversations can exceed 1000 spans. The backend PR (#116087) now uses a probe-first approach to cleanly separate widening from pagination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant