Skip to content

feat(scan): ranked list search with stable bar widths#429

Open
RajuGangitla wants to merge 3 commits intoaidenybai:mainfrom
RajuGangitla:feat/search-in-scan
Open

feat(scan): ranked list search with stable bar widths#429
RajuGangitla wants to merge 3 commits intoaidenybai:mainfrom
RajuGangitla:feat/search-in-scan

Conversation

@RajuGangitla
Copy link
Copy Markdown

@RajuGangitla RajuGangitla commented Mar 31, 2026

Fixes

This pr Fixes #432

Main problem

Ranked slowdown lists are hard to use at scale: you can’t quickly find a component.

Issues Resolved

  • Search on Ranked (filter by row label, case-insensitive).
  • Usable input: don’t steal pointer/focus from inputs (and similar controls) when dragging the widget.
  • Honest bar chart: bar fill stays vs the full event total, not only visible rows after search.
  • Code quality: small tested helpers + safe divide-by-zero guard for bar width math.

Files

render-bar-chart.tsx, details-routes.tsx, widget/index.tsx, ranked-bar-chart-search.ts, ranked-bar-chart-search.test.ts, constants.ts

please checkout video
react-scan-search.webm


Note

Low Risk
Low risk UI/UX changes with small, well-tested helper utilities; main risk is minor regressions in ranked chart rendering and widget drag interactions.

Overview
Adds search filtering to the ranked render bar list, including an empty-state message, while keeping each bar’s width scaled against the full event total (not just the filtered subset) and guarding against divide-by-zero via a shared minimum denominator constant.

Extracts ranked-bar label/search/width-denominator logic into a new ranked-bar-chart-search utility with Vitest coverage, tweaks the notification tab layout and forces RenderBarChart remount per selected event (key={selectedEvent.id}), and updates widget dragging to not intercept pointer events originating from form controls (inputs/selects/labels/contenteditable) or buttons.

Written by Cursor Bugbot for commit 075718c. This will update automatically on new commits. Configure here.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

@RajuDev0 is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

if (!refWidget.current) return;

const eventTarget = e.target;
if (!(eventTarget instanceof HTMLElement)) return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Drag breaks when pointer target is SVG element

Medium Severity

The instanceof HTMLElement guard rejects all SVG-based targets (like SVGSVGElement, SVGPathElement, SVGUseElement), causing the handleDrag function to return early without initiating a drag. SVG elements inherit from Element, not HTMLElement. The widget uses SVG icons extensively (via the Icon component rendering <svg> with <use>, ChevronRight with <path>, etc.). While most are currently inside buttons, the check is logically too narrow — instanceof Element would correctly allow the closest() calls to function for both HTML and SVG targets.

Fix in Cursor Fix in Web

if (!refWidget.current) return;

const eventTarget = e.target;
if (!(eventTarget instanceof HTMLElement)) return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
if (!(eventTarget instanceof HTMLElement)) return;
if (!(eventTarget instanceof Element)) return;

SVG elements in the widget (like the close button icon) fail the HTMLElement instanceof check, preventing drag initialization when clicking on SVG-based UI elements

Fix on Vercel

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.

feat(scan): search filter for Ranked list

2 participants