Repository navigation
Fix quality-view number labels, deep link, lede spacing and dev CSP - #617
Merged
Merged
Conversation
This was referenced Nov 27, 2026
Deploying nemar-website with
|
| Latest commit: |
5426dd5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d2386c0d.nemar-website.pages.dev |
| Branch Preview URL: | https://fix-quality-view-polish.nemar-website.pages.dev |
Merged
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
Fixes five issues a browser check found in the quality views (nemar-cli ADR 0134) against a local backend.
roundedText/labelTextinrender/scale.ts). A stored text that already has four or fewer significant digits is printed unchanged.src/lib/dataset-tabs.ts. A tab can name the hash prefix it owns (data-hash-prefix; Recording quality owns#quality), andbindTablistopens that tab when the page loads with a matching hash.Fragment. The two admin Pipelines ledes that did this now use template literals, and a source test rejects the pattern in every slotted Fragment.devConnectOriginsadds the origins ofPUBLIC_API_BASE_URLandPUBLIC_DATA_BASE_URLtoconnect-src, only whenimport.meta.env.DEV === true. It skips non-http(s) values and hosts thathttps://*.nemar.orgalready admits.Before / after
-29.811042743271745/18.801075851290445, clipped to743271745at the left edge-29.8/18.8; x ticks rounded the same way; the readout, data table and downloads keep the stored text6: from -3.4706225147472876 dB at C4 to 3.4803197825169043 dB at Fp26: from -3.47 dB at C4 to 3.48 dB at Fp2; the data table keeps the stored text/dataset/<id>#quality/.../icmapson a fresh load selects Components but leaves the page on Demographics. QualityPanel's script runs first and clicks the outer tab before DatasetTabs has bound the click.This page showsone recipe's runs; the run page's lede had the same bug ({failuresLead} {failuresMeaning()})admin/compute.astroalready used{" "}.PUBLIC_API_BASE_URL, every browser fetch fails ("Failed to fetch")astro devonly,connect-srcalso admitshttp://127.0.0.1:8787. Production policy unchanged: a test checks that every route's policy withDEV: falsematches the policy without dev origins byte for byte, and I diffed the default policy againststagingwith no difference.Tests added
test/quality-views-render.test.ts: rounding vectors (the observed values, exponent form, the near-flat cap,-0). Lines ticks are rounded while the readout keeps the stored text, and the scalp-map row is rounded. The existing "stored text" row check now also accepts the rounded label.test/dataset-tabs.test.ts(tabForHash) andtest/quality-panel.astro.test.ts(the rendered tab carriesdata-hash-prefix="#quality").e2e/dataset-tabs-deep-link.spec.ts: in a real browser, the panel's click lands before the tab list is bound, and#quality/...still opens Recording quality. A non-quality hash keeps Demographics.test/astro-slot-whitespace.test.ts: fails on the old source of both admin pages.src/middleware.test.ts:devConnectOriginsreturns nothing unlessDEV === true, production CSP is unchanged on five routes, and malformed or non-http bases cannot add a source.Gates run (the CI steps' own commands)
bun run lint: cleanbun run typecheck(astro check): 0 errors, 0 warningsbun run test: 273 files passed, 8 skipped (the nemar-cli contract drift tests, which need the CI sparse checkout); 8881 tests passedbun run test:quality-views-perf: 7 passedbunx astro build: completebun scripts/check-quality-views-size.mjs --require-build: passes (Spectrum first screen 29.0 KB of the 30.0 KB budget)e2e/quality-panel.spec.ts,e2e/admin-quality.spec.ts,e2e/dataset-tabs-deep-link.spec.ts; 39 passed, 7 skipped (the admin spec's backend-dependent cases)Not run: a manual check of the real dataset page against the local backend. The running dev servers were left alone.
Review round 1
import.meta.envtodevConnectOriginsmade Vite write it into the worker bundle asObject.assign(__vite_import_meta_env__, ...), including the build machine'sPATH. The middleware now readsDEVand the two bases by name, so a production build drops the dev branch entirely.osa-widget.ts(leakedPATH) andosa-overview.ts(leaked_) had the same pre-existing problem and are fixed in their own commit. After a rebuild, the onlyPATH:literal left in the bundle is in the pre-existingresolveDocsBase; that and the other remaining cases are filed as Build-machine env vars written into the worker bundle #618.fieldTableand check the exact stored texts. New cases cover a heatmap with long cell texts (legend rounded; table and readout exact), a density histogram's rounded top tick, andnoteCaption("near_flat", 0.0123456789, "µV"). All five fail against the pre-fix renderers.PUBLIC_API_BASE_URLexported in the shell. The older middleware tests' sensitivity to that variable predates this PR: 8 of them fail on staging too. Filed as Middleware tests fail when PUBLIC_API_BASE_URL is exported #619.Agentic AI tools were used. Workflows follow the Research Skills (doi:10.5281/zenodo.20696515). The author assumes full responsibility for this content and associated changes.