Repository navigation
Charts: lighter scatter plots, compressed pages and keyboard access (#76, #32) - #115
Merged
Merged
Conversation
, #32) #76 page weight: - Scatter sends one path of dots per colour above 250 points and draws the circles after mount; hover picks the nearest point; coordinates rounded to 0.1 px and shared attributes moved onto one group per colour. - hooks.server.ts compresses HTML and JSON (Brotli/gzip) and sets a weak ETag from the build version and import hash, answering revalidation with a 304. - /sharks no longer ships derivable fields. #32 keyboard and motion: - charts/marks.ts: markKeys (one tab stop per chart, arrows/Home/End step through marks, Enter follows links, Escape hides) and markAt/pointerIn. All nine chart types use it; tooltips announce via role="status". - Reduced motion: global CSS override and no Leaflet zoom/fade animation. - e2e: keyboard test, compression/304 test, axe on /morphometrics and /pressure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
9 tasks done
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.
Closes #76. Closes #32. These were the last two open items in the design and charts epic (#70).
#76: page weight
On the real data, most of the weight was SVG markup rather than data. /morphometrics, for example, was 829 KB, of which 626 KB was about 2,500 per-point
<circle>s with their wrapper groups and hydration comments.<path>of round-capped dots per colour (a few bytes a point). The real circles, with their see-through overlaps, replace it once the page is interactive.<g>per colour, and coordinates are rounded to 0.1 px.hooks.server.ts): adapter-node only precompresses static files, so rendered HTML and JSON now go out with Brotli or gzip.Cache-Control: no-cache, so a browser revalidating an unchanged page gets a 304 without a render./healthis left alone.taggedflag,conflict).Measured on the real workbooks (dev server):
Every page now transfers under 50 KB, against the issue's target of about 300 KB. Uncompressed, /sharks and /notes are still above 300 KB, because both send the whole list for client-side search. Paginating them on the server is possible if that ever matters.
#32: keyboard access and reduced motion
charts/marks.ts.markKeys()makes each chart a single tab stop that steps through its marks:role="status", so each value is read out. While a chart has marks its svg isrole="application", so screen readers pass the arrow keys through instead of browsing. A chart with nothing to read stays an unfocusableimg.data-mark, and the keyboard tooltip is pinned at that mark's centre. Linked scatter points are now<a aria-label>.prefers-reduced-motionoverride for animations, transitions and smooth scrolling, and no Leaflet zoom or fade animation.Checks
pnpm lint,pnpm check,pnpm test(75 passed)pnpm build && pnpm test:e2e: 31 passed. New tests:🤖 Generated with Claude Code