import { MessageSquareWarning } from 'lucide-react'; import { ReportSection } from '../ReportSection'; import type { ReportFrictionSignals, ReportThrashingSignals } from '@renderer/types/sessionReport'; const frictionColor = (rate: number): string => { if (rate <= 0.1) return '#4ade80'; if (rate <= 0.25) return '#fbbf24'; return '#f87171'; }; interface FrictionSectionProps { data: ReportFrictionSignals; thrashing: ReportThrashingSignals; } export const FrictionSection = ({ data, thrashing }: FrictionSectionProps) => { return (
Friction Rate: {(data.frictionRate * 100).toFixed(1)}% {data.correctionCount} correction{data.correctionCount !== 1 ? 's' : ''}
{data.corrections.length > 0 && (
Corrections
{data.corrections.map((corr, idx) => (
{corr.keyword} {corr.preview}
))}
)} {(thrashing.bashNearDuplicates.length > 0 || thrashing.editReworkFiles.length > 0) && (
Thrashing Signals
{thrashing.bashNearDuplicates.length > 0 && (
Repeated Bash Commands
{thrashing.bashNearDuplicates.map((dup, idx) => (
{dup.count}x {dup.prefix}
))}
)} {thrashing.editReworkFiles.length > 0 && (
Reworked Files (3+ edits)
{thrashing.editReworkFiles.map((file, idx) => (
{file.editIndices.length}x {file.filePath}
))}
)}
)}
); };