fix(console+studio): re-enable live 0x84 pattern preview#151
Open
floesche wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
arena_console.html(renderSdPreview, fetched viaGET_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.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).GET_PATTERN_FILEchunked 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)arena_console.htmlserved viapython -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.arena_studio.htmlConsole 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_FILEhandler from reiserlab/LED-Display_G6_Firmware_Arena#16 (chunked, non-blocking, bounded stall recovery).