Skip to content

feat(web): rework KB detail page + fix ship images 404ing in browser#165

Open
ntatschner wants to merge 2 commits into
nextfrom
feat/kb-detail-rework
Open

feat(web): rework KB detail page + fix ship images 404ing in browser#165
ntatschner wants to merge 2 commits into
nextfrom
feat/kb-detail-rework

Conversation

@ntatschner

Copy link
Copy Markdown
Collaborator

Two web changes to the Knowledge Base entity detail pages.

1. Fix: ship images 404 in the browser

The gallery built <img src> from apiBase()STARSTATS_API_URL, the
server-side internal compose hostname (http://starstats-api:8080).
That URL was emitted into client HTML and fetched by the browser, which
can't resolve the internal host → DNS error → broken image (even with the
media kill-switch on).

Confirmed from the browser's own net-error page:
"starstats-api's DNS address could not be found" for
http://starstats-api:8080/v1/reference/vehicles/ORIG_100i/media/0.

Fix: a same-origin Next route handler
/kb/media/[category]/[className]/[idx] proxies to the API server-side;
shipMatrixMediaUrls now emits relative same-origin paths. No new env
config, hides the internal host, forwards the upstream status (404 when
disabled) so the gallery still degrades cleanly. Verified locally against
the live API — the image now renders (see rework screenshot).

2. Rework: KB entity detail page

Was a ~200-row always-open flat metadata dump. Now a scannable, on-brand
layout (Geist + Stanton Amber, .ss-card, 8pt grid, dry field labels per
the brand book):

  • Hero card — category eyebrow, large display name, class_name as a
    mono chip, wiki link, a subtle reticle-ring motif (original primitive,
    not an RSI asset).
  • "At a glance" curated readout, restyled stat grid.
  • Ship Matrix (vehicles) — specs grid + description + gallery +
    CIG disclaimer (unchanged in place).
  • "All metadata (N fields)" now collapsed behind <details> — the
    raw inspector is one click away instead of dominating the page.

Test plan

  • pnpm --filter web typecheck clean
  • pnpm --filter web test:run — 84 pass (ship-matrix media-URL tests
    updated for relative same-origin paths)
  • pnpm --filter web lint clean (only the pre-existing <img> advisory)
  • Rendered locally against the live API — hero/readout/specs/gallery/
    collapsed-metadata all correct; image loads via the proxy route
  • After deploy: confirm vehicle images render on starstats.app

Web-only — no API/schema/migration changes.

Nigel Tatschner added 2 commits June 14, 2026 03:44
…<img src>

The gallery built media URLs with apiBase() = STARSTATS_API_URL, the
server-side internal compose hostname (http://starstats-api:8080). That
URL was emitted into <img src> and fetched by the BROWSER, which can't
resolve the internal host → DNS error → broken image (even with the
media kill-switch on). Confirmed via the browser's net error:
"starstats-api's DNS address could not be found" for
http://starstats-api:8080/v1/reference/vehicles/ORIG_100i/media/0.

Fix: route images through a same-origin Next route handler
(/kb/media/[category]/[className]/[idx]) that proxies to the API
server-side; shipMatrixMediaUrls now emits relative same-origin paths.
No new env config, hides the internal host, forwards the upstream
status (404 when disabled) so the gallery still degrades gracefully.
Transform the detail page from a ~200-row always-open flat metadata dump
into a scannable, on-brand layout (Geist + Stanton Amber, .ss-card, 8pt
grid, dry field labels per the brand book):
- Hero card: category eyebrow, large display name, class_name as a mono
  chip, wiki link, a subtle reticle-ring motif (original primitive, not
  an RSI asset).
- "At a glance" curated readout restyled as a cleaner stat grid.
- ShipMatrixSection (vehicles) unchanged in place (specs + description +
  gallery).
- The full metadata table is now collapsed behind a <details> ("All
  metadata (N fields)") so the page leads with the useful, curated info
  and the raw inspector stays one click away.
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