From aeab7623427e0e5cd8445e82ed51ecfb8c6ad5b4 Mon Sep 17 00:00:00 2001 From: William Wong Date: Sat, 12 Sep 2026 11:40:26 +0100 Subject: [PATCH] fix(app): a published build must not go looking for localhost Opening the deployed instrument raised Chrome's local-network prompt -- "wwstorymode.github.io wants to access other apps and services on this device" -- because the page probes http://localhost:8000/health at boot to fill the model list. I predicted that fetch would fail honestly. It does, eventually, but first it asks every visitor for a permission that sounds alarming, has nothing to do with what they came for, and whose answer was going to be "there is no service" either way. Asking is worse than the failure. A build served from the machine the service runs on -- a dev server, or a file:// page -- still probes exactly as before; that is the instrument in normal use. A build served from the open web stays quiet unless someone asks with ?service, which puts the prompt after a question the visitor actually asked rather than before one. Both routes to the service are closed, not just the boot probe. post() refuses before the fetch, so pressing Generate on a published copy explains itself instead of requesting permission to fail -- it is the single path drafting, baking and the triptych all go through. ?service takes an optional port, digits only. It decides what the page connects to, so an arbitrary address there would be a link someone else could aim -- the same reasoning as sessionUrl(). The hint now distinguishes the two cases: a local build says the service is not running and gives the command to start it; a published one says it has no service behind it, that importing works with nothing loaded, and how to connect if you do have the stack. The landing page says the same. Verified on the built bundle served under a /BodyPrompt prefix: no localhost reference is reachable at boot. npm test 78 passing; tsc and vite build clean. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_014yJSPiRjB5WvTH2x4LB8V6 --- docs/index.html | 8 ++++-- frontend/app/src/main.ts | 57 +++++++++++++++++++++++++++++++++++----- 2 files changed, 56 insertions(+), 9 deletions(-) diff --git a/docs/index.html b/docs/index.html index b8c52ae..54ca7d9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -85,8 +85,12 @@

Open

your own machine, and this is a static site. What does work, with nothing installed: opening a saved session and watching every body in it, scrubbing it, reading the notation, and rating it. The motions are inside the files.

- Press Generate or Bake and the instrument will tell you the service is absent - rather than pretending otherwise. + Press Generate or Bake and the instrument will say the service is absent + rather than pretending otherwise. It does not go looking for one, either — a page on the + open web reaching for something on your machine is what makes a browser stop and ask + permission, and the answer here would be "nothing there" regardless.

+ Running the stack yourself? Add ?service to the instrument's address and it will + connect to localhost:8000.