feat(sessions): progressive loading, server-side search, and workspace scoping#511
Conversation
…de search - Add pagination state (limit, hasMore) to session store - Modify fetchSessions() to support limit/search parameters with workspace directory scoping - Add loadMoreSessions() for scroll-triggered pagination - Add searchSessions() with merge-into-store semantics to preserve active session - Add IntersectionObserver sentinel for auto-fetch on scroll - Add debounced server-side search in session list filter - Add i18n loading indicator across all 7 locales - Fix search bar open flicker and active session drop on search
- Only call server-side search when client-side filtering returns no results - This gives instant feedback for queries that match already-loaded sessions - Reduces debounce from 300ms to 150ms for server searches - Eliminates unnecessary API calls and store merges for typical searches
Before vs After
|
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Gatekeeper review for latest PR state. Assumption: the checked-out worktree reflects PR #511 HEAD, and the request is for review only, not code changes. Verdict: changes requested / not ready to merge. Findings:
Implementation quality notes:
Validation:
Recommended bar before merge:
-- |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26645371000 Artifacts expire in 7 days.
|
…hild results, field preservation - Always run server search in background (plan 001): removes hasClientResults gate; client-side filtering stays instant; stale query guard prevents race - Fix fetchSessions without limit (plan 002): only sets hasMore when limit is explicitly provided; prevents App.tsx close-session refresh from hiding sentinel - Fetch missing parents for child results (plan 003): after search merge, identifies children whose parent is not in store and fetches them via session.get(); ensures orphaned child results render correctly - Use toClientSession in search merge (plan 004): replaces manual field-by-field merge with toClientSession() call; preserves diff, pendingPermission, pendingQuestion, revert, and all other runtime fields
|
@pascalandr I want you to perform the gatekeeper checks for latest PR state Commit:
|
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26648733114 Artifacts expire in 7 days.
|
|
check again |
|
Re-check complete for latest PR state at Verdict: still changes requested / not ready to merge. Findings:
Previously reported items status:
Implementation quality notes:
Validation:
Required before merge:
-- |
Refactor the session sidebar loading state so normal pagination and server search no longer share the same control state. Normal loading now uses SDK start/limit pagination with a 100 item page size and stores loaded root session ids separately from the shared session cache. Search now keeps its own query, loading flag, result ids, and request id. Stale responses are ignored before they commit results, clearing search only clears search state, and search no longer mutates the normal hasMore pagination flag. The close-session refresh path now preserves the currently loaded page size, and create/delete operations keep the normal list ids in sync with optimistic session cache updates. Validation: npm run typecheck --workspace @codenomad/ui still fails only on the pre-existing @opencode-ai/sdk FileDiff export errors.
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Gatekeeper review complete for latest PR state at Verdict: changes requested / not ready to merge. Findings:
Previously reported blocker status:
Implementation quality notes:
Validation:
Required before merge:
-- |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26809511914 Artifacts expire in 7 days.
|
Avoid committing empty authoritative search results when server search fails. The sidebar now falls back to client-side filtering for the current query instead of hiding valid loaded matches behind an empty completed search result. Child-only server search results now require their parent sessions to hydrate before the server result set is committed. If parent hydration fails, search state is cleared so the UI remains in the non-authoritative client-filtered mode rather than silently dropping unrenderable child matches. Validation: npm run typecheck --workspace @codenomad/ui still fails only on the pre-existing @opencode-ai/sdk FileDiff export errors.
|
How about now? |
|
Re-check complete for latest PR state at Verdict: still changes requested / not ready to merge. Findings:
Previously reported blocker status:
Implementation quality notes:
Validation:
Required before merge:
-- |
When refreshing a parent session's children, replace that parent's child set instead of only merging returned children into the shared session cache. This preserves progressive pagination while ensuring children removed by the server disappear from sidebar threads after a child-list refetch. Stale child cleanup also clears loaded-message flags, normalized message state, session info, and per-session caches so status/count state cannot linger for sessions that are no longer returned by session.children(). Runtime fields for returned children are still preserved through toClientSession(). Validation: npm run typecheck --workspace @codenomad/ui still fails only on the pre-existing @opencode-ai/sdk FileDiff export errors.
|
Now? |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26810846896 Artifacts expire in 7 days.
|
|
Re-check complete for latest PR state at Verdict: no blocking findings from this scoped gatekeeper review. Findings:
Previously reported blocker status:
Residual notes, not blockers:
Validation:
Recommended manual verification before merge:
-- |
|
Thanks @VooDisss |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26811042159 Artifacts expire in 7 days.
|
Session Pagination & Search Enhancement
Changes
Progressive Session Loading
fetchSessions()now accepts{ limit, search }optionssessionFetchLimit,sessionHasMore(50-session pages)loadMoreSessions()via IntersectionObserverServer-Side Search
searchSessions()usingsession.list({ search, limit: 50, directory })"sessionList.loading.more"i18n key (7 locales)Hybrid Search Performance
Workspace Scoping
session.list()calls passdirectory: instance.folderFiles
packages/ui/src/stores/session-state.tspackages/ui/src/stores/session-api.tspackages/ui/src/stores/instances.tspackages/ui/src/stores/sessions.tspackages/ui/src/components/session-list.tsxpackages/ui/src/lib/i18n/messages/*/session.ts