Skip to content

Redesign the frontend UI as a dark reference tool - #72

Merged
raphvallee merged 3 commits into
mainfrom
redesign-frontend-ui
Oct 22, 2026
Merged

raphvallee merged 3 commits into
mainfrom
redesign-frontend-ui

Conversation

@raphvallee

Copy link
Copy Markdown
Owner

Rebuilds every page of the frontend as a dark reference tool, and fixes several data-handling bugs found while reviewing it.

Design

Cool graphite surfaces separated by lightness rather than by borders and shadows, with one amber signal reserved strictly for "active" and "in production". Archivo for prose; JetBrains Mono only for measured values, where decimal alignment is the point.

Each level gets the list treatment its data actually calls for:

Page Data shape Treatment
Brands 398 marques dense index, sticky letter headings, A-Z spine tracking scroll
Models photo, name, years image rows with a right-aligned year column
Generations pure tabular data spec table
Trims photo, name photo grid
Trim ~70 measured fields headline figures, gallery, grouped spec sheet

The one deliberate flourish is the A-Z spine on the brands index. Everything else stays quiet.

Navigation

The header shows the whole drill-down path, so a page four levels deep is one click from any ancestor. The old build had no way back up at all. On narrow screens the path keeps its last two levels.

Bug fixes

  • power never holds horsepower. The backend matches labels containing "power" before "power per litre", so the field is named for one and carries the other. The UI now labels it from the value.
  • In-production models render as discontinued. They store an invalid end date, which the API sends as null. The old @if (item.endYear) treated that as truthy, so current cars showed NaN years under a red "discontinued" badge.
  • Header path links were wrong. They resolved relative to the current route, so the brand crumb pointed at /alfa_romeo-11 instead of /browse/alfa_romeo-11.
  • Item anchors had no href, making them unreachable by keyboard and unannounced as links. They are real routerLinks now.
  • .row reused on a <tr> turned the generations table row into a CSS grid and collapsed the name column to one word per line.
  • Grid containers used a gap over a tinted background, painting the short final row of each letter group as a solid block.
  • --faint measured 3.9:1, under the 4.5:1 needed for small text. All pages pass AA now.

Missing source values are stated rather than left blank, and the upstream ? paywall marker renders as "Locked on the source site".

Verification

Built clean, then walked all five pages at 1400px and at phone width in a real browser: no console errors, no contrast failures, no horizontal overflow, and the drill-down verified end to end.

Note for review

ApiService reads from a hardcoded fixture table via useFixtures, because auto-data.net blocks automated browsers and the backend does not currently start on this machine (TypeORM's PrimaryGeneratedColumn fails under bun's decorator transform, pre-existing and unrelated to this change). Flip useFixtures to false to read from HTTP; nothing else needs to change. Fixture artwork is inline SVG for the same blocking reason, so swap LOGO/plate() in fixtures.ts back to the real URLs to see it against live images.

I left backend/.idea/runConfigurations/All_Tests.xml untracked, as it is IDE-generated and unrelated.

Rebuilds all five pages of the brand to model to generation to trim
drill-down, and fixes several data-handling bugs found while reviewing it.

Design: cool graphite surfaces separated by lightness rather than by borders
and shadows, with a single amber signal reserved for "active" and "in
production". Archivo for prose, JetBrains Mono only for measured values,
where decimal alignment is the point. Each level gets the list treatment its
data actually calls for: a dense index for marques, image rows for models,
a table for generations, a photo grid for trims, and a spec sheet for a
trim's 70-odd measurements.

Navigation: the header now shows the whole drill-down path, so a page four
levels deep is one click from any ancestor. The old build had no way back up
at all. On narrow screens the path keeps its last two levels.

The brands index drops its logo cards. At index size a marque badge is too
small to identify and duplicates the name beside it, and 398 of them in
100px tiles needed an enormous scroll. The logo stays on the brand page,
where it is rendered large enough to do a job.

Bug fixes:

- power never holds horsepower. The backend matches labels containing
  "power" before "power per litre", so the field is named for one and
  carries the other. The UI labels it from the value.
- In-production models store an invalid end date, which the API sends as
  null. The old @if (item.endYear) treated that as truthy, so current cars
  rendered NaN years under a red "discontinued" badge.
- Header path links resolved relative to the current route, so the brand
  crumb pointed at /alfa_romeo-11 instead of /browse/alfa_romeo-11.
- Item anchors had no href, making them unreachable by keyboard and
  unannounced as links. They are real router links now.
- Reusing the global .row rule on a <tr> turned the generations table row
  into a CSS grid and collapsed the name column to one word per line.
- Grid containers used a gap over a tinted background, which painted the
  short final row of each letter group as a solid block.
- --faint measured 3.9:1 on the page background, under the 4.5:1 needed
  for small text. All pages now pass AA, verified in the browser.

Verified by building, then walking every page at 1400px and at phone width:
no console errors, no contrast failures, no horizontal overflow.

ApiService reads from a hardcoded fixture table via useFixtures, because
auto-data.net blocks this browser and the backend does not currently start.
Flip the flag to false to go back to HTTP; nothing else changes.
The redesign shipped with a fixture table and a `useFixtures` flag so the
pages could be built while the backend was unrunnable. The backend runs, so
the fixtures go: ApiService now only does HTTP, and fixtures.ts is deleted.

Removing them exposed what the fixture had been papering over.

- The API returns a generation without its model.brand, and a trim without
  its generation.model. The fixture attached them by hand, so a deep link
  looked fine there and would have lost breadcrumb levels here. Both
  endpoints now load the whole ancestor chain.
- The rebuilt breadcrumb paths used one-segment links, which resolve
  against the current route. A model link reached the brand route, because
  both read the first segment as an id. Every crumb now carries the
  segments down to its own level.
- The shared types claimed relations were always present and years were
  always Dates. The API genuinely sends `endYear: null` for a car still in
  production, and the fixture had to cast around it. Types now say so.
- A failed load left the heading reading "Loading" above the failure
  message, on all four pages.
- 28 of 42 trims have no scraped record. That page rendered as an empty
  spec column, which read as "this car has no specifications"; it now says
  the record has not been scraped and links to the source.

One data bug, visible only against real rows: the assisting-systems cell
ends with a `<br>`, so the scraper stored a value ending in ", ". Empty
entries are now dropped. Five tests cover the shapes, and the 12 already
stored rows are repaired by `bun run fix:assisting-systems`.

Verified against the running backend: all 5 pages at 1280 and 390, no
contrast failures, no overflow, real logos and photos. Backend 111 pass.
The old indicator was one grey rectangle per page, at a height picked by
eye. It said nothing about what was being waited for, and the height had
nothing to do with the content that replaced it, so data landing moved the
page.

Measured first, because the right indicator depends on how long a wait
actually is. Against the dev database a stored car answers in 8-100ms and an
unstored one in 4-34s, because the backend drives a headless browser to the
source site on demand. So:

- Under 150ms nothing is drawn. The old code flashed a skeleton for 8ms,
  which reads as a rendering fault rather than as progress.
- Past 2s the wait is named, with a clock.
- Past 3s it is named as what it is: a first look-up, fetching from the
  source site. The threshold sits above every cached read and below every
  observed scrape. The brand index opts out, since it only reads.

Placeholders are now drawn from the same primitives as the content they
stand in for, so nothing shifts: rows keep the 116x72 thumbnail column,
the generation table keeps its three columns, the trim page keeps its
figures strip, photo plate and spec tables, and the index keeps its letter
groups and the rail's height.

The trim page was the reason to measure. Its placeholder was two blocks of
arbitrary height in place of five headline figures, a photo and seventy
spec rows.

For assistive technology: aria-busy on the region being updated, a status
region that is always in the DOM so its text change is announced, and a
clock that is aria-hidden because it would otherwise interrupt the message
every second.

Reduced motion removes the sweep, which leaves a placeholder looking like
an empty panel, so it gains a border instead.

Verified: 5 pages at 1280 and 390 in both the loaded and loading states,
20 combinations, no contrast failures and no overflow. The phases were
driven at a held response time, and the scrape message was checked against
a real 34s scrape.
@raphvallee
raphvallee merged commit 4df7d15 into main Oct 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant