Skip to content

fix: update event types for XAxis and YAxis, add type tests#7004

Merged
PavelVanecek merged 1 commit intomainfrom
axis-types
Feb 15, 2026
Merged

fix: update event types for XAxis and YAxis, add type tests#7004
PavelVanecek merged 1 commit intomainfrom
axis-types

Conversation

@PavelVanecek
Copy link
Collaborator

@PavelVanecek PavelVanecek commented Feb 13, 2026

Description

Last set of event types.

Related Issue

#6645

Closes #2674

Summary by CodeRabbit

  • Tests
    • Added type validation tests for XAxis and YAxis event handlers to ensure correct event type handling.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Walkthrough

This PR refines the type safety of XAxis and YAxis components by updating their exported Props types from generic any and SVGElement to the specific TickItem and SVGTextElement types, with new TypeScript tests validating the event handler typing.

Changes

Cohort / File(s) Summary
Axis Event Type Refinement
src/cartesian/XAxis.tsx, src/cartesian/YAxis.tsx
Updated Props type signature to use PresentationAttributesAdaptChildEvent<TickItem, SVGTextElement> instead of PresentationAttributesAdaptChildEvent<any, SVGElement>, with TickItem import added to both files.
TypeScript Event Handler Tests
test/cartesian/XAxis/XAxis.typed.spec.tsx, test/cartesian/YAxis/YAxis.typed.spec.tsx
Added new TypeScript test files validating event handler types for XAxis and YAxis, confirming that event handlers receive properly typed TickItem parameters and work with getRelativeCoordinate function.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

typescript

Suggested reviewers

  • ckifer
🚥 Pre-merge checks | ✅ 4 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is minimal but covers the basic requirement, referencing a related issue. However, it lacks detail on motivation, testing approach, and doesn't fill most template sections. Expand the description to include motivation/context for the changes, testing methodology, and check the appropriate boxes in the Types of changes and Checklist sections.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: updating event types for XAxis and YAxis components and adding type tests.
Linked Issues check ✅ Passed The PR updates XAxis and YAxis Props types to use TickItem and SVGTextElement, and adds type tests validating event handler signatures, directly addressing the objective to provide proper event types for axis components.
Out of Scope Changes check ✅ Passed All changes are directly scoped to updating event types for XAxis and YAxis and adding corresponding type tests, with no extraneous modifications detected.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch axis-types

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.10%. Comparing base (8042617) to head (8286901).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7004   +/-   ##
=======================================
  Coverage   90.10%   90.10%           
=======================================
  Files         522      522           
  Lines       38853    38853           
  Branches     5349     5349           
=======================================
  Hits        35009    35009           
  Misses       3835     3835           
  Partials        9        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

@codecov
Copy link

codecov bot commented Feb 13, 2026

Bundle Report

Bundle size has no change ✅

@PavelVanecek PavelVanecek merged commit f96c73d into main Feb 15, 2026
47 of 48 checks passed
@PavelVanecek PavelVanecek deleted the axis-types branch February 15, 2026 03:58
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.

I would like onClick function in XAxis to include full React.MouseEvent event

1 participant