011 fix discrete legend filter after update spec#4567
Open
xuefei1313 wants to merge 2 commits intodevelopfrom
Open
011 fix discrete legend filter after update spec#4567xuefei1313 wants to merge 2 commits intodevelopfrom
xuefei1313 wants to merge 2 commits intodevelopfrom
Conversation
Discrete legends with custom data callbacks stopped filtering after
`updateSpec(..., { reMake: false })`.
`BaseLegend.clear()` released the vrender legend component but kept
its stale instance reference. The next compile pass reused that dead
instance and skipped the event-binding path that forwards legend
clicks into VChart selection and data filtering.
Null the cached legend component during cleanup, add a focused
regression test for the callback-backed legend update path, and
record the issue spec/plan/tasks alongside the code change.
Constraint: Preserve `reMake: false` update path and discrete legend filtering semantics
Rejected: Force `reMake` for updated legends | broader rebuild cost and masks lifecycle bug
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: If legend cleanup changes, verify recompile recreates vrender components
Tested: jest __tests__/unit/core/vchart-event.test.ts --runInBand (packages/vchart)
Tested: npm run compile (packages/vchart)
Not-tested: Manual browser reproduction against the original issue sandbox
Related: #4566
Add the required Rush changefile for the discrete legend filtering fix so release automation can emit the patch note without manual changelog reconstruction later. Constraint: Submit a Rush change file with source changes in this repository Rejected: Fold into previous commit | fix commit already passed hooks intact Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep changefile comments aligned with the shipped bug-fix description Tested: Added JSON under common/changes/@visactor/vchart and staged it cleanly Not-tested: Release workflow generation from this changefile Related: #4566
Contributor
Author
SummaryThis looks like a solid, minimal fix for the regression in #4566. The root cause analysis makes sense: Nulling What looks good
Suggestions / potential follow-ups
Suggested manual verification
|
xile611
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
close #4566
🔗 Related PR link
🐞 Bugserver case id
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough