{"slug": "stop-the-generic-ai-dashboard-a-checkable-ui-contract-for-data-heavy-interfaces", "title": "Stop the generic AI dashboard: a checkable UI contract for data-heavy interfaces", "summary": "A developer published a UI_RULES.md contract and a small Node checker for steering coding tools away from generic AI-generated dashboard chrome toward data-heavy interfaces. The contract restricts colors, fonts, radii and shadows to role-named tokens in a single tokens.css file, bans card stacks in place of tables, and requires right-aligned tabular numerals via a .numeric class. Running the checker on two fixtures, a compact ledger table passed while a \"welcome back to your insights\" panel failed with nine violations, including the gradient, glow, sparkline and empty state.", "body_md": "I asked a coding tool for a compact ledger table, with amounts that line up and a useful empty state. What I got back was a dark card, a purple-to-pink gradient, a glow, four KPI tiles, and a decorative sparkline with no data in it. The table, such as it was, had been turned into a stack of rounded row cards. The empty state said \"No data\".\n\nThat look is not a taste problem. It is a default. The models have seen a lot of marketing sites and generated dashboards, and they will keep emitting that chrome unless you give them a narrower contract, in the repo, that a script can also check.\n\nThis is the contract I use for data-heavy screens, plus a small Node checker. I ran the checker on two fixtures: a compact ledger table passed; a \"welcome back to your insights\" panel failed with nine violations, including the gradient, the glow, the sparkline, and the empty state.\n\nA paragraph in a chat window lasts one session. A `UI_RULES.md` file at the root of the frontend is still there when someone types \"add a status column.\" It should be short, specific, and boring.\n\nThe useful parts are not \"make it look premium.\" They are constraints:\n\n`tokens.css`. Do not invent a colour, a font, a radius or a shadow.` table`. Do not fake rows with a stack of cards.`.numeric` class: right aligned, with tabular numerals.\nPoint the tool at that file before it edits UI. Then check the result with a script, because the model will still try a gradient when it wants to be helpful.\n\nIf the only legal colours live in one file, a generator has less room to invent a palette. Name tokens by role, not by hue. A button does not use `--blue-600`. It uses `--accent-fill`.\n\n```\n:root {\n  --font: \"IBM Plex Sans\", \"Segoe UI\", \"Helvetica Neue\", sans-serif;\n  --font-mono: \"IBM Plex Mono\", ui-monospace, \"SFMono-Regular\", Menlo, monospace;\n  --text: #14161a;\n  --text-muted: #5b6270;\n  --surface: #ffffff;\n  --surface-raised: #f6f7f9;\n  --line: #e3e6eb;\n  --accent-fill: #2f5fe0;\n  --danger-fill: #c8352b;\n  --cell-pad: 8px 12px;\n  --row-height: 36px;\n  --radius: 6px;\n  --shadow: 0 1px 2px rgb(20 22 26 / 8%);\n}\n\n[data-density=\"compact\"] {\n  --row-height: 28px;\n  --cell-pad: 4px 8px;\n}\n```\n\nIBM Plex is here as an example of a typeface with tabular figures, with a system fallback so the page still works if the webfont is missing. If your product already has a font, put that on `--font` and do not let a tool introduce Inter as a second stack. Inter is not a bad typeface. It is just the one the models reach for when nobody has told them the product already chose.\n\nDensity is a token, not a restyle. People who work through hundreds of rows a day want a shorter row. Occasional users may want more air. A `data-density` attribute that only changes `--row-height` and `--cell-pad` covers both without two sets of components.\n\nAccent is for actions and focus. It is not a wash behind the page, and it is not a glow around a card. The legal shadow is short and neutral. If a panel needs to sit on the surface, a one-pixel `--line` border is usually enough.\n\nIn a ledger, a payments grid or a log, the numbers are the product. If a column of amounts jitters as the values change from 99 to 1,000, the table is harder to scan than it looks in a screenshot.\n\n```\n.data-table .numeric {\n  text-align: right;\n  font-variant-numeric: tabular-nums;\n  font-feature-settings: \"tnum\" 1;\n}\n```\n\nUse `.numeric` on amounts, counts, IDs and dates that must compare in a column. Right-align those cells; left-align labels and names. Keep the column header aligned with the cells, and keep the header visible while the body scrolls.\n\nThis is also a cheap test for slop. If the generated markup has no `.numeric` class, the tool did not build a table for work. It built a picture of a table.\n\nA data-heavy screen can have a panel, a filter row and a dense grid. It does not need a hero, a \"welcome back\", or four KPI cards that repeat totals the table already shows. It does not need a sparkline unless you have a series and a reason to plot it.\n\nUse `table`, `thead`, `th` and `td`. Row height comes from `--row-height`. Padding comes from `--cell-pad`. A sticky header is enough chrome.\n\nLoading should keep that layout. A skeleton row with the same column count and the same height is useful. A centred spinner that replaces the page is not: the screen jumps when data arrives, and the user cannot tell how large the view will be.\n\nMost of a data view's life is not the happy path. The contract therefore requires four states, and the markup has to mean them.\n\n```\n<div class=\"state\" data-state=\"empty\">\n  <strong>No posted EUR lines in November.</strong>\n  Clear the amount filter to see the rest of the month, or\n  <a class=\"action\" href=\"https://dev.to/lines/new\">add a line</a>.\n</div>\n\n<div class=\"state\" data-state=\"error\">\n  <strong>The ledger failed to load.</strong>\n  The list request returned 503. The rest of the page is still available.\n  <button class=\"retry\" type=\"button\">Retry</button>\n</div>\n```\n\nThe empty state says what is missing, in the language of the current filters, and offers one next action. \"No data\" is banned. The error stays on the view that failed, names the failure, and lets the user retry. A toast is not a substitute. The rest of the dashboard should keep working.\n\nRules in a markdown file are still suggestions. A small Node script, `check.mjs`, walks CSS and HTML and fails the build when the bans are broken. It has no dependencies. You run it on a path:\n\n```\nnode check.mjs src/ui\n```\n\nIt flags, among other things:\n\n`linear-gradient` or `box-shadow` that uses the usual generated purples (`#6366f1`, `#8b5cf6`, `#a855f7`, `#7c3aed`)` backdrop-filter` on panels`border-radius` of 16px or more, or `9999px` pills on layout, instead of `--radius`\n`font-family: Inter` in component CSS`.sparkline` with no `data-values`\n`tabular-nums` and `text-align: right`\nI ran it against three fixtures. The compact ledger table and its states exited 0. The gradient dashboard exited 1, with nine violations. A table that used `<table>` but not `.numeric` or tabular numerals exited 1, with those three typography errors. Neutral skeleton gradients that only use `--surface-raised` and `--line` are allowed; the checker looks for the banned hues, not for the word `linear-gradient`.\n\nThat last point matters. A loading row may shimmer. A marketing wash may not.\n\nPut the script next to `UI_RULES.md` and `tokens.css`, and run it in CI on the paths a tool is allowed to touch. When a generator still emits a glow, the failure is a file and a rule id, not a feeling.\n\n**Do not ban every gradient.** Skeleton rows and some charts need them. Ban the palette and the glow, and keep token-only neutrals.\n\n**Do not fight a font you already use.** If the product is already in Inter, Inter belongs in `--font`. The check is there to stop a second, unasked-for stack.\n\n**A linter cannot judge taste.** It will not tell you that a KPI tile is repeating the table, or that a chart has the wrong series. It will tell you the sparkline had no data, the empty state had no action, and the amounts were not tabular. That is the layer worth automating.\n\n**Keep the contract short.** If the markdown file becomes a design-system book, the model will skip it. The essay I already wrote about tokens, states and keyboard use can live elsewhere. The contract should stay a page of constraints.\n\n**Check the HTML the tool actually wrote.** A perfect `tokens.css` does not help if the screen is a pile of unclassed `div` s. The typography rules only fire when a table is present, which is why the \"row card\" fixture fails on the glow and the radius first.\n\nThe point is not to make every screen austere. It is to stop a coding tool from turning a working table into a poster. Give it tokens, a short contract, and a check that can fail. Then ask for the table again.\n\nI'm Aran Shayan, a software engineer at SOHA who builds data-heavy interfaces and the APIs behind them. More at [aranshayan.com](https://aranshayan.com).", "url": "https://wpnews.pro/news/stop-the-generic-ai-dashboard-a-checkable-ui-contract-for-data-heavy-interfaces", "canonical_source": "https://dev.to/aranshayan/stop-the-generic-ai-dashboard-a-checkable-ui-contract-for-data-heavy-interfaces-222n", "published_at": "2026-11-27 10:39:27+00:00", "updated_at": "2026-11-27 10:45:50.212562+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "generative-ai"], "entities": ["IBM Plex", "Inter", "Node"], "also_reported_by": [], "takeaway": "Put a short UI_RULES.md with role-named tokens in one tokens.css at the frontend root and run a script checker on generated markup; a compact ledger fixture passed while a gradient-and-KPI-card panel failed with nine violations.", "recommendation": {"advice": "Point coding agents at a repo-level UI_RULES.md with role-named tokens and a .numeric tabular-numeral rule, then run a script checker on the output to catch gradients, glows and card-stack tables.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/stop-the-generic-ai-dashboard-a-checkable-ui-contract-for-data-heavy-interfaces", "markdown": "https://wpnews.pro/news/stop-the-generic-ai-dashboard-a-checkable-ui-contract-for-data-heavy-interfaces.md", "text": "https://wpnews.pro/news/stop-the-generic-ai-dashboard-a-checkable-ui-contract-for-data-heavy-interfaces.txt", "jsonld": "https://wpnews.pro/news/stop-the-generic-ai-dashboard-a-checkable-ui-contract-for-data-heavy-interfaces.jsonld"}}