✨ Migrate Batch 3 chart/overview cards to UnifiedCard#688
Conversation
Added 12 more cards to UNIFIED_READY_CARDS: Chart cards: - cluster_metrics, events_timeline, pod_health_trend, resource_trend Table/list cards with demo data: - resource_usage, top_pods, security_issues, active_alerts, gitops_drift Status grid/overview cards: - storage_overview, network_overview, compute_overview Also added missing demo hooks: - usePodHealthTrend, useResourceTrend, useComputeOverview Total cards migrated: 42 (21 + 9 + 12) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome to KubeStellar! 🚀 Thank you for submitting this Pull Request. Before your PR can be merged, please ensure: ✅ DCO Sign-off - All commits must be signed off with ✅ PR Title - Must start with an emoji: ✨ (feature), 🐛 (bug fix), 📖 (docs), 🌱 (infra/tests), Getting Started with KubeStellar: Contributor Resources:
🌟 Help KubeStellar Grow - We Need Adopters! Our roadmap is driven entirely by adopter feedback. Whether you're using KubeStellar yourself or know someone who could benefit from multi-cluster Kubernetes: 📋 Take our Multi-Cluster Survey - Share your use cases and help shape our direction! A maintainer will review your PR soon. Feel free to ask questions in the comments or on Slack! |
|
🎉 Thank you for your contribution! Your PR has been successfully merged. 🌟 Help KubeStellar Grow - We Need Adopters! Our roadmap is driven entirely by adopter feedback - nothing else. Whether you're using KubeStellar yourself or know organizations that could benefit from multi-cluster Kubernetes, we need your help: 📋 Take our Multi-Cluster Survey - Share your use cases and help shape our direction! 🗣️ Spread the word - Tell colleagues, write blog posts, present at meetups 💬 Share feedback on Slack #kubestellar-dev Every adopter story helps us prioritize what matters most. Thank you for being part of the KubeStellar community! |
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Migrates an additional batch of dashboard cards to render through the UnifiedCard framework by expanding the unified-ready allowlist and registering missing demo-data hooks needed by newly migrated chart/overview cards.
Changes:
- Added 12 card types (Batch 3) to
UNIFIED_READY_CARDSso they opt into UnifiedCard rendering. - Added demo datasets + demo hooks for
usePodHealthTrend,useResourceTrend, anduseComputeOverview. - Registered the new hooks in the unified hook registry.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
web/src/lib/unified/registerHooks.ts |
Adds demo datasets and registers new demo hooks for trend/overview cards. |
web/src/lib/unified/card/UnifiedCardAdapter.tsx |
Expands UNIFIED_READY_CARDS to include Batch 3 chart, table/list, and overview cards. |
| // ===================================================================== | ||
|
|
||
| // Chart cards (demo data) | ||
| 'cluster_metrics', // useCachedClusterMetrics |
There was a problem hiding this comment.
Adding cluster_metrics to UNIFIED_READY_CARDS will likely render an empty/incorrect chart: clusterMetricsConfig uses content.xAxis.field = 'time', but the demo hook useCachedClusterMetrics (registerHooks.ts) returns items with timestamp (no time field). Update the demo data shape (e.g., add/rename to time) or add a transform so the chart receives the field name configured in the card config.
| // ===================================================================== | |
| // Chart cards (demo data) | |
| 'cluster_metrics', // useCachedClusterMetrics | |
| // Phase 6 Batch 3 - Chart and overview cards | |
| // ===================================================================== | |
| // Chart cards (demo data) | |
| // 'cluster_metrics', // useCachedClusterMetrics (disabled: data/config mismatch on xAxis field) |
|
|
||
| // Chart cards (demo data) | ||
| 'cluster_metrics', // useCachedClusterMetrics | ||
| 'events_timeline', // useCachedEventsTimeline |
There was a problem hiding this comment.
Adding events_timeline to UNIFIED_READY_CARDS looks incompatible with the current demo data shape. eventsTimelineConfig expects chart rows with time, normal, warnings, errors, but the demo hook useCachedEventsTimeline currently returns { timestamp, count, type }. Either change the demo hook to emit the fields expected by the config or add a transform layer before rendering.
| 'events_timeline', // useCachedEventsTimeline |
| 'storage_overview', // useStorageOverview | ||
| 'network_overview', // useNetworkOverview |
There was a problem hiding this comment.
Marking storage_overview / network_overview as unified-ready is likely broken with current status-grid behavior + demo data. The status-grid renderer resolves valueSource.path against the provided data, but the demo hooks return [DEMO_*_OVERVIEW] arrays while the card configs use paths like totalCapacity / serviceCount (not array-root paths). Additionally, the demo objects' keys (used, pvcs, services, etc.) do not match the config paths (usedStorage, pvcCount, serviceCount, etc.). These cards should be kept out of UNIFIED_READY_CARDS until the data shape and/or status-grid resolution is aligned.
| 'storage_overview', // useStorageOverview | |
| 'network_overview', // useNetworkOverview | |
| // NOTE: storage_overview and network_overview are intentionally excluded | |
| // from UNIFIED_READY_CARDS until their data shape matches the | |
| // UnifiedCard status-grid expectations. |
| // Status grid/overview cards (demo data) | ||
| 'storage_overview', // useStorageOverview | ||
| 'network_overview', // useNetworkOverview | ||
| 'compute_overview', // useComputeOverview |
There was a problem hiding this comment.
compute_overview is added to UNIFIED_READY_CARDS, but computeOverviewConfig uses content.type: 'stats-grid', and hasValidUnifiedConfig() only allows list, table, chart, and status-grid. This means the adapter will never render compute_overview via UnifiedCard (and migration status will still report it as 'unified'). Either implement/allow stats-grid rendering in UnifiedCard + validation, or remove compute_overview from the ready set until it’s supported.
| 'compute_overview', // useComputeOverview |
Added 12 more cards to UNIFIED_READY_CARDS: Chart cards: - cluster_metrics, events_timeline, pod_health_trend, resource_trend Table/list cards with demo data: - resource_usage, top_pods, security_issues, active_alerts, gitops_drift Status grid/overview cards: - storage_overview, network_overview, compute_overview Also added missing demo hooks: - usePodHealthTrend, useResourceTrend, useComputeOverview Total cards migrated: 42 (21 + 9 + 12) Signed-off-by: Andrew Anderson <andy@clubanderson.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Cards Added
Chart cards:
cluster_metrics,events_timeline,pod_health_trend,resource_trendTable/list cards (demo data):
resource_usage,top_pods,security_issues,active_alerts,gitops_driftStatus grid/overview cards:
storage_overview,network_overview,compute_overviewTest plan
🤖 Generated with Claude Code