Skip to content

refactor(app): extract the denoise pipeline out of the results table - #2884

Draft
teeohhem wants to merge 1 commit into
tom/n3-search-primitivesfrom
tom/n4-rowtable-extract
Draft

refactor(app): extract the denoise pipeline out of the results table#2884
teeohhem wants to merge 1 commit into
tom/n3-search-primitivesfrom
tom/n4-rowtable-extract

Conversation

@teeohhem

Copy link
Copy Markdown
Contributor

Stacked on #2883. Behavior-neutral refactor; no user-visible change.

DBSqlRowTable carried 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 into useDenoisedRows and 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.


Compound Engineering
Claude Code

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview Aug 12, 2026 7:19pm
hyperdx-storybook Ready Ready Preview Aug 12, 2026 7:19pm

Request Review

@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3113a0f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The 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.

  • Moves pattern mining, noisy-pattern selection, and row filtering into useDenoisedRows.
  • Adds source-origin badges and null placeholders for multi-source rows.
  • Adds lastPageRowCount to flattened pagination results.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

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]
Loading

Reviews (2): Last reviewed commit: "refactor(app): extract the denoise pipel..." | Re-trigger Greptile

Comment thread packages/app/src/components/DBRowTable.tsx
}: {
config: BuilderChartConfigWithDateRange;
sourceId?: string;
processedRows: Record<string, any>[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Avoid any in hook boundary

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)

Fix in Claude Code Fix in Conductor Fix in Cursor Fix in Codex

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".
@teeohhem
teeohhem force-pushed the tom/n4-rowtable-extract branch from 5c8ed27 to 3113a0f Compare August 12, 2026 19:14
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

E2E Test Results

All tests passed • 282 passed • 1 skipped • 1002s

Status Count
✅ Passed 282
❌ Failed 0
⚠️ Flaky 0
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant