Skip to content

008 fix size legend handler text#4525

Merged
xuefei1313 merged 3 commits intodevelopfrom
008-fix-size-legend-handler-text
Mar 23, 2026
Merged

008 fix size legend handler text#4525
xuefei1313 merged 3 commits intodevelopfrom
008-fix-size-legend-handler-text

Conversation

@xuefei1313
Copy link
Copy Markdown
Contributor

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Refactoring
  • Update dependency
  • Code style optimization
  • Test Case
  • Branch merge
  • Release
  • Site / documentation update
  • Demo update
  • Workflow
  • Other (about what?)

🔗 Related issue link

🔗 Related PR link

🐞 Bugserver case id

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

copilot:summary

🔍 Walkthrough

copilot:walkthrough

@xile611 xile611 requested a review from Copilot March 23, 2026 09:03
@xuefei1313 xuefei1313 merged commit cef87ad into develop Mar 23, 2026
10 of 12 checks passed
@xuefei1313 xuefei1313 deleted the 008-fix-size-legend-handler-text branch March 23, 2026 09:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses VChart issue #4489 by enabling function-based handlerText.style for continuous (size/color) legends and ensuring the style callback survives the spec → vrender attribute transformation path, with a focused regression test. It also bumps vrender-related dependencies to ~1.0.42 across the monorepo packages.

Changes:

  • Extend continuous legend typings so handlerText.style can be a callback with (value, position, context) => style.
  • Update continuous legend attribute building to transform static styles and wrap callback styles with transformToGraphic.
  • Add a Jest unit regression test for static vs callback handlerText.style, and update vrender dependency versions/lockfile.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/story-player/package.json Bumps vrender dependencies to ~1.0.42 for the story-player tool.
specs/008-fix-size-legend-handler-text/tasks.md Adds task breakdown for the bugfix work and verification checklist.
specs/008-fix-size-legend-handler-text/spec.md Defines requirements/acceptance scenarios for handler text behavior and callback styling.
specs/008-fix-size-legend-handler-text/research.md Records design decisions (type/contract gap, reuse existing transform path, add unit regression).
specs/008-fix-size-legend-handler-text/quickstart.md Provides manual + automated verification steps for the fix.
specs/008-fix-size-legend-handler-text/plan.md Implementation plan for adding callback typing + regression coverage.
specs/008-fix-size-legend-handler-text/data-model.md Documents entities/flow for handler text config → runtime attributes.
specs/008-fix-size-legend-handler-text/contracts/handler-text-style.md Describes the public contract for handlerText.style static vs callback.
specs/008-fix-size-legend-handler-text/checklists/requirements.md Spec quality checklist for the feature write-up.
skills/vchart-development-assistant/references/type-details/ILegendSpec-Type-Definition.md Updates reference docs to show callback-based handlerText.style usage/signature.
packages/vchart/src/component/legend/continuous/util.ts Wraps handlerText.style callbacks so returned values are transformed with transformToGraphic.
packages/vchart/src/component/legend/continuous/interface.ts Adds handlerText.style callback type + context typing for continuous legend specs.
packages/vchart/package.json Bumps vrender dependencies to ~1.0.42 for core package.
packages/vchart/tests/unit/component/legend/continuous-legend.test.ts Adds regression tests for static and callback handler text style transformation.
packages/vchart-extension/package.json Bumps vrender dependencies to ~1.0.42.
packages/react-vchart/package.json Bumps vrender dependencies to ~1.0.42.
packages/openinula-vchart/package.json Bumps vrender dependencies to ~1.0.42.
docs/package.json Bumps vrender dependencies to ~1.0.42 for docs site.
common/config/rush/pnpm-lock.yaml Updates lockfile to reflect vrender 1.0.42 and updated transitive resolutions.
common/changes/@visactor/vchart/008-fix-size-legend-handler-text_2026-03-23-03-45.json Adds a change record describing the update.
Files not reviewed (1)
  • common/config/rush/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,70 @@
