Skip to content

Share the Group by split button - #3429

Closed
elizabetdev wants to merge 2 commits into
mainfrom
agent/split-value-button
Closed

elizabetdev wants to merge 2 commits into
mainfrom
agent/split-value-button

Conversation

@elizabetdev

@elizabetdev elizabetdev commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Group by uses a new shared split button: a fixed name, then the current value. On a narrow screen a count such as 3 fields shows as 3. A single field still shows its name.

Columns and Sort will use the same button in a follow-up. This PR only switches Group by, so that button can be reviewed on its own. Storybook (Components/SplitValueButton) says when to use it.

Related: #3387

Screenshots or video

Screenshot 2026-10-21 at 15 10 27

On the search page:
Screenshot 2026-10-21 at 15 14 15

How to reproduce

Starting point: Vercel preview, or yarn app:dev:local connected to the demo server.

On main:

  1. Open Search.
  2. Open Group by and select two fields, then Apply.
  3. Narrow the window below 900px. The button still reads 2 fields.

On this branch:

  1. Open Search.
  2. Open Group by and select two fields, then Apply.
  3. Narrow the window below 900px. The value shows 2. One field still shows its name, and an empty selection still shows none.

How to test on Vercel preview

Preview routes: /search

Steps:

  1. Open Group by.
  2. Select two fields and click Apply.
  3. Verify the button reads Group by and 2 fields at a desktop width.
  4. Narrow the viewport below 900px.
  5. Verify the value shows 2.

References

Made with Cursor

Group by needs the same name-and-value button Columns and Sort will use. On a narrow screen a field count is only the number.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Oct 21, 2026 2:12pm UTC
hyperdx-storybook Ready Ready Preview Oct 21, 2026 2:12pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 13028a8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions Bot added the review/tier-2 Low risk — AI review + quick human skim label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🔵 Tier 2 — Low Risk

Small, isolated change with no API route or data model modifications.

Why this tier:

  • Standard feature/fix — introduces new logic or modifies core functionality

Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns.
SLA: Resolve within 4 business hours.

Stats
  • Production files changed: 3
  • Production lines changed: 148 (+ 161 in test files, excluded from tier calculation)
  • Branch: agent/split-value-button
  • Author: elizabetdev

To override this classification, remove the review/tier-2 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 critical or 🟠 major in code this PR adds or changes: fix before asking for review.
  • 🔵 minor in code this PR changes: your call. Fix if small, otherwise reply.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    severity. Reply with one sentence; if it is critical, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

4 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 4 minor

None could be anchored to changed lines; they are listed below.

Findings outside the changed lines

