From 974333e6ed2e243c4b318db8b9f7f3d6b6792934 Mon Sep 17 00:00:00 2001 From: Frank Loesche Date: Sun, 5 Jul 2026 17:46:53 -0400 Subject: [PATCH] fix(console+studio): re-enable live 0x84 pattern preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both consoles avoided fetching pattern bytes via GET_PATTERN_FILE (0x84) for the picker preview because it used to stall the link on a slow/stalled host. The Arena-Firmware bug is now fixed in reiserlab/LED-Display_G6_Firmware_Arena#16 (chunked, non-blocking transfer with a bounded stall recovery). Restoring the live preview now that the firmware handles it safely. arena_console.html: - __populateFromSdCard and the tp-pat-name change handler now call renderSdPreview() (full-frame thumbnail, hover-to-animate) instead of the metadata-only renderSdMetaCard() that had replaced it as a workaround. renderSdMetaCard/metaCard are left defined but unused. - v8 -> v9. arena_studio.html: - patByteSource(sd, idx) gains a fallback: when a pattern's bytes aren't already cached (this-session upload, built-in library, or a loaded course-repo protocol), fetch them live via Studio.session.sendBulkRead(Wire.encodeGetPatternFile(idx)) — the same 0x84 call the SD table's Download button already makes. Previously any pattern already on the card from a prior session had no preview at all. - renderPatThumb passes the pattern's SD index through to the new fallback; tooltip and a stale comment updated to describe the new in-memory-then-live-fetch behavior. - v0.5 -> v0.6. --- arena_console.html | 23 +++++++++++++---------- arena_studio.html | 32 +++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/arena_console.html b/arena_console.html index 2c2e4c8..07e938d 100644 --- a/arena_console.html +++ b/arena_console.html @@ -1521,7 +1521,7 @@
- + @@ -4014,22 +4014,25 @@ nameSel.value = entries[0].name; tpPat.value = entries[0].idx; lockPat(false); - // Cheap metadata preview via GET_PATTERN_INFO (0x88) — a small - // framed read, NOT the 0x84 bulk download that stalled the link - // and had to be disabled here. (Full-frame thumbnail is deferred; - // see renderSdPreview / the .pat-meta-thumb slot.) - renderSdMetaCard(entries[0].idx); + // Full-frame thumbnail via 0x84 (renderSdPreview) — re-enabled now + // that the controller's GET_PATTERN_FILE handler is chunked/ + // non-blocking with a bounded stall recovery (issue #16), instead + // of the old single-call handler that could wedge the link on a + // stalled host. Requires that firmware fix to be flashed — an + // older controller can still wedge the link here. + renderSdPreview(entries[0].idx); }; nameSel.addEventListener('change', () => { const name = nameSel.value; const sdIdx = sdNameToIndex[name]; if (sdIdx != null) { - // SD card mode: set the pattern index directly + show cheap - // 0x88 metadata (renderSdMetaCard). The 0x84 bulk preview stays - // disabled — it stalled the link. + // SD card mode: set the pattern index directly + show the + // full-frame thumbnail (renderSdPreview, 0x84 — see the + // __populateFromSdCard comment above for why this is safe + // again). tpPat.value = sdIdx; - renderSdMetaCard(sdIdx); + renderSdPreview(sdIdx); } else if (activeManifest) { // Manifest mode: resolve name → index + preview via manifest. applyPick(name); diff --git a/arena_studio.html b/arena_studio.html index 11668eb..304bcd1 100644 --- a/arena_studio.html +++ b/arena_studio.html @@ -2493,7 +2493,7 @@

Import error

- + @@ -2521,7 +2521,7 @@

Import error