Conversation
…ct size pagination
Peer page: add a clearly separated 'Search peer knowledge (conclusions)'
panel querying /conclusions/query scoped to observer=peer, with an
observed-peer target discovered from the conclusions the peer actually
holds, plus observer→observed, session and timestamp provenance on each
result. Message search is unchanged.
- useConclusionTargetPeers: walk conclusions/list (paginated) with an
observer_id filter and collect distinct observed_id values with row
counts. Returns { targets, complete }; complete is false when the walk
hit the page cap, so a truncated result is never reported as complete
and a single target from a truncated walk is not auto-selected.
- PeerDetail: target <select> over discovered targets (masked, with
counts); auto-select only when exactly one target exists AND discovery
is complete; scope badge shows the selected target; per-peer target
state resets when the viewed workspace or peer changes; discovery
errors are surfaced in the panel and picker instead of hanging in a
loading state.
- useQueryPeerConclusions: no implicit self-scope fallback — the server
requires both observer and observed filters and self-scoping yielded
guaranteed-zero rows; the target must be resolved by the caller.
- Display-only dedup of identical result contents with a hidden-
duplicate count; provenance preserved; purely presentational.
- Pagination: send the server's actual 'size' query param everywhere the
UI previously sent 'page_size' (workspaces, peers, peer sessions,
sessions, session messages, conclusions list, dreams, compare views,
seed kits, instance discovery). The server silently ignored
'page_size', falling back to 50 items per page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes peer-level knowledge search in the web viewer and corrects list pagination across the UI.
Peer knowledge search always returned nothing
The peer page's conclusion search self-scoped the query to
observed = <the peer itself>. Theconclusions/queryendpoint requires bothfilters.observerandfilters.observed, but a peer that holds knowledge about other peers holds nothing about itself — so the self-scoped query was a guaranteed zero rows for exactly the peers where knowledge search matters most.This PR:
useConclusionTargetPeers, which walksconclusions/listwith anobserver_idfilter and collects the distinctobserved_idvalues (with row counts) from real stored conclusions. Returns{ targets, complete };completeisfalsewhen the walk hit the page cap, so a truncated result is never presented as the full target list.<select>to the peer page knowledge panel, populated from those discovered targets (masked ids, with counts). A single target from a complete walk is auto-selected; a truncated walk never auto-selects — the user picks explicitly. An explicit user choice always wins over auto-select.useQueryPeerConclusions; the query is never fired without a concrete observed target (the server requires both filters).Pagination used the wrong query parameter
The list endpoints take
pageandsize, but the UI sentpage_sizeeverywhere. The server silently ignorespage_sizeand falls back to 50 items per page, so pages beyond the first were never reachable from the UI. All call sites now sendsize(workspaces, peers, peer sessions, sessions, session messages, conclusions list, dreams, compare views, seed kits, instance discovery).Testing
pnpm --filter @openconcho/web test— 122 tests pass, including a newconclusion-targets.test.tsxsuite covering: target collection with counts, multi-page walks,complete=falseon a cap-truncated walk (40 requests, no walk past the cap), the exact page-count boundary (complete=truewhen the last walked page is the reported page count), error propagation, the empty-store case, and count/id sort order.pnpm --filter @openconcho/web typecheck— clean.pnpm --filter @openconcho/web lint— clean (biome, 125 files).pnpm --filter @openconcho/web build— succeeds.Reproduction