feat(wasm-viewer): restore Load Parquet upload affordance#920
Closed
thinkingfish wants to merge 1 commit into
Closed
feat(wasm-viewer): restore Load Parquet upload affordance#920thinkingfish wants to merge 1 commit into
thinkingfish wants to merge 1 commit into
Conversation
The static-site WASM viewer's landing page exposed only Demos and Load URL — the dropzone wasn't wired (no `onFile` handler) and the topnav "Load Parquet" button never showed up after a capture loaded (initDashboard was called without `onUploadParquet`). Both surfaces work in the server viewer; the WASM bootstrap was just missing the glue. Add a single `loadFile(file)` helper in `site/viewer/lib/script.js` that reads the File's bytes and runs the existing `loadParquet` flow. Pass it as `onFile` on the FileUpload landing component AND as `onUploadParquet` into `initDashboard`, so the same handler powers the dropzone, the landing's Choose-File button, and the topnav button once a capture is loaded. Drops `?demo` / `?capture` URL params on upload so a refresh doesn't fight the just-uploaded file. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
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
The static-site WASM viewer's landing page exposed only Demos and Load URL — the dropzone wasn't wired (
onFilehandler missing) and the topnav Load Parquet button never appeared after a capture loaded (initDashboardwas called withoutonUploadParquet). Both surfaces work in the server viewer; the WASM bootstrap was just missing the glue.Add a single
loadFile(file)helper insite/viewer/lib/script.jsthat reads the File's bytes and runs the existingloadParquetflow. Pass it as:onFileon theFileUploadlanding component → enables the drag-and-drop zone + the "Choose File" button on the landing page.onUploadParquetintoinitDashboard→ enables the topnav "Load Parquet" button after a capture is loaded.Both surfaces share one handler. Drops
?demo/?captureURL params on upload so a refresh doesn't fight the just-uploaded file.Test plan
node --check site/viewer/lib/script.jscleannode --test tests/*.mjs— 82/82🤖 Generated with Claude Code