fix(#219): add pagination to sessions history tab (#357)

* fix(#219): add pagination to sessions history tab

The /api/sessions endpoint was called without pagination params, so the server returned only its default limit of 20 sessions.

- SessionListResponse: added total/limit/offset fields from server response
- HermesApiService: added @Query params (limit, offset, order) to getSessions()
- SessionsViewModel: added loadMore() that appends pages, hasMore derived from total
- SessionsScreen: added 'Load more sessions' button + loading spinner at bottom of list

* chore: remove plan file from git

* fix: compilation errors in sessions pagination

* chore: gitignore plan files

* fix: remove duplicate brace

---------

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
M57andM57 authored and GitHub committed 2026-06-25 00:58:52 +03:00
1 parent 067f4500aa
commit 4ba74c2efa
7 files changed
+114 -7

No files matched your search

@@ -428,7 +428,9 @@ class E2eIntegrationTest {
fun testSessionsListing_success() =
runTest {
val session = SessionInfo("session-123", "Session 1", "2026-06-15T15:10:00Z", 5, "active")
coEvery { mockApiService.getSessions() } returns Response.success(SessionListResponse(listOf(session)))
coEvery {
mockApiService.getSessions(any(), any(), any())
} returns Response.success(SessionListResponse(listOf(session)))
val viewModel = SessionsViewModel()
viewModel.loadSessions()
@@ -463,7 +465,7 @@ class E2eIntegrationTest {
@Test
fun testSessionsLoad_failure() =
runTest {
coEvery { mockApiService.getSessions() } returns createErrorResponse(500)
coEvery { mockApiService.getSessions(any(), any(), any()) } returns createErrorResponse(500)
val viewModel = SessionsViewModel()
viewModel.loadSessions()