4 minor
  • 🔵 packages/app/src/components/SplitValueButton/__tests__/SplitValueButton.test.tsx:448 — The narrow-screen test still passes if compact mode is ignored → toHaveTextContent('3') matches substrings, so the button would pass while still rendering 3 fields. The test never checks the one behaviour this PR adds. Use an exact match, e.g. toHaveTextContent(/^3$/), or assert not.toHaveTextContent('fields').
  • 🔵 packages/app/src/components/SplitValueButton/SplitValueButton.tsx:344 — The title prop has no caller, so the compact count gives no way to see the fields → The doc comment says title shows the full clause on hover when the value is only a summary. SearchGroupBySelect never passes it, so on a narrow screen a sighted user sees only 2 and has no hover hint. Either pass the joined field list as title from SearchGroupBySelect.tsx, or remove the unused prop.
  • 🔵 packages/app/src/components/SplitValueButton/SplitValueButton.tsx:338 — summary and count are two hand-synced sources of truth for the same field list → Callers pass both a text summary and a count, so nothing stops a mismatched pair such as summary="none" with count={3}. The only real caller derives both from appliedFields anyway. Accept fields: string[] (plus an optional summary override for Sort's direction) and compute both values inside the component with fieldListSummary.
  • 🔵 packages/app/src/components/SplitValueButton/SplitValueButton.module.scss:157 — align-self: flex-start overrides the parent row's vertical centering → The button is rendered inside SearchResultsCountGroup, a <Group align="center"> (packages/app/src/DBSearchPage.tsx:357). align-self: flex-start pins the button to the top of that row, so it sits higher than the count chart whenever the chart is taller than 30px. The old .control rule did not have this. Drop align-self (width: fit-content and flex-shrink: 0 already stop it from stretching), or set it only in the stacked layout that needs it.

Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides.

@github-actions

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 123 in total (1.62%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the remaining test weakness is non-blocking.

Fix All in Claude CodeFindings

  1. P2 Narrow-screen test accepts desktop text ▶

Summary

Shares the Group by trigger through SplitValueButton.

  • Group by shows field counts as numbers on narrow screens.

Reviews (2) · Last reviewed commit: "fix(app): keep the split button only as ..." · Reviewed by Greptile

Comment on lines +29 to +34
compact
onClick={() => {}}
data-testid="columns"
/>,
);
expect(screen.getByTestId('columns')).toHaveTextContent('3');

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 Narrow-screen test accepts desktop text

toHaveTextContent('3') also passes when the button displays 3 fields, so this test misses a broken narrow-screen count. Use an exact text check. Also add a case without the compact override so the tests catch a broken connection to useCompactViewport.

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

@github-actions

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found.

This is a clean, well-typed presentational refactor: a new shared SplitValueButton component plus migration of the Search Group by trigger. React 19 makes the ref-as-prop valid, the SCSS rename is clean with no dangling references, the changeset is present, and prior behavior (none / single-field / N fields, apply, accessible name) is preserved. The findings below are recommendations, not blockers.

🟡 P2 — recommended

  • packages/app/src/components/SplitValueButton/SplitValueButton.tsx:61 — The PR's core new behavior (compact narrow-screen rendering) and the migration's summary/count/dimmed wiring are only tested via the compact prop override, so the real useCompactViewport path, the 900px breakpoint, and the SearchGroupBySelect integration have no coverage and could regress silently.
    • Fix: Add a test that drives the real useCompactViewport/useWindowSize path across the breakpoint, plus an integration assertion that SearchGroupBySelect renders the button with the derived summary, count, and dimmed from appliedFields.
    • correctness, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races
🔵 P3 nitpicks (4)
  • packages/app/src/components/SplitValueButton/SplitValueButton.tsx:19 — The custom name prop intersects with the native button name carried by ComponentPropsWithoutRef<'button'>, so the native attribute becomes unreachable and could surprise a future adopter.
    • Fix: Rename the clause-label prop to label (or clause) to avoid shadowing the native attribute.
  • packages/app/src/components/SplitValueButton/SplitValueButton.tsx:21 — summary and count are separate props with an unenforced invariant; a mismatched pair (e.g. summary="3 fields" with count=5) silently renders the wrong number in compact mode, which is fragile for the planned Columns/Sort adopters.
    • Fix: Derive both from a single source inside the component, or document and assert the invariant.
  • packages/app/src/components/SplitValueButton/SplitValueButton.tsx:83 — The live-wired dimmed branch (dimmed={value == null}) and the count === 0 / none rendering have no unit assertions.
    • Fix: Add unit tests asserting the dimmed color is applied when dimmed is set and that count === 0 renders none.
  • packages/app/src/components/SearchGroupBy/SearchGroupBySelect.tsx:118 — The component advertises a title hover prop for truncated values, but the Group by caller never passes it, so a long single-field value clipped by the 220px ellipsis (SplitValueButton.module.scss:39) has no way to reveal its full text; note the truncation itself is pre-existing.
    • Fix: Pass title={fieldListSummary(appliedFields)} (or the full value) from the caller so clipped values remain readable on hover.
    • kieran-typescript, correctness

Reviewers (9): correctness, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races, agent-native, learnings-researcher, previous-comments.

Testing gaps: the production useCompactViewport wiring and the SearchGroupBySelect migration are unverified (compact tested only via prop override); dimmed, count === 0/none, ref forwarding through Popover.Target, and className merge are uncovered. Prior comments were bot-only (Vercel, changeset-bot) — no human feedback to verify.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 457 passed • 1 skipped • 1670s

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

Tests ran across 4 shards in parallel.

View full report →

The frame was stretching in a column layout, so the chevron sat away from the end of the value.

Co-authored-by: Cursor <cursoragent@cursor.com>

@pulpdrew pulpdrew left a comment

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.

LGTM

@elizabetdev
elizabetdev deleted the agent/split-value-button branch October 21, 2026 14:35
kodiakhq Bot pushed a commit that referenced this pull request Oct 21, 2026
## Summary

Group by uses a new shared split button: a fixed name, then the current value. On a narrow screen a count such as `3 fields` shows as `3`. A single field still shows its name.

Columns and Sort will use the same button in a follow-up. This PR only switches Group by, so that button can be reviewed on its own. Storybook (`Components/SplitValueButton`) says when to use it.

Related: #3387. Replaces #3429, which closed when the branch moved off the `agent/` prefix.

### Screenshots or video

<img width="599" height="436" alt="Screenshot 2026-10-21 at 15 10 27" src="https://github.com/user-attachments/assets/4c40486d-d015-446b-bc45-269851e0772b" />

On the search page:
<img width="556" height="99" alt="Screenshot 2026-10-21 at 15 14 15" src="https://github.com/user-attachments/assets/f7f77c13-65d9-48c7-9604-540b1b535b8a" />

### How to reproduce

**Starting point:** Vercel preview, or `yarn app:dev:local` connected to the demo server.

**On `main`:**

1. Open Search.
2. Open Group by and select two fields, then Apply.
3. Narrow the window below 900px. The button still reads `2 fields`.

**On this branch:**

1. Open Search.
2. Open Group by and select two fields, then Apply.
3. Narrow the window below 900px. The value shows `2`. One field still shows its name, and an empty selection still shows `none`.

### How to test on Vercel preview

**Preview routes:** /search

**Steps:**

1. Open Group by.
2. Select two fields and click Apply.
3. Verify the button reads Group by and `2 fields` at a desktop width.
4. Narrow the viewport below 900px.
5. Verify the value shows `2`.

### References

- Related PR: #3387


Made with [Cursor](https://cursor.com)

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 13028a80 Deployed Oct 21, 2026 by vercel[bot]
Preview – hyperdx-storybook — 13028a80 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/tier-2 Low risk — AI review + quick human skim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants