feat(web): rework KB detail page + fix ship images 404ing in browser#165
Open
ntatschner wants to merge 2 commits into
Open
feat(web): rework KB detail page + fix ship images 404ing in browser#165ntatschner wants to merge 2 commits into
ntatschner wants to merge 2 commits into
Conversation
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.
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.
Two web changes to the Knowledge Base entity detail pages.
1. Fix: ship images 404 in the browser
The gallery built
<img src>fromapiBase()—STARSTATS_API_URL, theserver-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"forhttp://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;shipMatrixMediaUrlsnow emits relative same-origin paths. No new envconfig, 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 perthe brand book):
class_nameas amono chip, wiki link, a subtle reticle-ring motif (original primitive,
not an RSI asset).
CIG disclaimer (unchanged in place).
<details>— theraw inspector is one click away instead of dominating the page.
Test plan
pnpm --filter web typecheckcleanpnpm --filter web test:run— 84 pass (ship-matrix media-URL testsupdated for relative same-origin paths)
pnpm --filter web lintclean (only the pre-existing<img>advisory)collapsed-metadata all correct; image loads via the proxy route
starstats.appWeb-only — no API/schema/migration changes.