diff --git a/BUILD-PLAN-issue-13.md b/BUILD-PLAN-issue-13.md new file mode 100644 index 0000000..08b1ceb --- /dev/null +++ b/BUILD-PLAN-issue-13.md @@ -0,0 +1,12 @@ +# BUILD-PLAN-issue-13.md — Modern CSS feature adoption scan + +**Card:** https://github.com/nujovich/mint-radar/issues/13 + +**Decision:** PLAN already defined 4 concrete code milestones (planned). Decision not required. + +## Milestones + +- [ ] Milestone 1 — Extend audit prompt in lib/prompts.mjs with STEP 14: modern CSS feature scan (detect @property, @layer, @container, @supports, nesting, color-mix, @scope, :has()), report presence/absence with adoption suggestions +- [ ] Milestone 2 — Add modernFeatures field to AuditReport type in lib/types.ts (Record) +- [ ] Milestone 3 — Wire modern features results in playground UI as "Modern CSS Adoption" section +- [ ] Milestone 4 — Add test fixture with modern and legacy CSS and tests in lib/**tests**/ diff --git a/components/AuditView.tsx b/components/AuditView.tsx index 2086793..8ab2b76 100644 --- a/components/AuditView.tsx +++ b/components/AuditView.tsx @@ -2,7 +2,10 @@ import { useState } from 'react' import type { AuditReport, ColorDecision, UserDecisions } from '@/lib/types' -import { collectLintGroups } from '@/lib/audit-summary.mjs' +import { + collectLintGroups, + collectModernFeatures, +} from '@/lib/audit-summary.mjs' interface Props { audit: AuditReport @@ -53,6 +56,8 @@ export default function AuditView({ audit, onResolve }: Props) { const motionDurations = audit.motion?.durations?.suggestedScale ?? {} const motionEasings = audit.motion?.easings?.suggestedScale ?? {} const lintGroups = collectLintGroups(audit) + const modernFeatures = collectModernFeatures(audit) + const adoptedFeatureCount = modernFeatures.filter((f) => f.used).length const chaosColor = audit.chaosScore <= 3 @@ -882,6 +887,87 @@ export default function AuditView({ audit, onResolve }: Props) { )} + {/* Modern CSS adoption */} + {modernFeatures.length > 0 && ( +
+ + Modern CSS Adoption — {adoptedFeatureCount} of{' '} + {modernFeatures.length} adopted + + +
+ {modernFeatures.map((feature) => ( +
+ +
+
+ + {feature.label} + + + {feature.used ? 'adopted' : 'not adopted'} + +
+ {!feature.used && feature.suggestion && ( +
+ {feature.suggestion} +
+ )} +
+
+ ))} +
+
+ )} + {/* CTA */}