feat(analytics): add tabbed layout with coverage heatmap
Add Phase 5 types (CoverageResponse, FlowQualityResponse, EnhancedPsaMetrics) and API methods. Refactor FlowPilotAnalyticsPage with tab bar (Overview, Coverage, Flow Quality, PSA) with lazy data loading. Create CoverageHeatmap component with color-coded resolution/escalation/guided rate cells. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import apiClient from './client'
|
||||
import type { FlowPilotDashboard, KnowledgeGapReport } from '@/types/flowpilot-analytics'
|
||||
import type { FlowPilotDashboard, KnowledgeGapReport, CoverageResponse, FlowQualityResponse, EnhancedPsaMetrics } from '@/types/flowpilot-analytics'
|
||||
|
||||
export const flowpilotAnalyticsApi = {
|
||||
async getDashboard(period: string = '30d'): Promise<FlowPilotDashboard> {
|
||||
@@ -15,6 +15,27 @@ export const flowpilotAnalyticsApi = {
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
async getCoverage(period: string = '30d'): Promise<CoverageResponse> {
|
||||
const response = await apiClient.get<CoverageResponse>('/analytics/flowpilot/coverage', {
|
||||
params: { period },
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
async getFlowQuality(period: string = '30d', sort: string = 'quality'): Promise<FlowQualityResponse> {
|
||||
const response = await apiClient.get<FlowQualityResponse>('/analytics/flowpilot/flow-quality', {
|
||||
params: { period, sort },
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
async getPsaMetrics(period: string = '30d'): Promise<EnhancedPsaMetrics> {
|
||||
const response = await apiClient.get<EnhancedPsaMetrics>('/analytics/flowpilot/psa-metrics', {
|
||||
params: { period },
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
}
|
||||
|
||||
export default flowpilotAnalyticsApi
|
||||
|
||||
Reference in New Issue
Block a user