feat(scouts): cross-fleet scout findings page#2976
Conversation
|
React Doctor found 1 issue in 1 file · 1 warning. 1 warning
Reviewed by React Doctor for commit |
|
Reviews (1): Last reviewed commit: "feat(scouts): cross-fleet scout findings..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e46045d816
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- drop redundant .slice() before .sort() in scoutFindings helpers - surface incomplete/truncated windows (failed + emitted-but-empty runs, capped/early-stopped run set) instead of implying completeness - make emissions query key emitted_count-sensitive so in-progress runs refetch - parameterise sort/filter tests with it.each
|
Re the React Doctor |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7369ba7cc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- callout sums uncapped emitted runs (cap is only for the page fan-out) - incompleteRuns flags partial responses (loaded < emitted_count), not just empty - report-link query key includes emitted_count so chips refresh when a run emits more
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f5595c88b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <Box className="rounded-(--radius-2) border border-(--gray-6) border-dashed bg-gray-1 px-4 py-8 text-center text-[12.5px] text-gray-11"> | ||
| {isFiltering | ||
| ? "No findings match your search and filters." | ||
| : "Your scouts haven't emitted any findings yet. As they scan your project, what they surface shows up here."} |
There was a problem hiding this comment.
Use incomplete-load copy when no promised rows arrive
When every emitted run returns an empty or partial emissions response, useScoutFindings now sets incompleteRuns > 0 but FindingsBody never receives that flag, so this empty branch still tells users the scouts haven't emitted anything. Fresh evidence after the prior fix is that the warning can render above this branch while rows.length === 0, leaving contradictory "couldn't be loaded" and "haven't emitted" states; pass the incomplete state into the body or render a missing-details empty state.
Useful? React with 👍 / 👎.
this is bringing code app scouts pages in line with the could inbox scouts pages where you have a place to see all recent scout signals
Problem
The Code app's scouts feature surfaces findings (emissions) only inline on a single scout's detail page and inside individual inbox reports. There's no way to see every finding the whole troop emitted recently in one place — which PostHog Cloud's inbox already offers via its
FindingsPanelat/inbox/scouts/findings. This adds the equivalent cross-fleet findings surface to the Code app.Changes
Adds a cross-fleet Scout findings page at
/code/agents/scouts/findings, mirroring Cloud'sFindingsPanelbut built in the Code app's idioms (React Query hooks + TanStack file routes + Radix/Tailwind + pure@posthog/corehelpers — not Kea).packages/core/src/scouts/scoutFindings.ts— host-agnostic aggregation logic (the pure counterpart of Cloud'sfindingsLogicselectors): narrow the runs window to recent emitted runs, join each emission to its run + linked inbox report, derive the scout filter list, and search/filter/sort the flat row list. Fully unit-tested.useScoutFindings.ts— fans out one emissions + one report-link query per emitted run viauseQueriesand flattens through the core helper. (The per-scoutScoutSignalsSectionrenders a child component per run, which can't produce one sortable list.) Distinguishes partial vs. total fetch failure so the page can warn when the list is incomplete.ScoutFindingsView.tsx— the page: header, search box, scout/severity/sort selectors, and a list ofScoutEmissionCards with discuss/share/task-run actions and the linked-report chip.FleetFindingsCallout.tsx— entry-point stat card on the fleet section (beside the existing scratchpad callout), reading the cheapemitted_countsum; renders nothing until the troop has emitted something.ScoutEmissionCard.tsx— new optionalshowScoutprop so cross-fleet cards title with the emitting scout instead of the generic "Finding".routeTree.gen.tsregenerated.Read-only surface; acting on a finding still happens in its inbox report. No backend, host, or DI changes.
How did you test this?
pnpm --filter @posthog/core typecheckandpnpm --filter @posthog/ui typecheck— cleanpnpm --filter @posthog/core test scoutFindings— 19 unit tests pass (aggregation, filtering, sorting, edge cases)biome checkclean on all touched files;noRestrictedImportsclean on corepnpm typecheck— passedAutomatic notifications