Skip to content

fix(coding-conventions): Rename capitalized 'Legend' function to 'legend' - #121928

Open
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/rename-chart-legend-function
Open

fix(coding-conventions): Rename capitalized 'Legend' function to 'legend'#121928
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/rename-chart-legend-function

Conversation

@sentry

@sentry sentry Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

The Legend function in static/app/components/charts/components/legend.tsx was named with a capital letter, which conventionally signifies a React component. However, this function is an echarts configuration factory, returning a LegendComponentOption object, not a React element.

This naming mismatch caused the React Compiler's no-capitalized-function-calls rule to flag direct calls to Legend as violations, as it reserves capitalized identifiers for components that should be invoked with JSX.

This change renames export function Legend to export function legend in static/app/components/charts/components/legend.tsx.

All five affected call sites have been updated to reflect this change:

  • static/app/views/issueDetails/eventGraph.tsx
  • static/app/chartcuterie/timeseries.tsx
  • static/app/chartcuterie/slack.tsx
  • static/app/views/organizationStats/usageChart/index.tsx
  • static/gsAdmin/components/customers/customerStats.tsx (using makeLegend alias to avoid local variable collision).

This resolves the no-capitalized-function-calls warning for this specific instance and aligns the function's naming with React's conventions for non-component utilities.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes CODING-CONVENTIONS-1TV

@sentry
sentry Bot requested review from a team as code owners August 13, 2026 01:44
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 13, 2026
@ryan953 ryan953 added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Aug 13, 2026
baseChart.tsx imported Legend via a relative path and was missed by the rename, breaking typecheck and every chart test. usageChart shadowed the new lowercase import with a local variable. Alias both to makeLegend.
@github-actions github-actions Bot removed the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant