Skip to content

Conversation

@quangtuanitmo18
Copy link
Contributor

@quangtuanitmo18 quangtuanitmo18 commented Dec 12, 2025

refactor(components): migrate Chart components to Vue 3 Composition API - script setup

Goal: decouple chart components from Hawk so they can be moved into CodeX UI and reused across packages (e.g., NoteX and Hawk Admin).

Changes:

  • Chart.vue: converted to <script setup> with Composition API
  • ChartLine.vue: converted to <script setup>
  • Extracted chartColors constant to src/constants/charts.ts
  • Moved ChartLineColors interface to src/types/chart.ts

Copy link

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 refactors the Chart and ChartLine Vue components from Options API to Composition API using <script setup> syntax, improving code organization and maintainability.

  • Converted Chart.vue and ChartLine.vue to use <script setup> with Composition API
  • Extracted ChartLineColors interface to shared types file (src/types/chart.ts)
  • Created new constants file (src/constants/charts.ts) for chartColors array

Reviewed changes

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

File Description
src/types/chart.ts Added ChartLineColors interface definition with comprehensive documentation for color gradient properties
src/constants/charts.ts New file containing chartColors constant array with color configurations for chart lines
src/components/events/ChartLine.vue Migrated from Options API to Composition API with script setup, converting props, data, and computed properties
src/components/events/Chart.vue Migrated from Options API to Composition API with script setup, converting props, lifecycle hooks, methods, and computed properties to their Composition API equivalents

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

@quangtuanitmo18 quangtuanitmo18 force-pushed the refactor/vue3-script-setup-migration branch from beb0d81 to e048818 Compare December 13, 2025 12:41
@quangtuanitmo18 quangtuanitmo18 force-pushed the refactor/vue3-script-setup-migration branch from e048818 to eecb45d Compare December 13, 2025 12:43
@quangtuanitmo18 quangtuanitmo18 merged commit 19b8df8 into master Dec 16, 2025
2 checks passed
@quangtuanitmo18 quangtuanitmo18 deleted the refactor/vue3-script-setup-migration branch December 16, 2025 20:50
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