From 53dd1eff104f7f60bac581979f09a1e76fc52613 Mon Sep 17 00:00:00 2001 From: Bob Jansen Date: Sat, 29 Aug 2026 16:34:56 +0200 Subject: [PATCH] Playground: stack editor over results, widen page, cache-bust assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Layout: the editor/results split is now vertical (console on top, table below) like the local web UI, and the page widens to 1180px so wide result tables aren't cramped into half the column. - The Pages workflow stamps the deploy's commit onto local css/js/mjs URLs (and the .wasm the module fetches) so returning visitors don't get a stale stylesheet — the first-load flash of unstyled content. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01UF1k31UD7JHZujGtgHj57H --- .github/workflows/pages.yml | 14 ++++++++++++++ docs/playground.html | 2 +- docs/styles.css | 22 ++++++++-------------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 9c2cf705..1dfcba58 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -50,6 +50,20 @@ jobs: cp build-wasm/wasm/ibex.mjs build-wasm/wasm/ibex.wasm docs/playground/ ls -l docs/playground + - name: Cache-bust static assets + run: | + # Stamp every deploy's commit onto local css/js URLs so returning + # visitors don't get served a stale stylesheet or script. + VER="$(git rev-parse --short HEAD)" + find docs -name '*.html' -print0 | xargs -0 sed -i -E \ + "s#(href|src)=\"(\./[^\"?]+\.(css|js|mjs))\"#\1=\"\2?v=${VER}\"#g" + # ... the wasm module the playground script imports ... + sed -i -E "s#(\./playground/ibex\.mjs)#\1?v=${VER}#g" docs/playground.js + # ... and the .wasm the module fetches (Emscripten's URL() drops the + # query from import.meta.url, so stamp the filename itself). + sed -i -E "s#([\"'])ibex\.wasm([\"'])#\1ibex.wasm?v=${VER}\2#g" docs/playground/ibex.mjs + grep -o 'styles\.css?v=[0-9a-f]*' docs/index.html | head -1 + - name: Configure Pages uses: actions/configure-pages@v6 diff --git a/docs/playground.html b/docs/playground.html index 6b909d15..37b2d63a 100644 --- a/docs/playground.html +++ b/docs/playground.html @@ -11,7 +11,7 @@ -
+