Documentation-site Scala.js Console
modules/frontend delivers the Laminar remote console mounted on the documentation site's /demo page. It consumes shared protocol models and calls an operator-supplied Graviton HTTP endpoint. It is distinct from the packaged server's /console surface, which is server-rendered and refreshed with ZIO Blocks Datastar. The CAS Playground uses separate graviton-content-lab and graviton-pdf-lab Scala.js modules and does not depend on either console.
Build and run
npm ci --prefix docs
./sbt buildContentLab buildFrontend
./sbt 'server/run'In another terminal:
npm run docs:dev --prefix docsOpen http://localhost:5173/demo.
buildFrontend writes the Laminar console to docs/public/js/. buildContentLab links the streamed analyzer and bounded PDF editor into docs/.vitepress/generated/. Vite loads the analyzer on the playground and defers the larger PDF editor until byte sniffing confirms a PDF.
Data path
The operations view reads server health, process counters, and durable inventory. Upload sends the selected file bytes without preprocessing. Inventory reads persisted manifests and exposes their exact block content IDs, offsets, and sizes. Verify causes the server to read and hash the stored bytes.
There is no browser-side storage engine, generated telemetry, fallback dataset, or inferred success state. A failed request is rendered as a failed request.
Endpoint selection
The console resolves the server URL from:
- the
apiquery parameter - browser local storage
- the
graviton-api-urlmeta element http://localhost:8081
The connection bar lets an operator change and persist the endpoint. Reloading begins a new set of live requests.
Entry points
Main.scalaresolves the endpoint and mounts Laminar after the DOM is ready.GravitonApp.scalaowns routing and top-level request state.GravitonApi.scaladecodes typed HTTP responses and does not substitute data.BrowserHttpClient.scalasends JSON requests and binary file uploads through Fetch.
Validation
./sbt 'frontend/compile'
./sbt 'sharedProtocolJVM/test' 'sharedProtocolJS/test'
npm ci --prefix docs
./sbt buildContentLab buildFrontend
./scripts/verify-http-lifecycle.sh
npm run docs:build --prefix docsBrowser QA should cover the full lifecycle and a narrow viewport. The network panel should show each corresponding API request, and stopping the server should produce a visible connection failure.