Host viewer: https://producingtechnology.com/browser.html (TERMINAL_VIEWER v1.0, landed on PAGE 60/143).
LOADED_SRC: https://producingtechnology.com/65-apps/tsaihsinyu_183237_15200710_text_media_json_viewer.html
App title: “Load a Text Media JSON and turn it into a styled reading experience”
— a single-file JSON app by Tsai Hsin-Yu that is intended to consume a Wikipedia-style JSON file
(reading the HTML payload at parse.text["*"]) and remix it into a styled article viewer.
The app is built as a two-column reader layout inside a dark glassmorphism shell. Its advertised workflow is:
producingtechnology.com.parse.text["*"]
containing raw HTML.
In its empty (pre-load) state, the app shows a prominent hero heading, a URL input prefilled with
https://producingtechnology.com/a1/15-json/yourname.json, two buttons
(Load JSON and Use Sample Path), a muted “No article loaded / Waiting for a JSON URL”
placeholder card, empty stat cards (Topic: —, Sections: 0, Images: 0), and an explanatory
“How this mock works” block describing the earlier Wikipedia API assignment flow this
project remixes.
.../a1/15-json/yourname.json. Clicking Load JSON
on the pristine page produces Request failed with status 404 in the UI and
Failed to load resource: the server responded with a status of 404 (Not Found) in the console.
yourname.json placeholder into the URL
field. It does not substitute a known-good URL, does not trigger an automatic fetch, and does not
populate the view with any embedded example. In effect, the button is indistinguishable from a reset.
producingtechnology.com, a grader who has a JSON locally
(or a slightly different URL) has no way to drop it in for inspection.
Rewrite this Text Media JSON Viewer so it demonstrates itself out of the box and tolerates real-world input. Specifically:
- Replace the literal
yourname.jsonplaceholder with a real, shipped sample file at a stable path (e.g../sample-article.jsonnext to the HTML). The Use Sample Path button should populate this URL and auto-fetch so the page renders a complete demo article on first click, including populated Topic / Sections / Images cards, Quick Navigation sidebar, and an image gallery.- Bundle a second embedded JSON fallback (inline in a
<script type="application/json">block) so the app can render offline / on 404. On fetch failure, render the embedded sample and show a non-blocking banner “Live fetch failed — showing bundled example.”- Add a file upload input (accept=
application/json) next to the URL field so a reviewer can drag-drop a local JSON without hosting it. Also allow pasting raw JSON into a textarea as a third input mode.- Make the summary cards skeleton-state-aware: during fetch, show shimmering placeholders; on success, animate counts up from zero; on error, dim the card and show the reason inline.
- Validate the JSON shape before rendering (check for
parse.text["*"]) and show a helpful error like “Loaded JSON does not look like a MediaWiki parse response — missingparse.text["*"]. Expected keys: parse.title, parse.text.” with an “Accept anyway” button for partial renders.- Improve accessibility: the Quick Navigation links should be real
<a href="#id">anchors with keyboard focus styles, and the image gallery should use<figure>/<figcaption>with alt text pulled from the source HTML where available.- Persist the last successfully loaded URL in
localStorageso re-opening the page picks up where the reviewer left off.Keep the project a single HTML file with vanilla JS so it continues to run inside the TERMINAL_VIEWER iframe without a build step.