Skip to content

fix(console+studio): re-enable live 0x84 pattern preview#151

Open
floesche wants to merge 1 commit into
reiserlab:mainfrom
floesche:re-enable-preview
Open

fix(console+studio): re-enable live 0x84 pattern preview#151
floesche wants to merge 1 commit into
reiserlab:mainfrom
floesche:re-enable-preview

Conversation

@floesche

@floesche floesche commented Jul 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Restores the SD-card pattern thumbnail preview in arena_console.html (renderSdPreview, fetched via GET_PATTERN_FILE / 0x84), which had been swapped for a metadata-only placeholder as a workaround for a controller bug where a stalled host could wedge the link on a 0x84 transfer.
  • Extends arena_studio.html's Console-view pattern picker with the same capability: patByteSource() now falls back to a live 0x84 fetch for any (previously previews only worked for patterns uploaded in the current session, the built-in library, or a loaded course-repo protocol).
  • Both are safe now that the root cause is fixed on the firmware side: 0x84 large pattern download truncates ~800 KB (firmware 60s deadline + slow console Web-Serial read) LED-Display_G6_Firmware_Arena#16 made GET_PATTERN_FILE chunked and non-blocking with a bounded stall-recovery timeout.

Test plan

  • pixi run test (no JS logic in the shared modules changed, so no new automated coverage. This is UI wiring against existing, unit-tested bridge functions)
  • Manual: arena_console.html served via python -m http.server, connected over WebSerial, selected an SD-card pattern uploaded in a prior session: thumbnail renders and animates on hover for multi-frame patterns.
  • Manual: arena_studio.html Console view, same scenario: thumbnail renders for a pattern never uploaded this session (previously blank).

Dependency

Requires the controller to be running the fixed GET_PATTERN_FILE handler from reiserlab/LED-Display_G6_Firmware_Arena#16 (chunked, non-blocking, bounded stall recovery).

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.
@floesche floesche requested a review from mbreiser July 5, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant