Skip to content

[D]DLS-702-feature(ui-react-visualization): Add Scrubber component#680

Open
zel-kass wants to merge 3 commits intomainfrom
DLS-702-feat/scrubber-react
Open

[D]DLS-702-feature(ui-react-visualization): Add Scrubber component#680
zel-kass wants to merge 3 commits intomainfrom
DLS-702-feat/scrubber-react

Conversation

@zel-kass
Copy link
Copy Markdown
Collaborator

@zel-kass zel-kass commented May 5, 2026

Overview

Introduce Scrubber component with keyboard controls, and plug it to CartesianChart.
Screenshot 2026-05-05 at 17 44 53

@zel-kass zel-kass requested a review from a team as a code owner May 5, 2026 15:45
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

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

Project Deployment Actions Updated (UTC)
ldls Ready Ready Preview, Comment May 5, 2026 4:03pm
ldls-react-native Ready Ready Preview, Comment May 5, 2026 4:03pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an interactive “Scrubber” feature to ui-react-visualization charts, enabling hover/touch/keyboard-driven selection of an x-position and rendering corresponding chart overlays (line/label/beacons).

Changes:

  • Introduce Scrubber component + provider/context for pointer/touch/keyboard interactions.
  • Wire scrubbing support through CartesianChart and LineChart public APIs.
  • Add unit tests and Storybook stories for scrubber behavior.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
libs/ui-react-visualization/src/lib/utils/scales/scales.ts Adds a helper to map a single x value to pixel space (incl. band centering).
libs/ui-react-visualization/src/lib/Components/Scrubber/utils.ts Adds pixel→data-index resolution for different x-scale modes.
libs/ui-react-visualization/src/lib/Components/Scrubber/utils.test.ts Tests for pixel→index mapping across band/linear + axis-data cases.
libs/ui-react-visualization/src/lib/Components/Scrubber/types.ts Defines scrubber props/context/provider types.
libs/ui-react-visualization/src/lib/Components/Scrubber/ScrubberProvider.tsx Attaches SVG event listeners and manages scrubber position state.
libs/ui-react-visualization/src/lib/Components/Scrubber/ScrubberProvider.test.tsx Integration-style tests for provider interactions (mouse/keys/focus).
libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.tsx Renders scrubber visuals (line, overlay, label, beacons).
libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.test.tsx Tests scrubber rendering toggles and basic positioning.
libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.stories.tsx Storybook coverage for scrubber usage scenarios.
libs/ui-react-visualization/src/lib/Components/Scrubber/index.ts Public exports for scrubber module.
libs/ui-react-visualization/src/lib/Components/Scrubber/context/* Safe context + hook for scrubber state.
libs/ui-react-visualization/src/lib/Components/LineChart/types.ts Adds enableScrubbing + onScrubberPositionChange to LineChart API.
libs/ui-react-visualization/src/lib/Components/LineChart/LineChart.tsx Passes scrubbing props through to CartesianChart.
libs/ui-react-visualization/src/lib/Components/LineChart/LineChart.stories.tsx Adds a “real-time” scrubbing demo story.
libs/ui-react-visualization/src/lib/Components/index.ts Re-exports scrubber from components barrel.
libs/ui-react-visualization/src/lib/Components/CartesianChart/types.ts Adds scrubbing props to CartesianChart API.
libs/ui-react-visualization/src/lib/Components/CartesianChart/CartesianChart.tsx Mounts ScrubberProvider, makes SVG focusable when enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/ui-react-visualization/src/lib/Components/Scrubber/types.ts Outdated
Comment thread libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.tsx Outdated
Comment thread libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.tsx Outdated
Comment on lines +88 to +92
const maxIndex = dataLength - 1;
const current = scrubberPosition ?? maxIndex;
const step = event.shiftKey
? Math.min(10, Math.max(1, Math.floor(maxIndex * 0.1)))
: 1;
Comment on lines +168 to +173
const contextValue: ScrubberContextValue = useMemo(
() => ({
enableScrubbing,
scrubberPosition,
onScrubberPositionChange: setScrubberPosition,
}),
style={{
display: 'block',
overflow: 'visible',
outline: enableScrubbing ? 'none' : undefined,
Comment thread libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.test.tsx Outdated
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
78.7% Coverage on New Code (required ≥ 80%)
3 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

style={{
stroke: cssVar('var(--border-muted-subtle)'),
opacity: 0.5,
}}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

so we do not have a token for this one ? looks like border-muted-subtle on figma, why do we need the reduce opacity ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

the exact token needed for this was border-muted-subtle-transparent, but when I tried to add it, the token wasn't recognized, so Laurine told me it was just border-muted-subtle with a 50% opacity

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.

3 participants