Skip to content

test: cover SVG coordinate changes between pointer samples - #226

Merged
tannerlinsley merged 1 commit into
mainfrom
taren/svg-coordinate-invalidation
Oct 14, 2026
Merged

tannerlinsley merged 1 commit into
mainfrom
taren/svg-coordinate-invalidation

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

What changed

Extend the existing SVG coordinate test to cover ancestor translation, preceding layout movement and scrolling between pointer samples, without resizing or re-rendering the chart.

The matrix mock now captures its coefficients when read, like a browser matrix snapshot. A cached matrix must not appear to update itself through a test closure.

Related to @toomingos's report in #203. This protects existing behavior while the remaining pointer-coordinate optimization is investigated. It does not fix or close the remaining performance report.

Verification

  • All 19 pnpm validate tasks pass, including 2,237 main tests, type checks, packed consumers, docs and bundle gates.
  • Maintained example builds pass. All 188 regenerated SVG previews are unchanged.
  • Chromium, Firefox and WebKit reproduce stale coordinates for all three movements when a matrix is cached until resize or scene update.
  • A private mutation run that caches the first matrix fails the extended test by 42.38 px. The real implementation passes.
  • No runtime files, package versions, dependencies, bundle budgets or CI jobs change. No Changeset is needed for test coverage alone.

The preview manifest is regenerated because the existing source fingerprint includes test files.

Summary by CodeRabbit

  • Tests
    • Expanded coverage for chart coordinate mapping when an SVG moves on screen, including horizontal and vertical movement. This verifies that interactions remain aligned with the chart’s current position, even when its size and rendered scene have not changed. No user-facing functionality changes are included.

@changeset-bot

changeset-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8873b45

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eae63dce-2a63-489a-bd71-78a8061585a7
📥 Commits

Reviewing files that changed from the base of the PR and between a66cdbf and 8873b45.

📒 Files selected for processing: 2
  • benchmarks/conformance/previews/manifest.json
  • packages/charts-core/src/svg-surface.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

📝 Walkthrough

The SVG coordinate-mapping test now checks results after horizontal and vertical movement between samples. The conformance preview manifest’s sourceHash value also changed.

Changes: SVG Coordinate Mapping

Layer / File(s) Summary
Coordinate mapping test updates
packages/charts-core/src/svg-surface.test.ts
The test mock accounts for current horizontal and vertical translations. The test checks coordinate mapping after positive horizontal and vertical movement and negative vertical movement.

Conformance Preview Manifest

Layer / File(s) Summary
Preview source hash
benchmarks/conformance/previews/manifest.json
The manifest’s sourceHash value changed.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 8873b

The added test coverage and manifest update present no identified blocker to merging after normal checks.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: extending SVG coordinate tests to cover coordinate changes between pointer samples.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@nx-cloud

nx-cloud Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 8873b45

Command Status Duration Result
nx run charts-workspace:ci-distributed ✅ Succeeded 2m 24s View ↗
nx run charts-workspace:package-check ✅ Succeeded <1s View ↗
nx run charts-workspace:benchmark-check ✅ Succeeded 46s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-14 05:33:32 UTC

@tannerlinsley
tannerlinsley merged commit 39869d8 into main Oct 14, 2026
13 checks passed
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.

1 participant