fix(mobile): keep session lists loading until the query settles - #6110
fix(mobile): keep session lists loading until the query settles#6110iscekic wants to merge 1 commit into
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental diff only removes the two items flagged previously, so no new findings remain and no inline comments were posted. Files Reviewed (2 files)
Previously Reported Issues
Previous Review Summary (commit 856fb81)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 856fb81)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (12 files)
The loading/empty-state logic change itself is sound: keying the cold-open decision off React Query v5 Fix these issues in Kilo Cloud Reply with Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
fb23092 to
ae5a28b
Compare
Changelog for users
Changelog for maintainers
apps/mobile/src/components/agents/session-list-loading.tsaddsselectSessionListIsLoading, which decides loading from React Query v5isPendingrather thanisFetching;isLoadingis false on the first render and while a query is paused.apps/mobile/src/components/agents/session-history-screen.tsxcalls the selector; the previousstoredIsFetching && storedLoadedPageCount === 0check is removed.apps/mobile/src/lib/hooks/use-agent-sessions.tsexposesstoredIsPending, anduse-agent-session-list-data.tsforwards it. A cached page makesisPendingfalse, so a refetch keeps rows.apps/mobile/src/lib/device-sessions.tsclassifies onisPending, anddevice-sessions-screen.tsxpasses the query'sisPendinginstead ofisLoading.apps/mobile/src/components/agents/session-list-loading.test.tscovers the first render, cached rows, settled empty, search, and error ordering; the mounted history and device-sessions tests were updated.session-list-content-surface.tsstill gates the empty and error surfaces onisLoading, so the loading selector is the one changed input to that decision.isPendingstays true for a paused or offline query by design, so those surfaces keep skeletons until the request settles.E2E proof
Recording of the verified flow (waits trimmed)
scripted-shard2.mp4
Recording of the verified flow (waits trimmed)
e3-skeleton-then-empty.mp4
Recording of the verified flow (waits trimmed)
e1-skeleton-cold.mp4
Recording of the verified flow (waits trimmed)
e5-error-transition.mp4
Recording of the verified flow (waits trimmed)
e6-filter.mp4
Owner request
[e1] Cold open the Sessions history screen (Agents tab -> See all): loading skeletons render first and 'No past sessions' never flashes before the request settles. — android (emulator-5554). (scripted-e1.log) 'SCENE e1 OK' and digest line 'android.widget.TextView 60-message pagination fixture tappable [93,628][958,674]' show the cold-opened history list settled on the stored session row with 'No past sessions' absent from the whole log; re-confirmed on a force-stop/relaunch cold open with nextjs held ((e1-cold-loading3.log) 'SCENE e1-cold-loading OK', same row line, still no 'No past sessions'), so the empty surface is not shown before the request settles. Skeleton-first/no-flash appearance is owned by the visual reviewer on the driver's…
e1-skeleton-cold.mp4.trim.mp4
[e3] empty history cold open (android emulator-5606) — Android emulator-5606, empty account e2e-empty-fix-the-empty-state-that-fla-90b7@example.com, cold open = force-stop+relaunch then Agents tab -> See all. Settled true empty: e3-scene.log carries 'No past sessions' and 'Completed sessions will appear here.'. Before the request settled (nextjs held with fault.sh stall --hold 60), e3-loading.log's digest carries the history header 'Filter sessions' and the tab bar but no empty-state text, so the empty state is not painted before settle; after the request completed with an error rather than rows, e3-settled.log carries 'Could not load sessions'…
e3-history-coldopen.mp4.trim.mp4
[e1] Cold open the Sessions history screen (Agents tab -> See all): loading skeletons render first and 'No past sessions' never flashes before the request settles. — android device emulator-5554. On a genuinely pending cold open (empty worktree account, history screen freshly mounted with the network cut, no cache) the digest shows the history header and 'android.view.View No internet connection' with NO 'No past sessions' (e1-offline-digest.log), identical 4 s later (e1-offline-digest2.log); the empty state appears only after the request settles ('android.widget.TextView No past sessions' + 'Completed sessions will appear here.', e1-settled-empty.log), and the default account's settled list shows the row ('android.widget.Button 60-message pagination…
e1-cold-flash-free.mp4.trim.mp4
[e1] Cold open the Sessions history screen (Agents tab -> See all): loading skeletons render first and 'No past sessions' never flashes before the request settles. — android device emulator-5554. On a genuinely pending cold open (empty worktree account, history screen freshly mounted with the network cut, no cache) the digest shows the history header and 'android.view.View No internet connection' with NO 'No past sessions' (e1-offline-digest.log), identical 4 s later (e1-offline-digest2.log); the empty state appears only after the request settles ('android.widget.TextView No past sessions' + 'Completed sessions will appear here.', e1-settled-empty.log), and the default account's settled list shows the row ('android.widget.Button 60-message pagination…
e1-skeleton-then-empty.mp4.trim.mp4
[e3] empty history cold open — loading settles before empty state (android emulator-5606) — On android emulator-5606 with an empty account (e3-db-empty.txt = 0 sessions), while the history request was held in flight the digest shows the history surface + 'Filter sessions' and no 'No past sessions' (e3-digest-loading.log; e3-structure.log: 78 ViewGroup skeleton nodes, 0 'No past sessions'), and only after it settled did 'No past sessions'/'Completed sessions will appear here.' appear (e3-digest-settled.log; e3-structure.log 46 nodes/1 'No past sessions'); the sessions-list error branch shows after loading with a Retry (e3-error.log: 'Could not load sessions' + 'Retry'); recording…
e3-skeleton-then-empty.mp4.trim.mp4
[e1] Cold open the Sessions history screen (loading skeletons first, 'No past sessions' never flashes) — Android emulator-5554, packed tree: after
adb am force-stop+ relaunch of com.kilocode.kiloapp, Agents tab -> 'See all' settled to a single centered-state surface showing 'No past sessions' (e1-cold-digest.txt line 9) and 'Completed sessions will appear here.' (line 10) with no duplicate/stacked loader, matching the scripted scene e1 OK digest (scripted-e1.log line 9); the skeleton-first/no-flash timing is a visual claim delegated to the visual reviewer on scripted-shard1.mp4 and e1-cold.mp4 (captures saved for it, not opened). No functional UX-DEFECT observed on the history screen.…e1-cold.mp4.trim.mp4
Open findings the workflow could not fix