refactor(app): extract the denoise pipeline out of the results table - #2884
refactor(app): extract the denoise pipeline out of the results table#2884teeohhem wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Greptile SummaryThe PR extracts the results-table denoise pipeline into a reusable hook and summary component, adds source-badge rendering for merged rows, and exposes the final page's row count from paginated queries.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/app/src/components/DBRowTable.tsx | Extracts denoising and adds multi-source cell rendering without an eligible new blocking finding. |
| packages/app/src/components/MultiSourceBadge.tsx | Adds a small escaped-text source badge with a colored origin marker. |
| packages/app/src/hooks/useOffsetPaginatedQuery.tsx | Exposes the final fetched page's row count alongside flattened query data. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Rows[Fetched rows] --> Denoise[useDenoisedRows]
Patterns[Grouped patterns] --> Denoise
Denoise --> Table[RawLogTable]
Denoise --> Summary[DenoisedPatternsSummary]
Pages[Paginated query pages] --> Flatten[flattenData]
Flatten --> Count[lastPageRowCount]
Reviews (2): Last reviewed commit: "refactor(app): extract the denoise pipel..." | Re-trigger Greptile
| }: { | ||
| config: BuilderChartConfigWithDateRange; | ||
| sourceId?: string; | ||
| processedRows: Record<string, any>[]; |
There was a problem hiding this comment.
The extracted reusable hook declares processedRows as Record<string, any>[], allowing invalid row values and property accesses to cross the new hook boundary without static checking. Reuse the table's concrete row type or define an appropriately typed row shape.
Context Used: AGENTS.md (source)
DBSqlRowTable carried the whole denoise flow inline: mine patterns from a sample, find the ones covering more than the noise threshold, then filter the fetched rows against them. Three chained queries and their loading state, in the middle of a component that already does a lot. Pull it into useDenoisedRows plus the small summary that lists what was removed, and have the table call them. Same queries, same keys, same behavior — the component just stops owning it, and a second results table can reuse it rather than copy it. Also threads the last page's row count out of the paginated query, which a caller merging several sources needs to tell "this window is drained" from "this page stopped at its limit".
5c8ed27 to
3113a0f
Compare
E2E Test Results✅ All tests passed • 282 passed • 1 skipped • 1002s
Tests ran across 4 shards in parallel. |
Stacked on #2883. Behavior-neutral refactor; no user-visible change.
DBSqlRowTablecarried the whole denoise flow inline — mine patterns from a sample, find the ones over the noise threshold, filter the fetched rows — three chained queries plus their loading state, inside a component that already does a lot. This pulls it intouseDenoisedRowsand a small summary component, with the table calling them. Same queries, same query keys, same behavior; the component just stops owning it, so a second results table can reuse it instead of copying it.Also threads the last page's row count out of the paginated query (a caller merging several streams needs to distinguish "this time window is drained" from "this page stopped at its LIMIT"), and adds the colored source-badge cell the merged table will render.
Verified by the existing suite: 664 component tests pass, and the search E2E specs exercise denoise on the real table.