# Implementation Plan: Size Legend Handler Text Layout

**Branch**: `008-fix-size-legend-handler-text` | **Date**: 2026-03-20 | **Spec**: [/data00/home/lixuefei.1313/github/VChart/specs/008-fix-size-legend-handler-text/spec.md](/data00/home/lixuefei.1313/github/VChart/specs/008-fix-size-legend-handler-text/spec.md)
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The markdown link to the spec uses an absolute local filesystem path (/data00/home/...). This will be broken for other contributors and on GitHub. Please replace it with a repository-relative link (e.g. ./spec.md or /specs/008-fix-size-legend-handler-text/spec.md).

Suggested change
**Branch**: `008-fix-size-legend-handler-text` | **Date**: 2026-03-20 | **Spec**: [/data00/home/lixuefei.1313/github/VChart/specs/008-fix-size-legend-handler-text/spec.md](/data00/home/lixuefei.1313/github/VChart/specs/008-fix-size-legend-handler-text/spec.md)
**Branch**: `008-fix-size-legend-handler-text` | **Date**: 2026-03-20 | **Spec**: [./spec.md](./spec.md)

Copilot uses AI. Check for mistakes.

**Purpose**: Validate specification completeness and quality before proceeding to planning
**Created**: 2026-03-20
**Feature**: [/data00/home/lixuefei.1313/github/VChart/specs/008-fix-size-legend-handler-text/spec.md](/data00/home/lixuefei.1313/github/VChart/specs/008-fix-size-legend-handler-text/spec.md)
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

This checklist links to the spec using an absolute local filesystem path (/data00/home/...). That link won't work for other developers or in the GitHub UI. Please switch to a repo-relative link to the spec file.

Suggested change
**Feature**: [/data00/home/lixuefei.1313/github/VChart/specs/008-fix-size-legend-handler-text/spec.md](/data00/home/lixuefei.1313/github/VChart/specs/008-fix-size-legend-handler-text/spec.md)
**Feature**: [specs/008-fix-size-legend-handler-text/spec.md](../spec.md)

Copilot uses AI. Check for mistakes.
Comment on lines +65 to +76
- [ ] T007 Run the focused Jest regression for continuous legend handler text support
- [x] T008 Mark completed tasks in specs/008-fix-size-legend-handler-text/tasks.md after implementation and verification

---

## Dependencies & Execution Order

- T001 -> T002 -> T003/T004/T005
- T003 should be written before or alongside T004/T005 and must validate the user-facing behavior
- T006 depends on implementation decisions from T004/T005
- T007 depends on T003-T006
- T008 depends on all prior tasks completing
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

Task tracking looks internally inconsistent: T008 is marked complete but the dependency section says T008 depends on all prior tasks, and T007 (run Jest regression) is still unchecked. Either mark T007 as done (if it was run) or adjust/check off T008 accordingly so the task list reflects actual verification status.

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +54
### Functional Requirements

- **FR-001**: The system MUST render size legend handler text in a way that remains readable while the handler is dragged across the legend range.
- **FR-002**: The system MUST prevent handler text from visually overlapping adjacent size legend content in normal dragging scenarios, including when the handler is at either range boundary.
- **FR-003**: Chart authors MUST be able to provide function-based values for size legend `handlerText` style settings.
- **FR-004**: The system MUST evaluate function-based `handlerText` style values against the current legend context whenever the handler text is rendered or updated.
- **FR-005**: The system MUST continue to support existing static `handlerText` style values without requiring configuration changes from current users.
- **FR-006**: The system MUST ignore unsupported or missing dynamic style fields gracefully and continue rendering the handler text.

Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The functional requirements (FR-001/FR-002) state that the system MUST prevent handler text overlap during dragging, but the implementation in this PR only adds callback-style support/passthrough (no overlap-avoidance layout logic). Please adjust the requirements/success criteria wording to match the actual behavior being delivered (e.g., provide a supported callback hook that allows authors to avoid overlap), or expand the implementation to meet the stated MUST-level guarantees.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants