Skip to content

Limit log pattern examples to 100 in side panel#1990

Merged
kodiakhq[bot] merged 1 commit intomainfrom
cursor/HDX-3838-log-pattern-examples-limit-ab94
Mar 26, 2026
Merged

Limit log pattern examples to 100 in side panel#1990
kodiakhq[bot] merged 1 commit intomainfrom
cursor/HDX-3838-log-pattern-examples-limit-ab94

Conversation

@MikeShi42
Copy link
Copy Markdown
Contributor

Problem

When a log pattern has thousands of sample events with large payloads, the PatternSidePanel renders all of them at once via RawLogTable, causing the page to freeze (HDX-3838).

The root cause: up to 10,000 samples are fetched and grouped by pattern. A single pattern can accumulate thousands of rows, and passing all of them to RawLogTable at once causes excessive DOM rendering.

Solution

Limit the initial display in PatternSidePanel to 100 sample events. If a pattern has more than 100 samples, a "Show all N samples" button is rendered below the table to let users load the full set on demand.

Changes in packages/app/src/components/PatternSidePanel.tsx:

  • Added INITIAL_LIMIT = 100 constant and showAll state
  • displayedSamples memo slices pattern.samples to the first 100 unless the user clicks "Show all"
  • Reset showAll to false when the pattern prop changes (user selects a different pattern)
  • Added a subtle Mantine Button below the table when there are more than 100 samples

Linear Issue: HDX-3838

Open in Web Open in Cursor 

When a log pattern has many sample events, rendering all of them at once
can freeze the page due to large payloads. This limits the initial display
to 100 samples and adds a 'Show all' button to load the rest on demand.

Fixes HDX-3838

Co-authored-by: Mike Shi <mike@hyperdx.io>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 25, 2026

⚠️ No Changeset found

Latest commit: 919ac0d

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

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

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

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment Mar 25, 2026 9:48pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

Knip - Unused Code Analysis

⚪ No changes detected (182 issues on both main and PR)

What is this?

Knip finds unused files, dependencies, and exports in your codebase.
This comment compares the PR branch against main to detect regressions.

Run yarn knip locally to see full details.

@github-actions
Copy link
Copy Markdown
Contributor

E2E Test Results

All tests passed • 93 passed • 3 skipped • 984s

Status Count
✅ Passed 93
❌ Failed 0
⚠️ Flaky 2
⏭️ Skipped 3

Tests ran across 4 shards in parallel.

View full report →

@MikeShi42 MikeShi42 marked this pull request as ready for review March 25, 2026 22:27
@MikeShi42 MikeShi42 requested review from a team and knudtty and removed request for a team March 25, 2026 22:27
@github-actions
Copy link
Copy Markdown
Contributor

PR Review

  • ⚠️ INITIAL_LIMIT = 100 is declared inside the component body (line 95) → Move to module-level constant to avoid re-declaration on every render
  • ⚠️ Button variant="subtle" may be a style guide mismatch — subtle is for "toolbar/utility controls" (collapse toggles, close buttons), while "Show all N samples" is more of a secondary CTA → Consider variant="link" or variant="secondary" per agent_docs/code_style.md

✅ No critical bugs or security issues. The core fix (limiting displayed rows, resetting on pattern change, on-demand "show all") is correct and well-implemented.

@kodiakhq kodiakhq bot merged commit fb8a7e9 into main Mar 26, 2026
17 checks passed
@kodiakhq kodiakhq bot deleted the cursor/HDX-3838-log-pattern-examples-limit-ab94 branch March 26, 2026 02:21
knudtty pushed a commit that referenced this pull request Apr 16, 2026
## Problem

When a log pattern has thousands of sample events with large payloads, the `PatternSidePanel` renders all of them at once via `RawLogTable`, causing the page to freeze (HDX-3838).

The root cause: up to 10,000 samples are fetched and grouped by pattern. A single pattern can accumulate thousands of rows, and passing all of them to `RawLogTable` at once causes excessive DOM rendering.

## Solution

Limit the initial display in `PatternSidePanel` to **100 sample events**. If a pattern has more than 100 samples, a "Show all N samples" button is rendered below the table to let users load the full set on demand.

### Changes in `packages/app/src/components/PatternSidePanel.tsx`:
- Added `INITIAL_LIMIT = 100` constant and `showAll` state
- `displayedSamples` memo slices `pattern.samples` to the first 100 unless the user clicks "Show all"
- Reset `showAll` to `false` when the `pattern` prop changes (user selects a different pattern)
- Added a subtle Mantine `Button` below the table when there are more than 100 samples


Linear Issue: [HDX-3838](https://linear.app/clickhouse/issue/HDX-3838/investigate-issues-with-large-log-payloads-causing-problems)

<div><a href="https://cursor.com/agents/bc-b7a128cb-a5af-465d-862e-97359077eeaa"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-b7a128cb-a5af-465d-862e-97359077eeaa"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



Co-authored-by: Cursor Agent <199161495+cursoragent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants