Skip to content

feat: add click-ui; change bug report anchor to use Link component - #3262

Merged
hoorayimhelping merged 3 commits into
mainfrom
bucky-click-ui-link
Oct 5, 2026
Merged

hoorayimhelping merged 3 commits into
mainfrom
bucky-click-ui-link

Conversation

@hoorayimhelping

Copy link
Copy Markdown
Member

Summary

  • Add click-ui as a dependency
  • Use ClickUIProvider (alongside MantineProvider) to get access to click-ui's styles, themes, and tokens
  • Update tests to work with ClickUIProvider
  • Change the <a> element in the error toast call to action to open an issue into a click-ui <Link> component.
    • Add a stylesheet to style the link correctly so no regressions occur
  • Add a storybook story

Screenshots or video

Before

Screenshot 2026-10-01 at 12 59 32 PM

After

real-after

How to test on Vercel preview

Steps:

Chrome:

  1. Open dev tools, Network tab.
  2. Right click any request and choose "Block request URL". Edit the pattern to:

/api/saved-search/

  1. Open a saved search and edit its tags. The PATCH fails and the red notification shows "An error occurred. Please open an issue on GitHub."

Firefox:

  1. Open dev tools with F12 and select the Network tab.
  2. Enable the toolbar toggle "Enable request blocking". It is the stop-sign icon on the right side of the Network toolbar. Firefox opens a "Blocking" side panel.
  3. Type this pattern in the "Block resource when URL contains" field and press Enter:

/api/saved-search/

  1. Open a saved search and edit its tags. The PATCH fails and the red notification shows "An error occurred. Please open an issue on GitHub."

@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated
hyperdx-oss Ignored Ignored Preview Oct 5, 2026 7:20pm UTC
hyperdx-storybook Ignored Ignored Preview Oct 5, 2026 7:20pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b0c3b43

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 1, 2026
@github-actions

github-actions Bot commented Oct 1, 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: 8
  • Production lines changed: 70 (+ 79 in test files, excluded from tier calculation)
  • Branch: bucky-click-ui-link
  • Author: hoorayimhelping

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 1, 2026 •

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 128 in total (1.80%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

Comment thread packages/app/styles/globals.css Resolved
@@ -1,4 +1,5 @@
import React from 'react';
import { ClickUIProvider } from '@clickhouse/click-ui';

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.

🔵 minor — Importing the click-ui barrel in the app-wide provider likely adds the whole library to every page's bundle

ThemeWrapper is used by _app.tsx, so import { ClickUIProvider } from '@clickhouse/click-ui' puts the barrel in the shared bundle. The new jest mock (src/__mocks__/react-syntax-highlighter.tsx) says the barrel pulls in react-syntax-highlighter/prism and calls registerLanguage at import time, and each component also imports its own CSS. Both are side effects, so the bundler likely can't tree-shake CodeBlock, the Radix primitives, react-window and so on. Fix: import from per-component entry points if click-ui ships them, or check the size of the _app chunk with the bundle analyzer before and after this change.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a real issue. From claude:

  • The fix belongs in click-ui. The asset maps need lazy loading or a split so Icon does not include 950 KB of flags and logos. A ./ClickUIProvider subpath export would help a little but does not address the asset size.
  • In HyperDX, any click-ui adoption that mounts the provider pays this cost once, regardless of which components follow. The decision is whether a 315 KB gzip increase on every page is acceptable for the migration start, or whether it waits on the upstream fix.
  • Prefer components that do not touch Icon while that is open: Text, Title, Container, Separator, Spacer. Avoid Link with the icon prop, Badge with icons, and Button with icons.

@github-actions

github-actions Bot commented Oct 1, 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.

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

1 posted as inline comment(s) on the changed lines. 1 listed below.

Findings outside the changed lines

1 minor
  • 🔵 packages/app/src/components/__tests__/SpanLinkedFromSubpanel.test.tsx:230 — Empty-render assertion now ignores any div inside a role="region", so it can miss what the component renders → Don't filter by [role="region"]. Render the providers on their own (renderWithMantine(<></>)) and assert the component's container markup matches that baseline (or compare container.innerHTML). That way the toast viewport is excluded by identity, not by a selector a regression could also match.

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

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[High risk] Adds a new UI component library with build and test configuration.

The PR is not ready to merge until the previously reported mixed-library story satisfies the repository requirement.

Fix All in Claude CodeFindings

  1. P2 Mixed UI libraries ▶

Summary

The PR adds Click UI to the app, mounts its theme provider alongside Mantine, updates test providers, and replaces the error-message GitHub anchor with a Click UI link. Since the previous review, only a transitive gRPC lockfile resolution changed.

Reviews (8) · Last reviewed commit: "Merge branch 'main' into bucky-click-ui-..."

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found. This is a low-risk, well-scoped first adoption of @clickhouse/click-ui: production code changes are limited to a provider mount and a single <a>→<Link> swap, and the rel="noopener noreferrer" added to the target="_blank" link is a small security improvement over the original. The remaining items are recommendations and nits.

🟡 P2 -- recommended

  • packages/app/src/components/ContactSupportText.tsx:9 -- The new click-ui Link render path (both IS_OSS branches, plus href/target/rel/className) has no unit test; the only test touching this component mocks it out entirely, so the swap is unverified.
    • Fix: Add a test rendering ContactSupportText via renderWithMantine that asserts the GitHub anchor with its rel/target under IS_OSS=true and the support-text fallback otherwise.
  • packages/app/src/setupTests.tsx:37 -- TestProviders hand-duplicates the MantineProvider → ClickUIProvider(persistTheme={false}) → Notifications nesting that ThemeWrapper owns, so the test harness can silently drift from production if the provider stack changes.
    • Fix: Derive the test wrapper from a shared provider component (or ThemeWrapper itself) so the provider nesting has one source of truth.
🔵 P3 nitpicks (4)
  • packages/app/src/stories/ClickUI.stories.tsx:50 -- The InErrorMessage story nests click-ui Text inside Mantine Stack, counter to the "do not mix both libraries inside one small component" rule added in this same diff; this is the open greptile thread.
    • Fix: Resolve the review thread noting the story is a deliberate interop smoke test, or swap Stack for a click-ui layout primitive.
    • maintainability, previous-comments
  • packages/app/src/__mocks__/react-syntax-highlighter.tsx:1 -- The hand-enumerated stub (Light/Prism/PrismLight/createElement/registerLanguage) only satisfies click-ui's import-time surface and can drift silently on a click-ui upgrade, and createElement is typed as () => null rather than the real signature.
    • Fix: Annotate the exports against typeof import('react-syntax-highlighter') so a surface change fails at type-check rather than opaquely at import.
    • maintainability, kieran-typescript
  • packages/app/src/setupTests.tsx:46 -- renderWithMantine now also mounts ClickUIProvider, so the name understates what it wraps across its many call sites.
    • Fix: Rename to renderWithProviders with a deprecated alias, or document that it mounts the full provider stack.
  • packages/app/jest.config.js:29 -- The lodash-es → lodash moduleNameMapper is test-only while production uses the real ESM lodash-es, creating a test/prod divergence surface if a lodash-es-specific behavior is ever relied on.
    • Fix: Note in the comment that the alias is test-only so it is not extended to the webpack/Next config where it would be wrong.

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

Testing gaps:

  • No CI bundle-size budget guards the author-acknowledged ~315KB gzip _app growth, so future click-ui usage pulling in more of the Icon barrel would regress silently.
  • No test asserts ThemeWrapper forwards colorScheme and persistTheme={false} to ClickUIProvider; TestProviders hardcodes theme="dark", leaving the light-mode path and prop wiring unexercised until a build-time type check.

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 1, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 395 passed • 1 skipped • 1131s

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

Tests ran across 4 shards in parallel.

View full report →

<Notifications zIndex={999999} />
{children}
{/* HyperDX user preferences determine the color mode, so click-ui should not persist preferences to localstorage. */}
<ClickUIProvider theme={colorScheme} persistTheme={false}>

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.

🔵 minor — ClickUIProvider adds a second, always-empty toast viewport to every page next to Mantine Notifications

The PR's own test change (SpanLinkedFromSubpanel.test.tsx) shows ClickUIProvider renders an empty Radix toast viewport (role="region") on every page. That puts a second "Notifications" landmark in front of screen readers and takes over the Radix F8 hotkey, but nothing uses it because toasts still go through Mantine <Notifications>. If click-ui allows it, turn off its toast/viewport. If not, write down the decision to keep two toast systems mounted.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

<Notifications zIndex={999999} />
{children}
{/* HyperDX user preferences determine the color mode, so click-ui should not persist preferences to localstorage. */}
<ClickUIProvider theme={colorScheme} persistTheme={false}>

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.

🔵 minor — ClickUIProvider adds a second, always-empty toast viewport to every page

The updated SpanLinkedFromSubpanel test ("the providers add ... an empty toast viewport region") shows ClickUIProvider mounts a Radix Toast viewport. In _app.tsx and Storybook that means every page now has an empty role="region" "Notifications (F8)" landmark next to Mantine's <Notifications>, and it takes over the F8 hotkey, even though nothing in HyperDX uses click-ui toasts. If ClickUIProvider has an option to turn off its toast/tooltip sub-providers, use it. If not, mount only the theme provider click-ui exports so the app has one notification system.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

@@ -1,4 +1,5 @@
import React from 'react';
import { ClickUIProvider } from '@clickhouse/click-ui';

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.

🔵 minor — Barrel import of click-ui in _app likely puts all of click-ui in the shared bundle

ThemeWrapper is rendered by pages/_app.tsx, so this import loads on every page. The new mock in src/__mocks__/react-syntax-highlighter.tsx says the barrel touches react-syntax-highlighter (registerLanguage) at import time. Module-level side effects like that stop tree-shaking, so CodeBlock's prism/highlight.js/refractor, the date picker, sortablejs and react-window probably all end up in the common chunk just to render one Link. Add experimental.optimizePackageImports: ['@clickhouse/click-ui'] (or import from per-component entry points if the package has them), then compare next build chunk sizes before and after.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Confirmed. The _app chunk grows by 315 KB gzip. Per-component imports do not help, since Link and the provider both pull in click-ui's Icon, which bundles every flag and logo SVG as React components, about 950 KB minified. Click-ui ships no provider subpath. The fix is upstream in click-ui's asset loading. We decide here whether to accept the cost for the first adoption step.

What to do

  • The fix belongs upstream in click-ui. The asset maps need lazy loading or a split so Icon does not carry 950 KB of flags and logos. A ./ClickUIProvider subpath export would help a little but does not address the asset weight.
  • In HyperDX, any click-ui adoption that mounts the provider pays this cost once, regardless of which components follow. The decision is whether a 315 KB gzip increase on every page is acceptable for the migration start, or whether it waits on the upstream fix.
  • Prefer components that do not touch Icon while that is open: Text, Title, Container, Separator, Spacer. Avoid Link with the icon prop, Badge with icons, and Button with icons.

Comment thread agent_docs/code_style.md
@@ -398,6 +398,24 @@ The UI is built with **Mantine components**, but **colors and surfaces** should

Mantine theme overrides in `packages/app/src/theme/**` may map Mantine’s scale to our palette; that does not replace using **`var(--color-...)`** in new styling where you need explicit color control.

## Click UI (incremental adoption)

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.

🔵 minor — New Click UI section splits the semantic-tokens section, so the chart-colors rule now sits under the Click UI heading

Move the ## Click UI (incremental adoption) block below the "Chart and visualization colors are a separate, more specific contract" paragraph. That paragraph belongs to "Semantic design tokens", and right now it reads as part of the Click UI guidance.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Comment thread agent_docs/code_style.md
follows the HyperDX color mode and never writes its own theme to localStorage.
Storybook and `renderWithMantine` in tests get the provider for free.

- **Do**: Prefer a click-ui component over a new Mantine one when click-ui has

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.

🔵 minor — New 'prefer click-ui over Mantine' rule contradicts the existing 'Prefer Mantine components' rule in the same doc

The base convention under "Mantine UI Components" says "Prefer Mantine components over custom-styled elements". The new bullet tells contributors to pick click-ui Text/Title/Badge/Container over Mantine. Reword one of the two rules (e.g. scope the Mantine rule, or limit the click-ui rule to Link for now) so the doc doesn't give conflicting guidance.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

<Notifications zIndex={999999} />
{children}
{/* HyperDX user preferences determine the color mode, so click-ui should not persist preferences to localstorage. */}
<ClickUIProvider theme={colorScheme} persistTheme={false}>

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.

🔵 minor — ClickUIProvider adds a second, always-empty toast viewport landmark next to Mantine Notifications

The SpanLinkedFromSubpanel.test.tsx change shows that the provider now renders an empty role="region" toast viewport on every page. Mantine Notifications already provides one. Screen-reader users get two notification landmarks, plus the Radix viewport's hotkey listener. Turn off click-ui's toast provider/viewport if it has an option for that, or note it as a known cost until click-ui toasts are actually used.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

export const InErrorMessage: Story = {
render: () => (
<Stack gap="xs">
<Text>

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.

🔵 minor — InErrorMessage story uses click-ui Text inside a Mantine Stack, which doesn't match real usage and breaks the doc's own 'don't mix libraries' rule

In production, ContactSupportText renders inside a Mantine notifications.show message (DBSearchPage.tsx:1621, DBDashboardPage.tsx:2833). Render the story inside a Mantine Notification color="red" instead, so it actually catches the font/color regression the new .inlineLink stylesheet is meant to prevent.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Comment on lines +52 to +55
<Stack gap="xs">
<Text>
An error occurred. <ContactSupportText />
</Text>

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 Mixed UI libraries The new InErrorMessage story nests click-ui’s Text inside Mantine’s Stack. The repository’s Click UI guidance says not to mix the two libraries inside one small component. This requirement must be satisfied before merging.

Context Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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

@@ -1,4 +1,5 @@
import React from 'react';
import { ClickUIProvider } from '@clickhouse/click-ui';

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.

🔵 minor — All of click-ui is loaded on every page just to render one Link

ThemeWrapper (mounted in pages/_app.tsx) and ContactSupportText import from the @clickhouse/click-ui barrel. The new __mocks__/react-syntax-highlighter.tsx comment confirms that barrel pulls in react-syntax-highlighter, prism, refractor and highlight.js when the module is imported, along with about 15 Radix packages. Run next build and compare the _app chunk size before and after. If it grew, import Link and ClickUIProvider from per-component entry points, or hold off on mounting the provider app-wide until more click-ui components are in use.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

<MantineProvider>
global.TestProviders = ({ children }: { children: React.ReactNode }) => (
<MantineProvider>
<ClickUIProvider theme="dark" persistTheme={false}>

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.

🔵 minor — Test providers hardcode a dark click-ui theme while Mantine renders in light

TestProviders renders <MantineProvider> (Mantine's default is light) but passes ClickUIProvider theme="dark". ThemeWrapper drives both providers from the same colorScheme. Use one shared constant here, e.g. const scheme = 'light', and pass it as both forceColorScheme={scheme} and theme={scheme}, so tests run with the same pairing as production.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

<span>
Please open an issue on{' '}
<a href={GH_LINK} target="_blank">
<Link

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.

🔵 minor — Global a { color: inherit; text-decoration: none } overrides click-ui Link's color and underline

packages/app/styles/globals.css:7 is unlayered and loaded in _app.tsx and Storybook. Per this PR's own note, click-ui styles sit in the clickui cascade layer, so that global rule beats the Link's color and underline. The 'GitHub' link then looks like the surrounding toast text, as it did before. Scope the global reset with :where(a:not([class])), or move it into a lower layer. Otherwise every click-ui Link the new guideline asks for will lose its styling the same way.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

<Notifications zIndex={999999} />
{children}
{/* HyperDX user preferences determine the color mode, so click-ui should not persist preferences to localstorage. */}
<ClickUIProvider theme={colorScheme} persistTheme={false}>

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.

🔵 minor — ClickUIProvider adds a second, always-empty toast region to every page

The updated SpanLinkedFromSubpanel test confirms the provider renders an empty toast viewport (role="region"). In the app this sits next to Mantine's <Notifications>, so screen readers get an extra empty 'Notifications' landmark and the toast viewport's hotkey listener is registered globally. Nothing in the app uses click-ui toasts. Turn off click-ui's toast provider through ClickUIProvider's config, or only mount it once click-ui toasts are actually used.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

};

export const InErrorMessage: Story = {
render: () => (

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.

🔵 minor — Stack gap="xs" in InErrorMessage wraps a single child, so the gap never applies

Remove the Stack and the @mantine/core import and render the click-ui <Text> directly. That also drops the Mantine/click-ui mix that the new code_style section tells people to avoid in small components.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

@hoorayimhelping
hoorayimhelping merged commit 766a3b0 into main Oct 5, 2026
43 of 44 checks passed
@hoorayimhelping
hoorayimhelping deleted the bucky-click-ui-link branch October 5, 2026 20:01
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