Skip to content

AG-15850 TC10 Fix setState({active}) on gauges#6098

Merged
olegat merged 9 commits intolatestfrom
AG-15850/tc10_fixes_gauges
Feb 5, 2026
Merged

AG-15850 TC10 Fix setState({active}) on gauges#6098
olegat merged 9 commits intolatestfrom
AG-15850/tc10_fixes_gauges

Conversation

@olegat
Copy link
Contributor

@olegat olegat commented Feb 4, 2026

@olegat olegat marked this pull request as ready for review February 4, 2026 11:14
@olegat olegat requested a review from alantreadway as a code owner February 4, 2026 11:14
Comment on lines 737 to 744
for (const dataArray of [scaleData, nodeData]) {
for (const datum of dataArray) {
const x0 = datum.clipX0 ?? datum.x0;
const x1 = datum.clipX1 ?? datum.x1;
const y0 = datum.clipY0 ?? datum.y0;
const y1 = datum.clipY1 ?? datum.y1;
datum.midPoint = { x: (x0 + x1) / 2, y: (y0 + y1) / 2 };
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [P1] Midpoint uses clip bounds, not actual segment bounds

The new midpoint calculation prefers clipX0/clipX1 and clipY0/clipY1 when present. For segmented gauges these clip values are set to the full scale bounds, so the computed midpoint collapses to the centre of the whole gauge instead of the specific segment. This breaks active item positioning for segmented bars. Use the actual x0/x1/y0/y1 values for midpoint (or only fall back to clip when it reduces the bounds).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The clip preference is correct. Tested on segmented linear gauge.
https://github.com/user-attachments/assets/65ab1a5e-47b2-4418-ab68-37258a51b640

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

❌ Codex review complete; 1 issue found (P0: 0 | P1: 1 | P2: 0 | P3: 0)

View full review

AG-15850 TC10 Fix setState({active}) on gauges

PR: #6098
Author: olegat | Base: latest ← Head: AG-15850/tc10_fixes_gauges
Diff: 4 files changed, +32 -10

Summary

Adds midpoint data for gauge node/scale items and expands gauge datum lookup to include targets, aiming to make setState({active}) work reliably on gauges.

Findings

P0: 0 | P1: 1 | P2: 0 | P3: 0

1 inline comments posted.

Verdict

Assessment: incorrect
Confidence: 0.73

The midpoint computation for segmented linear gauges appears incorrect and will misplace active focus, undermining the purpose of the change.

Required Actions:

  • Adjust midpoint calculation for segmented gauges to use segment bounds (x0/x1/y0/y1) instead of full-scale clip bounds.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Snapshots automatically updated, please review before merge:

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Snapshots automatically updated, please review before merge:

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Snapshots automatically updated, please review before merge:

…es_gauges

Update test:e2e (shard 1) snapshots.
@olegat olegat requested a review from a team as a code owner February 4, 2026 12:22
Copy link
Member

@alantreadway alantreadway left a comment

Choose a reason for hiding this comment

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

LGTM

Conflicts:
  packages/ag-charts-website/e2e/gallery-examples.spec.ts-snapshots/gallery-customised-radial-gauge-chromium-linux.png
  (regenerated, but running e2e test)

  As mentioned in AG-15850, the keynav tooltip has moved a little bit, as
  side-effect of fixing the tooltip positioning for `initialState.active`
@olegat olegat merged commit e8f6e9c into latest Feb 5, 2026
36 checks passed
@olegat olegat deleted the AG-15850/tc10_fixes_gauges branch February 5, 2026 10:29
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.

2 participants