Skip to content

11 min read

EngineeringAdmin dashboards

Where AI-generated admin dashboards break in production

An AI assistant gets you 80% of an admin dashboard in an afternoon. Ten places the remaining 20% shows up: permissions, audit trails, server-side tables, validation, accessibility, i18n, migrations, error states, empty states and bundle size.

By the Colored Strategies team

An AI assistant will produce a credible admin dashboard in an afternoon. Routes, a sidebar, a data table, four charts, a settings page, a login screen. It runs, it looks right, and it demos well.

That is roughly 80% of the work, and it is the 80% that was never the expensive part. The remaining 20% is what turns a one-week project into a three-month one. It is not harder code. It is code that only becomes necessary once real users, real data volumes and a real org chart arrive, which is exactly when nobody wants to be rewriting foundations.

Here is where it breaks, in the order it usually breaks.

1. Permissions stop being a role string

Generated code checks a role where it needs one:

TSX
{user.role === "admin" && <DeleteInvoiceButton />}

This survives until the second week of real use, when the org chart shows up. A regional manager sees their region only. A deputy has the same rights as their manager but only while the manager is on leave. Support agents can read any account, but only for the duration of an open ticket. Finance can approve refunds up to a limit, above which it needs a second approver. Somebody is a contractor in one team and a lead in another.

None of that is a role. It is a decision about a subject, an action and a specific resource, and it has to be answerable in one place:

TypeScript
can(user, "delete", invoice);

Two properties matter, and generated code usually has neither.

First, the same function has to run on the server, in the route handler, for every mutation. Hiding a button is not authorization; it is a hint. If the check only exists in the component, the endpoint is open to anyone who reads your JavaScript bundle.

Second, the UI has to derive from the check rather than duplicate it, or you ship buttons that return 403 when clicked, which reads to users as a broken product rather than a denied action.

Retrofitting this is not a refactor of one file. It is every mutation path, every list query (row-level filtering is part of the permission model, not a separate concern), and every conditional in the UI.

2. The audit trail is not a log file

Sooner or later somebody asks: who changed this price on 4 March, what was it before, and were they acting as themselves?

Answering that needs a record with the actor, the action, the resource, the before and after values, the timestamp, and (the field people forget) who was being impersonated, because support staff work inside customer accounts. Console logs do not answer it. Neither does an updated_by column, which tells you the last person and nothing about the four changes before that.

Two implementation details decide whether this works:

  • The audit row is written in the same transaction as the change. Written afterwards, it silently diverges the first time a request fails between the two writes.
  • It captures a diff, not a message. "Invoice updated" is not an audit trail.

The reason to do this before launch is not compliance theatre. It is that mutation paths multiply fast, and adding an audit trail to forty existing write paths is strictly harder than adding it to the first one.

3. Table state belongs on the server

The generated data table fetches the collection and sorts, filters and paginates it in the browser with array methods. At 200 rows this is correct and fast. At 200,000 rows the request never finishes.

Server-side table state means, concretely:

  • Sorting, filtering and pagination are query parameters that get pushed into SQL. The set of sortable and filterable fields is a whitelist. Passing a user-supplied column name into an ORDER BY clause is an injection surface, and it is the default shape of generated code.
  • Deep pagination uses a cursor, not OFFSET. OFFSET 50000 makes the database walk 50,000 rows to discard them; page 1 is instant and page 500 times out.
  • Exact total counts are expensive. COUNT(*) over a filtered ten-million-row table is a scan. Either accept an estimate, or design a UI that does not need the number: “next page” instead of “page 47 of 3,912”.
  • The state lives in the URL. Filtered views get pasted into tickets and Slack. If filters live in React state, every one of those links opens an unfiltered table, and the browser back button leaves the view instead of undoing the filter.
Text
/orders?status=refunded&from=2026-01-01&sort=-created_at&cursor=b3JkZXI6OTE0Mg

There is a subtler failure too: client-side sorting uses JavaScript string comparison, the server uses the database collation. Sort a list of names containing Ö or ı and the two produce different orders. Users notice when the row they expected is not where it was.

4. Client validation is a convenience, not a rule

The generated form has a schema and inline errors, and posts to an endpoint that trusts what it receives.

The same schema has to run on the server, and its errors have to come back mapped to field names so the form can show them where they belong rather than as one banner at the top. Beyond shape validation, three rules can only exist server-side:

  • Uniqueness. Two admins submitting the same invoice number one second apart both pass client validation. The database constraint is the only real check, and its error needs translating into a field error rather than a 500.
  • Cross-record rules. “This discount cannot exceed the customer’s remaining credit” requires data the browser does not have.
  • Concurrent edits. Two people open the same record, both save, and the second write silently discards the first. The fix is small: send the version or updated_at the form was loaded with, return 409 if it moved, and show the user what changed. But it has to be designed in. Admin tools are exactly where this happens, because multiple staff work the same queue.

5. Keyboard and screen reader support is a rewrite if deferred

Admin tools are used for eight hours a day by people who learn the shortcuts. Keyboard support is a throughput feature before it is a compliance one, and it is also the thing procurement asks about, since enterprise buyers increasingly want conformance against EN 301 549 or a VPAT.

Generated dashboards get semantics roughly right for buttons and links, and roughly wrong for everything composite:

  • Dialogs that do not move focus into themselves on open, do not return focus to the trigger on close, do not trap Tab, and do not close on Escape.
  • Custom selects and comboboxes built from div elements, with no aria-activedescendant, no aria-expanded, and arrow keys that do nothing.
  • Data grids where every cell is tabbable, so reaching the pagination control below the table takes 400 presses. Grids need roving tabindex: one tab stop, arrow keys inside.
  • Toasts rendered without a live region. The save succeeded, and a screen reader user has no way to know.
  • Destructive confirmations that are not role="alertdialog", so nothing is announced.
  • Focus styles removed for aesthetics, which makes keyboard use impossible rather than merely awkward.

Each of those is a component rewrite, not a class name. Doing it once in a shared component set costs a fraction of doing it later across every screen that grew its own dropdown.

6. Localisation is not string extraction

Wrapping strings in t() is the visible part and the easy part.

Plurals do not work with a count check. Polish has three plural forms, Arabic has six, Japanese has one. count === 1 ? "item" : "items" is correct in English and wrong elsewhere; the ICU plural rules exist for this reason.

Concatenation breaks everywhere. t("deleted") + " " + count + " " + t("orders") assumes English word order. The whole sentence has to be one interpolated message, including sentences with markup inside them.

Dates, numbers and currency are locale data, not formatting preferences. Intl handles it; hand-rolled dd/mm/yyyy does not, and 1.234,56 versus 1,234.56 is a support ticket about a wrong invoice.

Right-to-left is a layout property, not a translation. Every margin-left, padding-right, text-align: left and left: 0 has to become its logical equivalent: margin-inline-start, padding-inline-end, text-align: start, inset-inline-start. Icons that mean direction flip; icons that depict an object do not. Charts and progress bars flip; numbers, code and phone numbers stay left-to-right. Tables flip column order. This is mechanical, and it is mechanical across every file you have written, which is why doing it after the fact takes weeks.

7. The schema changes after launch, and the frontend is deployed separately

Generated code assumes today's schema is final. Production schemas change monthly, and during a rollout the browser is running the previous build against the new API.

That constrains changes more than teams expect: additive first, remove later (expand-contract), no renaming a field in one deploy, no repurposing an existing column, and backfills that run in batches rather than one statement that locks the table for nine minutes. Enums grow, and the frontend needs a defined behaviour for a status it has never seen, and rendering a blank cell is not it.

8. Failure states, one per status code

A generated dashboard has two states for a request: it worked, or a red banner says “Something went wrong”. Production needs the failures distinguished, because they call for different user actions:

  • 401: session expired. Re-authenticate, then return to the page they were on.
  • 403: not permitted, and who to ask for access.
  • 404: the record is gone, with a way back to the list.
  • 409: somebody else changed this, with what changed.
  • 422: field-level errors, shown on the fields.
  • 429: rate limited, with the retry window.
  • 500: a retry, plus a reference id.

That reference id is the difference between a support ticket that can be traced and one that says “it broke”. Log the id server-side with the request, show it to the user, and support can find the exact request.

Structurally, errors also have to be contained. One widget throwing must not blank the page. That means an error boundary per region: the sidebar survives, the chart shows its own failure with a retry, the rest of the page keeps working. Without boundaries, a single undefined property in a rarely-used card takes down the whole screen, and the user sees white.

9. Every view has five states, and demos only show one

For each screen: loading, empty because it is new, empty because the filters exclude everything, partially failed, and error. Generated code ships the success state and a spinner.

The two empty states are not the same view. “No orders yet, here is how to create one” is onboarding, and it is the first screen every new customer sees. “No orders match these filters, clear filters” is a dead end that needs a way out. Showing the first message to someone who has 40,000 orders and an over-narrow date range is actively confusing.

Partial failure is the one that gets skipped entirely. A dashboard with six widgets pulling six endpoints will, eventually, have one of them fail. Each widget needs its own loading and error state, or the whole page waits for the slowest call and dies with the first failure.

And loading states need to hold layout. A spinner that is replaced by a 400px table pushes the page around; a skeleton at the final dimensions does not. That is a Cumulative Layout Shift problem, but mostly it is a “the button moved as I clicked it” problem.

10. Bundle size at 200 routes

A generated dashboard has 30 routes and imports freely. Real internal tools reach 200+, and the imports compound:

  • Barrel imports of icon libraries. import { Save } from "some-icons" can pull the whole set into the graph unless the package and the bundler both cooperate on tree shaking.
  • Date library locales. Every locale of the library, bundled, because the import was the default one.
  • Charting libraries at 300-500 kB, loaded on the login page because a shared layout imports the dashboard component.
  • Grids and editors: a rich text editor and a spreadsheet grid on the same route, neither lazy.

The fix is unremarkable: route-level code splitting, lazy imports for heavy components, and a size budget checked in CI so a regression is a failed build rather than a quarterly discovery. What makes it expensive later is that by then the import graph is tangled enough that splitting it means moving files.

What this actually costs

None of these ten items is difficult in isolation. A competent engineer solves any one of them in a day or two. The problem is that all ten are cross-cutting: each one touches every screen, every mutation and every component you have already written. Sequenced first, they are architecture. Sequenced last, they are ten simultaneous refactors of the same files, usually under a deadline that assumed the demo was nearly done.

This is the reason a dashboard is 80% finished in an afternoon and 100% finished a quarter later.

It is also why we build the templates the way we do: permissions structure, real loading and empty and error states, keyboard-navigable components, RTL layout, and localisation wired through rather than bolted on. Not because a template can make those decisions for your product (it cannot), but because starting from code that has the shape already is a different job from adding it to code that does not.

If a template gets you there, take a preview through the four of them. If the last 20% is the whole problem, that is the other half of what we do.

Hit something like this in your own product?

Senior designers and engineers, around twenty years each. We take on admin systems, distributed applications and platforms that have to stay up under load.