From c8fdc28b852d0093bcca1cf8d82f308fba8acd8e Mon Sep 17 00:00:00 2001 From: Quinn Ftw Date: Mon, 29 Dec 2025 04:02:43 -0800 Subject: [PATCH] feat(service-registry): update E2E tests and add migration docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit E2E test updates: - Update page objects (DashboardPage, ServiceCardPage, etc.) - Fix test selectors for card, list, smoke, and toolbar specs - Add preview mode config to vite.config.ts Add migration documentation: - MIGRATION_SUMMARY.md: Overview of @ui component migration - COMPONENT_MIGRATION_DIFF.md: Detailed component analysis - README_MIGRATION.md: Migration instructions - VISUAL_COMPARISON.md: Visual comparison guide πŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../COMPONENT_MIGRATION_DIFF.md | 508 ++++++++++++++++++ .../service-registry/MIGRATION_SUMMARY.md | 208 +++++++ features/service-registry/README_MIGRATION.md | 342 ++++++++++++ .../service-registry/VISUAL_COMPARISON.md | 234 ++++++++ .../frontend/e2e/pages/DashboardPage.ts | 43 +- .../frontend/e2e/pages/ServiceCardPage.ts | 131 ++--- .../frontend/e2e/pages/ServiceListPage.ts | 154 +++--- .../frontend/e2e/pages/ToolbarPage.ts | 23 +- .../frontend/e2e/tests/card/card.spec.ts | 30 +- .../frontend/e2e/tests/list/list.spec.ts | 90 +--- .../frontend/e2e/tests/smoke/smoke.spec.ts | 4 +- .../e2e/tests/toolbar/toolbar.spec.ts | 33 +- .../service-registry/frontend/vite.config.ts | 4 + 13 files changed, 1498 insertions(+), 306 deletions(-) create mode 100644 features/service-registry/COMPONENT_MIGRATION_DIFF.md create mode 100644 features/service-registry/MIGRATION_SUMMARY.md create mode 100644 features/service-registry/README_MIGRATION.md create mode 100644 features/service-registry/VISUAL_COMPARISON.md diff --git a/features/service-registry/COMPONENT_MIGRATION_DIFF.md b/features/service-registry/COMPONENT_MIGRATION_DIFF.md new file mode 100644 index 000000000..732a2f1fc --- /dev/null +++ b/features/service-registry/COMPONENT_MIGRATION_DIFF.md @@ -0,0 +1,508 @@ +# Service Registry β†’ @ui Component Migration Analysis + +**Date**: 2025-12-28 +**Purpose**: Detailed comparison of service-registry custom components vs @ui equivalents + +--- + +## 1. StatCard vs MetricCard + +### Current Implementation (StatCard) +**Location**: `/codebase/features/service-registry/frontend/src/components/styles/Dashboard.styles.ts` + +**Props:** +```typescript +interface StatCardProps { + $variant?: 'default' | 'success' | 'error' | 'warning'; + $isActive?: boolean; + onClick?: () => void; + children: React.ReactNode; +} +``` + +**Key Features:** +- **Interactive button element** - Clickable for filtering +- **Active state styling** - Border color, background tint, box-shadow when `$isActive` +- **Hover effects** - Translate + shadow on hover (when not active) +- **Variant-based colors** - Maps variant to theme color (primary/success/error/warning) +- **Layout** - Flexbox column, children expected to be StatValue + StatLabel + StatSubtext + +**Usage Pattern:** +```tsx + toggleStatusFilter('healthy')} +> + 42 + Healthy + +``` + +--- + +### @ui Equivalent (MetricCard) +**Location**: `@transquinnftw/ui-analytics/src/MetricCard.tsx` + +**Props:** +```typescript +interface MetricCardProps { + label: string; + value: string | number; + change?: number; + trend?: 'up' | 'down' | 'neutral'; + format?: NumberFormat; + sparkline?: number[]; + icon?: React.ReactNode; + variant?: 'default' | 'primary' | 'success' | 'warning' | 'error'; +} +``` + +**Key Features:** +- **Static div element** - Not interactive by default +- **Border-left accent** - 4px left border for non-default variants +- **Change/trend display** - Built-in percentage change with arrows +- **Sparkline support** - Background sparkline visualization +- **Icon support** - Optional icon in header +- **Value formatting** - Built-in formatValue utility + +**Usage Pattern:** +```tsx + +``` + +--- + +### Key Differences + +| Aspect | StatCard (Current) | MetricCard (@ui) | Migration Impact | +|--------|-------------------|------------------|------------------| +| **Interactivity** | `