Skip to content

fix(interaction): replay complete categorical brush selections - #8577

Merged
lxfu1 merged 1 commit into
antvis:v5from
dvd233:codex/fix-brush-selection-domains
Oct 15, 2026
Merged

lxfu1 merged 1 commit into
antvis:v5from
dvd233:codex/fix-brush-selection-domains

Conversation

@dvd233

@dvd233 dvd233 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor
Checklist
  • Regression tests are included
  • Commit message follows commit guidelines
  • npm test passes without local adaptation (Windows validation note below; upstream CI pending)
Description of change

Fixes #7292.

Replaying a categorical brush:highlight selection currently reads only its first two values. A single category such as ['H'] produces invalid mask coordinates, while ['H', 'I', 'J'] highlights only H and I. Brush events themselves emit the complete category list, so forwarding event.data.selection can lose the original selection.

Use the first and last domain values in abstractOf, preserving the existing band-width adjustment. This supports single and complete multi-category selections while retaining two-endpoint and continuous selections.

Add 12 scale tests and 7 Chart/SVG integration tests covering emitted-selection replay, finite mask geometry, point scales, and moving/resizing a restored brush. The integration tests dispatch scenegraph drag events; they are not browser mouse E2E tests.

Validation:

  • The unchanged regression tests produce 13 failures and 6 passes on the original source, and all 19 pass with the fix.
  • Full suite: 962 passed, 25 existing skips; all 968 existing test statuses match the baseline (943 passed, 25 skipped). No golden changes.
  • Full ESLint and Prettier checks, CJS/ESM/UMD builds and bundle-size checks pass. ESLint reports 24 warnings in unchanged files.

Windows validation note: both full runs use SVGO's supported js2svg.eol: 'lf' option through a local runtime transform to match the repository's LF SVG goldens. This does not change assertions, goldens, test selection or coverage, and is not included in the PR.

Prepared with AI assistance; the source change and regression evidence were reviewed before submission.

@hustcc

hustcc commented Oct 13, 2026

Copy link
Copy Markdown
Member

@dvd233 已经复现问题,并测试这个分支解决了这个问题吗?

@dvd233

dvd233 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

是的,提交前已用相同回归测试对比原源码和本分支:原来单个分类 ['H'] 会错误高亮全部 5 项,['H', 'I', 'J'] 只高亮 H/I;19 个新增用例在原源码上 13 失败、6 通过,本分支全部 19 通过。其中 7 个是实际 Chart/SVG 场景,覆盖选区事件回放、有限坐标以及恢复后移动/缩放;它们派发 scenegraph 拖动事件,不是浏览器鼠标 E2E。完整测试当时为 962 通过、25 个原有跳过,Windows 的本地 LF 序列化适配和验证范围已在 PR 正文注明。当前 head 与这份已验证提交一致。

@lxfu1
lxfu1 merged commit 8b2c4f6 into antvis:v5 Oct 15, 2026
3 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.

[Bug]: 触发单个元素的高亮时,高亮未生效

3 participants