hyperdx/packages/app
Mike Shi fb8a7e990d
Limit log pattern examples to 100 in side panel (#1990)
## 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>
2026-03-26 02:20:55 +00:00
..
.storybook feat: add link variant for Button and ActionIcon (#1938) 2026-03-18 18:25:36 +00:00
pages feat: Attach service version to all internal telemetry (#1891) 2026-03-12 16:50:46 +00:00
public refactor: update SVG structure and styling for ClickStack and HyperDX favicons (#1750) 2026-02-19 12:06:46 +00:00
scripts test: Backport Claude E2E Skill (#1836) 2026-03-02 21:01:59 +00:00
src Limit log pattern examples to 100 in side panel (#1990) 2026-03-26 02:20:55 +00:00
styles feat: Enhance data source select with context-aware icons and inline actions (#1948) 2026-03-20 19:21:51 +00:00
tests/e2e fix: Preserve default select when saving search (#1986) 2026-03-25 14:42:44 +00:00
types fix: Pollyfill crypto.randomUUID (#904) 2025-06-03 12:35:56 -04:00
.Dockerignore first commit 2023-09-12 20:08:05 -07:00
.env.development chore: Remove SQL charts toggle (#1867) 2026-03-09 14:14:37 -04:00
.gitignore chore: Run playwright tests with mongo backend (#1493) 2025-12-17 18:33:28 +00:00
.stylelintignore Theme-Aware UI Improvements for ClickStack (#1685) 2026-02-03 11:44:58 +00:00
CHANGELOG.md Release HyperDX (#1884) 2026-03-20 14:22:09 -07:00
Dockerfile ci: Replace QEMU with native ARM64 runners for release builds (#1952) 2026-03-20 23:04:49 +00:00
eslint.config.mjs chore: Prevent Date.now() and new Date() via eslint (#1937) 2026-03-18 21:19:58 +00:00
global-setup.js Add new useTimeQuery hook (#75) 2023-10-29 04:44:07 +00:00
jest.config.js Bump Typescript Version (app) (#1401) 2025-11-24 21:19:42 +00:00
mdx.d.ts first commit 2023-09-12 20:08:05 -07:00
next.config.mjs chore: deprecate Nextra and remove related code (#1728) 2026-02-12 18:32:15 +00:00
package.json chore: remove unused files, dependencies, and exports flagged by knip (#1982) 2026-03-25 20:32:03 +00:00
playwright.config.ts test: Backport Claude E2E Skill (#1836) 2026-03-02 21:01:59 +00:00
postcss.config.cjs chore: Upgrade to Mantine@7 (#306) 2024-02-25 10:37:55 +00:00
stylelint.config.mjs Fix deprecated @import syntax warning after upgrading react (#1465) 2025-12-11 22:58:08 +00:00
tsconfig.build.json fix: Update tsconfigs to resolve IDE type errors (#1150) 2025-09-11 08:55:14 -04:00
tsconfig.json chore: Update to next 16, react 19, add react compiler (#1434) 2025-12-04 23:40:59 +00:00