From f7e00d041e05ee1eb4131d3f33e32892aa5d2752 Mon Sep 17 00:00:00 2001 From: Saran Tunyasuvunakool Date: Wed, 13 May 2026 09:34:15 -0700 Subject: [PATCH] Add commit hash and remove "Upload File" button from MuJoCo Live. PiperOrigin-RevId: 914909503 Change-Id: I084d888eb5093b4278e758697bff43ff941c79d0 --- .github/workflows/live.yml | 4 ++++ src/experimental/studio/index.html | 30 +++++++++++------------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/live.yml b/.github/workflows/live.yml index 49cd5359..e5b6e152 100644 --- a/.github/workflows/live.yml +++ b/.github/workflows/live.yml @@ -33,6 +33,10 @@ jobs: mkdir -p dist/bin cp -r build_wasm/bin/* dist/bin/ cp src/experimental/studio/index.html dist/index.html + COMMIT_HASH=$(git rev-parse HEAD 2>/dev/null || true) + if [ -n "$COMMIT_HASH" ]; then + sed -i "s/__COMMIT_HASH_PLACEHOLDER__/$COMMIT_HASH/g" dist/index.html + fi - name: Upload GitHub Pages artifacts uses: actions/upload-pages-artifact@v3 diff --git a/src/experimental/studio/index.html b/src/experimental/studio/index.html index 8ab12f48..0b667c75 100644 --- a/src/experimental/studio/index.html +++ b/src/experimental/studio/index.html @@ -5,10 +5,17 @@ MuJoCo Live -
- - -
+
__COMMIT_HASH_PLACEHOLDER__
+ { - const uploadButton = document.getElementById('uploadButton'); - const fileInput = document.getElementById('fileInput'); - - uploadButton.addEventListener('click', () => { - fileInput.click(); - }); - - fileInput.addEventListener('change', (event) => { - const file = event.target.files[0]; - if (!file) { - return; - } - handleFile(file); - }); - // --- Drag-and-drop support --- const dropOverlay = document.createElement('div'); dropOverlay.id = 'dropOverlay';