fix(analytics): 4 UX polish fixes — resolution time column, empty states, type badges, select styling
- CoverageHeatmap: add Avg Resolution column with inverse color thresholds (green <10 min, amber 10–20 min, red >20 min); updated colSpan to 7 - FlowPilotAnalyticsPage: show positive empty state when knowledge gaps list is empty instead of rendering nothing - FlowQualityTable: add tree_type badge next to flow name (Troubleshooting/Project/Maintenance with distinct colors) - FlowPilotAnalyticsPage: add [&>option] Tailwind classes to period select for improved dark-theme contrast in Chrome/Firefox Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,12 @@ interface FlowQualityTableProps {
|
||||
type SortColumn = 'name' | 'usage_count' | 'success_rate' | 'last_matched_at' | 'avg_confidence' | 'quality_score'
|
||||
type SortDir = 'asc' | 'desc'
|
||||
|
||||
const TYPE_LABELS: Record<string, { label: string; color: string }> = {
|
||||
troubleshooting: { label: 'Troubleshooting', color: 'text-primary' },
|
||||
procedural: { label: 'Project', color: 'text-amber-400' },
|
||||
maintenance: { label: 'Maintenance', color: 'text-blue-400' },
|
||||
}
|
||||
|
||||
function formatRelativeTime(dateStr: string | null): string {
|
||||
if (!dateStr) return 'Never'
|
||||
const diff = Date.now() - new Date(dateStr).getTime()
|
||||
@@ -215,6 +221,9 @@ function FlowRow({
|
||||
>
|
||||
{flow.name}
|
||||
</Link>
|
||||
<span className={cn('font-label text-[0.5rem] uppercase tracking-wider ml-2 shrink-0', TYPE_LABELS[flow.tree_type]?.color || 'text-muted-foreground')}>
|
||||
{TYPE_LABELS[flow.tree_type]?.label || flow.tree_type}
|
||||
</span>
|
||||
{needsAttention && (
|
||||
<span className="shrink-0 bg-amber-400/10 text-amber-400 font-label text-[0.625rem] px-1.5 py-0.5 rounded">
|
||||
Needs attention
|
||||
|
||||
Reference in New Issue
Block a user