Repository navigation
W8: export a view as PNG, SVG or its files - #601
Merged
neuromechanist merged 22 commits intoNov 26, 2026
Merged
neuromechanist merged 22 commits into
neuromechanist merged 22 commits into
Conversation
Deploying nemar-website with
|
| Latest commit: |
b163c20
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1ce4ed78.nemar-website.pages.dev |
| Branch Preview URL: | https://feature-issue-588-w8-export.nemar-website.pages.dev |
neuromechanist
merged commit Nov 26, 2026
e132e32
into
feature/issue-586-epic-pipeline-progress
3 of 4 checks passed
This was referenced Nov 26, 2026
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.
Refs #588, nemarOrg/nemar-cli#2324
Summary
Phase W8 of the live quality views (#588, epic #586, nemarOrg/nemar-cli#2324; nemar-cli ADR 0137 decision 9, website ADR 0035 decision 7): exports of a drawn view, made only on request. This head also merges the epic branch with W7 (#599) and W9 (#598).
What a visitor gets
details). That covers stored views and computed views (Activations, the Signal window). Its code loads only when the toggle first opens.nemar.view-digest.v1), its kind, kind version and permalink, plus the color maps' notice when a map or heatmap is shown.nemar:window-start-sandnemar:window-length-sbeside the digest, kind and permalink.nemar:noteschunk, as ADR 0137 decision 9 requires: computed in the browser, the archive caption when present, the display-only 1 Hz high-pass, the store digest's state (not_checkedtoday), the transform's caption, and the line on shaded spans.extras/activity.tsprints, registered with the window (shownActivity); the DOM is not read.<title>, a<desc>and a<metadata id="nemar-view">holding the same fields as JSON, with the same lines printed under it.preloadedSource(recordFiles(...)).https://nemar.org, fromMARKETING_BASE_URL, the site's configured public address (lead ruling, C14). Only local development, a loopback host, writes the page's own origin.role="status") says what was saved or why not. Buttons usearia-disabledand a guard against a second click while busy, neverdisabled, so the keyboard's focus stays put.How
export/png.ts:tEXtchunks go right afterIHDR; text that Latin-1 cannot hold goes in an uncompressediTXtchunk.pngChunksandpngTextsread a file back.export/meta.ts: one field list for both formats, plusextrafields for a computed view.wrapTextbreaks lines at spaces and breaks an over-long word (a digest, a permalink) where it must.export/palette.ts: the light palette, held equal totokens.css:rootby a test.export/svg.ts:linesSvg,histogramSvg) without the cursor, with an inline<style>, throughXMLSerializer.export/raster.ts: paints the picture on a canvas.blob:image.export/maps-part.tsandexport/heatmap-part.ts: chunks of their own, loaded as the controls open.contoursOflines, so maps never scrolled into view are exported with their lines too.activityPainterinactivations.ts, the viewer'srenderFrame). The page's WebGL canvas haspreserveDrawingBuffer: false, so its pixels are not read back.extras/activity.tsregisters the window on show (shownActivity).export/download.ts:verifiedBytes, andsaveBytesthrough a revoked object URL.export/controls.ts: the controls chunk. As it opens, it starts loading the images chunk (picture.ts) and the parts the view needs, so a click makes no request.export-hook.ts: the toggle. It is offered whendownloadsOf(view)is not empty.Correction: the first version of this body said W7's tab would get the toggle automatically. It did not: W7's view declares its files as
inputs, and its window is WebGL. Both are wired here explicitly.Overlap with W7 and W9
panel.ts:drawViewreturns{ built, files }on its success paths;built;attachExport(...)call is made after a view draws.activations.ts:shownActivity,activityWindow,activityHeightandactivityPainteradded at its end.extras/activity.ts: registers the window on show and usesactivityHeight.e2e/quality-panel.spec.ts: both test blocks;Sizes (merged tree, real site build, gzip 9; all gates pass)
controlswith its static importspicturewith its static importssensor-field-viewTests
test/quality-views-export.test.ts(Vitest, on the record and files captured from the real route; HTTP fixtures only):iTXtfor text past Latin-1; keyword rules.extrafields written and printed.<metadata>, title, kind and digest on their own lines, every printed line's width within the SVG on the 480 px histogram with a long caption.fetchthrows during an export.e2e/quality-panel.spec.ts(Playwright, real browser, real panel, worker and serving-copy reader), export tests:getComputedTextLength).nemar.linesview is exported too.nemar:noteschunk and painted on the canvas.Mutation testing (the script is kept outside the repo):
Object.hasOwnchanged toinfor an inherited name, and the hook's first toggle always being the opening.nemar:noteschunk, notes not handed to the picture, captions dropped, notes printed twice, and Signal files fetched only at the click.Gates (merged tree)
bun run typecheck: 0 errorsbun run lintastro buildandcheck-quality-views-size.mjs --require-build: passbun run test:quality-views-perf(gate, median of 5): passquality-panel,quality-views-perf,viewer-scalp-map,viewer-quality-marks,admin-quality: 40 of 40bun run testonce: 269 files passed, 8 skipped; 8,719 tests passed. The drift tests are skipped locally; they are expected red in CI.Deviations
downloadsOf(view)is not empty.Agentic AI tools were used.