Skip to content

feat(workbenches): enhance chart interactivity#3790

Merged
michaeljguarino merged 2 commits into
masterfrom
sebastian/prod-5012-usage-workbench-followup
Jul 2, 2026
Merged

feat(workbenches): enhance chart interactivity#3790
michaeljguarino merged 2 commits into
masterfrom
sebastian/prod-5012-usage-workbench-followup

Conversation

@floreks

@floreks floreks commented Jul 1, 2026

Copy link
Copy Markdown
Member
  • Always enable area for better visualization
  • Add y-axis marker for single data point mode
  • Set crosshair line color in chart utils

Updated crosshair line color

image

Line instead of a single point

image

Test Plan

Test environment: https://console.plrl-dev-aws.onplural.sh/

Checklist

  • I have added a meaningful title and summary to convey the impact of this PR to a user.
  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have deployed the agent to a test environment and verified that it works as expected (required only when changing agent code).

Plural Flow: console

- Always enable area for better visualization
- Add y-axis marker for single data point mode
- Set crosshair line color in chart utils
@floreks floreks self-assigned this Jul 1, 2026
@floreks floreks added the enhancement New feature or request label Jul 1, 2026
@linear

linear Bot commented Jul 1, 2026

Copy link
Copy Markdown

PROD-5012

@soffi-ai

soffi-ai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Soffi AI Summary

This PR improves the chart visualization in the Workbenches Usage component to handle edge cases and polish the appearance of line charts.

Motivation: The existing line chart had two visual issues when dealing with limited data: (1) when only a single data point existed, there was no shaded area fill — only an isolated dot with no context — and (2) the crosshair line used an unthemed color, making it inconsistent with the design system.

Key changes:

  1. Single-point area fill — Adds a custom SVG layer (singlePointAreaLayer) that renders a filled rectangle beneath a single data point, simulating the area fill that @nivo/line's built-in enableArea cannot produce for a single point. This gives users a visual sense of the magnitude even with minimal data.
  2. Single-point Y-axis marker — Replaces the isolated dot in single-point mode with a horizontal marker line across the chart at the data point's Y value, providing a cleaner "reference line" appearance instead of a floating point.
  3. Crosshair color theming — Adds a crosshair.line.stroke entry to the shared useChartTheme hook, ensuring the crosshair uses the design system's icon-light color instead of whatever default Nivo applies.
  4. Always-disabled pointsenablePoints is now unconditionally false (previously true in single-point mode), since the new marker line supersedes the point dot.

These changes make the workbench usage charts more informative and visually consistent across all data states.

Commits

Commit Summary
f8c92af Enables the area fill for all chart modes, adds a y-axis marker line for single-point data (replacing the isolated dot), and sets the crosshair line color via the shared chart theme utility.
0f67373 Introduces a custom SVG layer (singlePointAreaLayer) that renders a filled rectangle beneath the data point when only a single point is present, replicating the visual area fill that Nivo's built-in area rendering cannot produce for a single-point series.

Deploy in Soffi


Updated: 2026-07-01 11:52 UTC

@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR enhances chart interactivity in the workbenches usage view with three small, focused changes to ResponsiveLine rendering and the shared chart theme.

  • Always enables the area fill (previously suppressed for single-point series) and always disables individual data points, replacing the single-point dot with a horizontal y-axis marker drawn at the recorded value.
  • Adds a themed crosshair line color (icon-light) to the shared useChartTheme hook so the crosshair is consistently styled across all charts that consume it.

Confidence Score: 4/5

Safe to merge; changes are purely visual and self-contained within the workbenches usage charts.

The logic is straightforward and low-risk. The one notable edge case — a zero-value single data point causing the y-axis marker to be invisible — is a minor visual gap rather than broken behaviour, and the rest of the chart still renders correctly in that state.

assets/src/components/workbenches/WorkbenchesUsage.tsx — specifically the zero-value single-point marker rendering.

Important Files Changed

Filename Overview
assets/src/components/utils/charts.tsx Adds a themed crosshair line color to the shared chart config using an existing design-token color.
assets/src/components/workbenches/WorkbenchesUsage.tsx Always enables area fill, disables points universally, and adds a horizontal y-axis marker for single-data-point charts; minor edge case when the single value is 0.

Reviews (1): Last reviewed commit: "feat(workbenches): enhance chart interac..." | Re-trigger Greptile

Comment thread assets/src/components/workbenches/WorkbenchesUsage.tsx
- Introduce `UsageLineSeries` type for chart data
- Implement `singlePointAreaLayer` for enhanced single data point visualization
- Adjust `layers` in `ResponsiveLine` to include custom area layer and improve rendering logic
- Set `enableArea` conditionally based on `isSinglePoint` status
@michaeljguarino michaeljguarino merged commit 6366f2f into master Jul 2, 2026
13 checks passed
@michaeljguarino michaeljguarino deleted the sebastian/prod-5012-usage-workbench-followup branch July 2, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants