feat(mint): add layout health check to CSS audit prompt - #109
Draft
nujovich wants to merge 5 commits into
Draft
Conversation
Owner
Author
|
BUILD 2026-08-20: All milestones complete. Ready for review when you are. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Card: https://github.com/nujovich/mint-radar/issues/14
What: Adds a new "LAYOUT HEALTH" step (STEP 14) to the CSS audit prompt in
lib/prompts.mjs. The step detects two layout anti-patterns: nested grid containers that re-declare their own tracks instead of using subgrid, and flex items with a fixed flex-basis that risks overflowing a nowrap container. Results are emitted as a newlayoutWarningsarray withpattern,element,severity, andsuggestionfields.Why: Mint already audits colors, fonts, spacing, motion, accessibility, and overflow safety, but has no detection of grid-subgrid misuse or flex-basis overflow risk. These anti-patterns are statically detectable and produce misaligned gutters and clipped content. Surfacing them closes the gap between Mint's semantic audit and the CSS layout pain points catalogued by Patrick Brosset.
Milestones
lib/prompts.mjswith STEP 14 (LAYOUT HEALTH): nested grid without subgrid + flex overflow risk, plus thelayoutWarningsfield in the output examplelayoutWarningsfield to AuditReport type inlib/types.tslib/__tests__/Milestone 3 detail
Wired
layoutWarningsinto the playground UI as a "Layout health" lint group:lib/audit-summary.mjs— added alayoutWarningsentry toLINT_CATEGORIES(shortLabellayout health, labelLayout health), socollectLintGroupssurfaces layout warnings in the "Layout linting" section andformatLintSummaryincludes the count in the CLI summary line.components/AuditView.tsx— extended theLintIssueinterface withelementandsuggestion(both optional) and updated the renderer to fall back toissue.elementfor the code line andissue.reason || issue.suggestionfor the description, matching theLayoutWarningshape (pattern/element/severity/suggestion).lib/__tests__/audit-summary.test.mjs— added tests for the layout health count informatLintSummaryand thelayoutWarningsgroup incollectLintGroups(label + rawelement/suggestionpreservation).How to test:
npm test