Skip to content

feat(templateManager): add replaceTemplateLine function and unit tests - #186

Merged
Aarebecca merged 2 commits into
antvis:mainfrom
taosin:code-0.2.12.-1
Jan 27, 2026
Merged

Aarebecca merged 2 commits into
antvis:mainfrom
taosin:code-0.2.12.-1

Conversation

@taosin

@taosin taosin commented Jan 26, 2026

Copy link
Copy Markdown
Contributor
  • Implemented replaceTemplateLine function to manage template and infographic lines in syntax text, ensuring valid output and preserving indentation.
  • Added comprehensive unit tests for replaceTemplateLine to cover various scenarios, including empty inputs, template updates, and indentation preservation.
  • Refactored EditorPanel to utilize the new templateManager for template line replacements.
- Implemented replaceTemplateLine function to manage template and infographic lines in syntax text, ensuring valid output and preserving indentation.
- Added comprehensive unit tests for replaceTemplateLine to cover various scenarios, including empty inputs, template updates, and indentation preservation.
- Refactored EditorPanel to utilize the new templateManager for template line replacements.
@Aarebecca

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new replaceTemplateLine function in its own templateManager.ts file, along with comprehensive unit tests. The EditorPanel component is then refactored to use this new centralized function. The implementation is functionally correct and well-tested. My main feedback is to refactor the replaceTemplateLine function to remove some code duplication, which will improve its readability and maintainability. Overall, this is a good refactoring that improves code organization.

@Aarebecca

Copy link
Copy Markdown
Contributor

@taosin This helps a ton. 🎁

@Aarebecca
Aarebecca merged commit ed4224a into antvis:main Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants