Enhance onboarding success page layout - #26839
Draft
kroepke wants to merge 16 commits into
Draft
Conversation
some data is still mocked, we need to add aggregations to the search to fill the sources throughput etc
makes the page better to follow: status timeline, detail information in the middle, next steps or repair info on the right source logs at the bottom or in the error case we show the self logs added some tests added QuietSection to make the Sections in the middle less visually heavy, should probably become a prop on Section
Adds a per-source aggregation search type to the preview search so useCollectorLogPreview exposes sourceCounts (Record<string, number> | undefined), keyed by Source.id. undefined means the aggregation result was unavailable, distinct from "every source produced nothing". Also updates ConnectionSuccess.test.tsx's shared useCollectorLogPreview mock to include the new required field so the type-check stays green; no rendering behaviour changed there.
SourceStatusSection previously claimed every enabled source was "Receiving" as soon as any message arrived for the collector, which is untrue on a per-source basis. It now consumes the per-source counts produced by useCollectorLogPreview (Task 1) and renders an honest per-source status plus a message-count column, following a 7-row precedence table (disabled, platform mismatch, offline, receiving, no messages yet, waiting for first messages, and unknown-count fallback).
…tests, lint
- Make search error attribution search-type aware in useCollectorLogPreview so
an aggregation-only failure no longer poisons the healthy messages pane that
shares its query.
- Let SourceName shrink (flex: 1, min-width: 0, overflow-wrap) so long source
names no longer overflow the log-sources row, mirroring DetailRow's fix for
the same problem.
- Add coverage for the aggregation-scoped-error case and for an empty (but
present) aggregation result, pinning sourceCounts === {} as distinct from
undefined.
- Replace `as unknown as CollectorInstanceView` casts in two test fixtures
with a plain assertion or a fully populated fixture, per CONTRIBUTING.md.
- Rename a SourceStatusSection test to describe its actual behaviour (empty
copy for undefined sources) instead of a loading state it doesn't implement,
and note the gap in a comment.
- Fix eslint findings in ColumnRenderers.tsx (missing blank line before
return; make the always-passed `instance` prop required instead of
defaulting it) and reformat LogPreviewSection.tsx's over-width line.
The search type was sent as `aggregation`, which is the frontend's PluggableSearchType key rather than the wire discriminator. Server-side the name is `Pivot.NAME` = `pivot`; an unrecognised type deserialises to SearchType.Fallback, whose `filters` is a plain nullable field, and SearchFilterNormalizer then NPEs on it and fails the whole search.
Source types can exist in the database before the frontend knows them - a definition still on an unmerged branch is stored and returned by the API while SourceType and SOURCE_TYPE_LABELS have no entry for it. Such a source used to read as "Waiting for first messages...", which pretends we are waiting on something we cannot reason about. Membership in SOURCE_TYPE_LABELS is the registry of known types because it is exhaustive over SourceType; SOURCE_PLATFORM is not, since types that run everywhere are legitimately absent from it. Deliberately not reusing "Not applicable": that asserts a definite incompatibility, whereas an unrecognised type may be collecting fine server-side.
useInstance fetched once and then only refetched when something invalidated its key, so a page rendered while the collector was healthy kept asserting "online" indefinitely - a collector that stops reporting in is marked offline server-side with no user interaction to trigger a refetch. Polls at the heartbeat cadence via useCollectorRefetchInterval, since the data cannot become fresher than the heartbeat. Requests opt out of session extension per the periodic-request rule, and errors no longer go through defaultOnError because a persistent failure would raise a toast on every poll; the page already renders the failure from the returned error.
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
Overhauls the collector onboarding page.
Motivation and Context
Users need a clear overview of whether their new collector works and sends data (and which data sources apply/work).
How Has This Been Tested?
Unit tests.
Screenshots (if appropriate):
Success case

The collector connected once, but is now offline

Types of changes
Checklist: