Repository navigation
Conversation
The dashboard had grown to eight sections of near-identical visual
weight, and most of its numbers did not change what an operator does
next. On a FRESH INSTALL it rendered eight panels, six of them empty,
with a `text-5xl` zero as the largest element on the page — the first
screen a new operator ever sees, and it reads as a failed deployment
rather than a new one.
## Information architecture
Three bands, ordered act → context → reference:
1. NEEDS YOU — drafts, the scheduled queue, and searches that
returned nothing. Work items, above the fold.
2. REACH — views over 30d WITH a direction of travel, the daily
trend, and the articles that produced it.
3. REFERENCE — translation coverage (only when a locale is behind)
and the audit feed.
Promoted: "searched for, not found" out of the bottom half of a
"Search insights" card into band 1. It is the most directly actionable
list on the page — visitors asked for content in their own words and
got nothing — and it was below the fold.
## Metrics cut, and why
· Articles — printed TWICE (headline sub-line and its own tile),
and it is the denominator of published/drafts, not
a metric.
· Media Files — no decision follows from it on a dashboard.
· Users — same; it belongs on the users page, where it is.
· Published(5xl)— a stock, not a flow. It only moves when you move
it, so it cannot be news. Demoted to a tile.
Added: total views with % change vs the previous 30 days — the one
number an operator actually checks, previously absent entirely while
"Media Files: 0" got a tile. `viewsWithPrevious()` reports the previous
window as `null` rather than 0 when there is no data, so a first-month
install shows "no comparison yet" instead of a meaningless +100%.
## Shared primitives, not one-off styling
Four components in `$lib/components/admin`, ported from the design
language redblu-siloscale / redblu-autoscale / khaopad-telemetry
already share (PageShell's own comment records what happens when 45
pages each style themselves: five padding scales, six max-widths):
· MetricTile — tone colours the NUMBER, never the tile. Both
upstream implementations carry this comment: a
tinted card makes every tile shout at one volume,
which is the same as no emphasis at all. `null`
renders `—` + "no data yet", never 0 — "nobody
visited" and "not measured" are different facts.
· EmptyState — DASHED border, a bold line naming what appears here,
one sentence on how to make it appear. The dashed
edge is load-bearing: a solid border is the same
affordance as a populated card, which is exactly the
confusion that made a fresh install look broken.
· TrendChart — 30-day area chart. Three gridlines, no axis spine,
no tick marks; first/middle/last date labels only
(more collide at phone width).
· Sparkline — 14-day bars per top article. Zero days draw a
hairline at the baseline so a gap in publishing stays
visible instead of collapsing to nothing.
All inline SVG, no new dependencies. The admin runs under
`script-src 'self'`; a CDN chart library is a new script origin, and
this codebase already paid for underestimating that policy when the
admin webfont was silently blocked for weeks. Every stroke and fill is
a semantic token, so light/dark needs no second set of markup.
A fresh install now shows one instruction and one action.
## Gates
lint 0 errors · check 0 errors · test 1114/1114 (baseline, unchanged
— every design-system pin still passes) · build ok · contract-guard ok
css-inventory re-baselined. Six classes are no longer emitted, all
from markup this commit deletes: `text-5xl` (+ `--text-5xl`,
`--text-5xl--line-height`) was the giant published-count; and
`lg:col-span-1`, `xl:grid-cols-5`, `md:grid-cols-4`,
`2xl:grid-cols-3`, `2xl:grid-cols-8` were the six-tile counter row
and the 8-column grids. No classes added.
Verified on `wrangler dev --port 4214 --local` in light and dark, with
content and on an emptied database; no console errors, no horizontal
overflow at 390px.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This branch has not been deployed
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.
Closes #211 (dashboard phase 1 only — phases 2 and 3 stay open).
The dashboard had grown to eight sections of near-identical visual weight, and most of its numbers did not change what an operator does next. On a fresh install it rendered eight panels, six of them empty, with a
text-5xlzero as the largest element on the page — the first screen a new operator ever sees, and it read as a failed deployment rather than a new one.Information architecture
Three bands, ordered act → context → reference:
Promoted: "searched for, not found" out of the bottom half of a "Search insights" card into band 1. It is the most directly actionable list on the page — visitors asked for content in their own words and got nothing — and it was below the fold.
Metrics cut, and why
ArticlesMedia FilesUsersPublishedat 5xlAdded: total views with % change vs the previous 30 days — the one number an operator actually checks, previously absent entirely while
Media Files: 0got a tile.viewsWithPrevious()reports the previous window asnullrather than0when there is no data, so a first-month install shows "no comparison yet" instead of a meaningless +100%.Shared primitives, not one-off styling
Four components in
$lib/components/admin, ported from the design languageredblu-siloscale/redblu-autoscale/khaopad-telemetryalready share.PageShell's own comment records what happens when 45 pages each style themselves — five padding scales, six max-widths — so this changes the primitives rather than the page:MetricTile— tone colours the number, never the tile. Both upstream implementations carry this comment: a tinted card makes every tile shout at one volume, which is the same as no emphasis at all.nullrenders—+ "no data yet", never0— "nobody visited" and "not measured" are different facts.EmptyState— dashed border, a bold line naming what appears here, one sentence on how to make it appear. The dashed edge is load-bearing: a solid border is the same affordance as a populated card, which is exactly the confusion that made a fresh install look broken.TrendChart— 30-day area chart. Three gridlines, no axis spine, no tick marks; first/middle/last date labels only (more collide at phone width).Sparkline— 14-day bars per top article. Zero days draw a hairline at the baseline so a gap in publishing stays visible instead of collapsing to nothing.All inline SVG, no new dependencies. The admin runs under
script-src 'self'; a CDN chart library is a new script origin, and this codebase already paid for underestimating that policy when the admin webfont was silently blocked for weeks. Every stroke and fill is a semantic token, so light/dark needs no second set of markup.A fresh install now shows one instruction and one action.
Gates
pnpm run lintpnpm run checkpnpm testpnpm buildnode scripts/contract-guard.mjsnode scripts/css-inventory.mjsOn the test baseline: the baseline on
mainis 1114, measured before any change in this branch. This PR neither adds nor removes tests, and no pre-existing test was lost — all 78 files and 1114 tests pass, including every pin indesign-system.node.test.ts, unmodified.css-inventory re-baseline. Six classes are no longer emitted, all from markup this PR deletes; no classes added:
text-5xl(+ tokens--text-5xl,--text-5xl--line-height) — the giant published-count numberlg:col-span-1,xl:grid-cols-5,md:grid-cols-4,2xl:grid-cols-3,2xl:grid-cols-8— the six-tile counter row and the 8-column gridsVerification, and what it does not cover
Verified on
npx wrangler dev --port 4214 --localin light and dark mode, with seeded content and against an emptied database. No console errors; no horizontal overflow with content constrained to 390px.The four live deployments were not inspected.
test.drvakuum.com,www.bactrack.in.th,www.codustry.comandkhaopad-example.codustry.workers.devall sit behind a login wall, and the browser profile available was not authenticated to any of them — so there was nothing to inspect without signing in, and no credentials were entered. Evidence came from a locally seeded instance instead.That bounds what the "before" evidence proves: it covers layout, hierarchy, empty states and the shape of the metrics, all of which a local instance reproduces faithfully. It does not cover real-site data volumes, the shop-enabled vs shop-disabled contrast on live sites, or the specific behaviour reported in #200. Someone with access should sanity-check the new dashboard against a real deployment before this ships.
Scope
Dashboard only. The other 44 admin pages are untouched — phase 2 (19 data-table pages, which have the same empty-state problem) and phase 3 (form/editor pages) are deliberately deferred so the primitives get proven on one page before 44 more adopt them. The visitor-sources work on
feat/visitor-sources-v2has an obvious home as a "view all" from the REACH band; no analytics capture was built here.Unrelated finding filed separately as #212 (
pnpm run db:seedwrites a file that three migration-reading tests then load and fail on).Do not merge or deploy — for maintainer review.
🤖 Generated with Claude Code