Give four- and five-column stat grids a phone breakpoint, and guard the rule tree-wide - #5822
Merged
Conversation
Eight grids hard-coded four to five columns with no breakpoint prefix, so at 360px each card got ~65px of outer width and its label wrapped to four or five lines. AgentList's stat bar was the worst case: it is the first thing on the Agents page, so the entire above-the-fold region was unreadable. Each grid now gets a narrow phone default and opts into the wide layout at a breakpoint. The two Big Five readouts stay five-across — they are a fixed five-trait bar chart whose cells are one bar plus a five-character label — but shrink the gap and the label below `sm`. `responsiveGridConventions.test.js` enforces the rule tree-wide rather than per component: a className carrying a bare `grid-cols-N` for N >= 4 must also carry a prefixed `...:grid-cols-*`. The allowlist holds the month grid (inherently seven days) and the two Big Five grids, and a companion assertion fails if an allowlisted file stops having the grid it was exempted for.
…nes (#5679) Local review pass. The guard's bare-column regex had no global flag, so a class string holding more than one unprefixed grid-cols was judged by its first token instead of its widest. The icon picker's phone default drops from four columns to three so the truncated icon name under each 20px tile has room, and the convention note now says what the guard actually enforces: a column breakpoint somewhere in the string, not a mobile default of three or fewer (thumbnail and heatmap grids are legitimately wider than that on a phone).
…#5679) A tree-scanning guard is unreachable through CI's import-graph selection — nothing imports the file that would violate it. The responsive-grid guard can only newly fail when a client/src .js/.jsx file changes, the same trigger the mounted-ref guard already rides, so it joins that structuralTestsFor branch rather than the always-run list.
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.
Summary
Eight Tailwind grids hard-coded four or five columns with no breakpoint prefix, so at a 360px viewport each cell got ~65px of outer width and its label wrapped to four or five lines.
AgentList's stat bar was the worst case — it is the first thing on the Agents page, so the entire above-the-fold region was unreadable.Each grid now gets a narrow phone default and opts into the wide layout at a breakpoint:
AgentList(alsop-6→p-4 md:p-6),DailyTrendsChart,SyncDetailDrawer,LearningTab's feedback summary, the Chief of Staff ASCII-mode stat bar, andIconPicker.The two Big Five readouts (
ImportTab,InterviewAnalysisCard) stay five-across — they are a fixed five-trait bar chart whose cells hold one bar plus a five-character label — but shrink the gap and the label belowsm.New tree-wide guard
client/src/responsiveGridConventions.test.js: a className carrying a baregrid-cols-Nfor N >= 4 must also carry a prefixed…:grid-cols-*, so the column count is conditional on width rather than frozen. It scans git-tracked non-test sources with comments masked, and holds a documented allowlist (the seven-day month grid, the two Big Five grids) plus a staleness check that fails if an exempt file stops having the grid it was exempted for.client/src/AGENTS.mdrecords the rule under "Mobile responsive", including the two traps found while writing it: a widened gap is not a column breakpoint, and a thumbnail/heatmap grid may stay four-plus wide on a phone but still needs a breakpoint so the desktop isn't stuck at the phone count.A tree-scanning guard is unreachable through CI's import-graph selection, so it joins the
structuralTestsForbranch inscripts/ci-test-plan.jsthat already fires on anyclient/src.js/.jsxchange, and is registered inscripts/repo-scan-guards.test.jswith that selector named.Why a tree-wide guard instead of the two per-component assertions the issue proposed
Neither
AgentList.test.jsxnorDailyTrendsChart.test.jsxexists, so the proposed tests would have meant standing up two heavily-mocked render suites to assert oneclassNameeach. The scan test strictly dominates them: it catches a revert in either file and every new offender anywhere in the tree, which is what the issue's acceptance criterion actually asks for. It carries its own bypass probe so a green run can't come from a detector that silently stopped matching.Test plan
cd client && npx vitest run src/responsiveGridConventions.test.js— 4 passing, including the probe asserting the detector flags a frozengrid-cols-4, is not fooled bygap-4 sm:gap-6, takes the widest bare token rather than the first, and ignores a class string quoted inside a comment.cd client && npx vitest run src/a11yConventions.test.js src/pages/ChiefOfStaff.test.jsx src/components/sync src/components/cos src/components/digital-twin— 54 files / 696 tests passing.cd server && npx vitest run ../scripts/agent-instructions-files.test.js lib/agentInstructionsFile.test.js ../scripts/repo-scan-guards.test.js ../scripts/ci-test-plan.test.js— theAGENTS.mdhygiene and CI-selection guards, passing.cd client && npm run lint— clean.client/src/index.css: no custom--breakpoint-*is declared, so onlysm/md/lg/xl/2xlare used (this repo has noxs), andtext-[10px]is already in ~314 files.Closes #5679