Repository navigation
fix(components): reach the subtle-system chart by keyboard and load its drawing lazily - #303
Merged
Merged
Conversation
SubtleSystem imported assets/chart.svg?raw statically, and the RichText block converters import SubtleSystem, so the drawing's 325 KB of markup (about 100 KB gzipped) rode the shared RichText chunk. Every page that renders rich text downloaded it, whether or not it had a subtle-system block. The drawing now lives in SubtleSystemChart, reached only through ClientOnly + React.lazy, so the browser fetches it only where the block renders and vike strips it from the Worker. The previews and their 12 links still server-render. Until the drawing lands, an empty <svg> on the drawing's own viewBox holds its box under the same CSS rule, so nothing shifts. Measured with `pnpm build` (static-import closure of each page entry): /[slug] 1001.5 KB -> 685.3 KB raw, 328.4 KB -> 226.3 KB gzip, and the same ~102 KB gzip off the lecture and meditation pages and both embeds. The drawing is a 326 KB / 104 KB gzip lazy chunk; dist/server loses 333 KB. The eslint file-scoped exemption for dangerouslySetInnerHTML moves to SubtleSystemChart, and its reason now says what the file injects: a bundled asset, not SahajCloud rich text. components/AGENTS.md lists the new ClientOnly hole and what a visitor without JavaScript loses (the picture, not a link). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
The chart bound only mouseover, mouseout and click on its SVG nodes, and gave them no tabindex and no role. A keyboard could not open a single preview, and a screen reader found twelve unnamed shapes, so the twelve article links behind the chart were reachable by pointer only. Each node of the shown view that opens a preview is now a button: it takes a tab stop, its accessible name is the preview's own title, and it carries aria-controls and aria-expanded for that preview. Focus opens the preview at once, because the nested-chakra delay only exists for a pointer crossing overlapping shapes. Enter or Space moves focus onto the preview's link. Without that, Tab would reach the next node first, open its preview instead, and leave only the last node's link reachable. A node with no published page, and a node the view hides, get no stop. kundalini and chakra_7 stay drawn in the channels view but have no handler there, so they also get no stop. A closed preview is inert, so no keyboard or screen reader reaches it, including during its fade-out, when `invisible` alone still let focus land in it. Only a closing preview now transitions `visibility`. An opening one is visible in the commit that opens it, so Enter can focus its link even when the pointer had moved the selection elsewhere. Nodes draw an outline on :focus-visible, since `focus-ring` draws a box-shadow and an SVG element ignores box-shadow. Pointer behaviour is unchanged. Verified in Chrome via Ladle at 390px and 1280px: Tab focus shows the ring and opens the preview, and Enter lands on "Learn more about ..." even after a hover moved the selection. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
The drawing now arrives through React.lazy, and nothing caught a rejected import closer than the root Sentry boundary in LayoutRoot. A dropped connection, or a hashed chunk a deploy removed, replaced the whole page with ErrorFallback, previews and links included. A Sentry.ErrorBoundary inside the ClientOnly now renders the same empty box instead, so a failed chunk costs only the picture. A chart node is drawn at opacity 0 unless it is .active, and an outline fades with its element. A hover that moved .active to another node left the focused node's ring invisible. The :focus-visible rule now restores opacity 1. handleNodeFocus still gated onNodeSelect on the activeNode its closure held, so a listener bound before the pointer moved the selection re-selected the node without reporting it. It now reports every selection, as a click does. Two comments and the components/AGENTS.md row described the change's history; they now state the constraint. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | a2eaffc | Commit Preview URL Branch Preview URL |
Nov 19 2026, 09:25 PM |
This was referenced Nov 19, 2026
Open
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | a2eaffc | Commit Preview URL Branch Preview URL |
Nov 19 2026, 09:25 PM |
Ardnived
approved these changes
Nov 19, 2026
sydevs-bot
pushed a commit
that referenced
this pull request
Nov 19, 2026
main's #303 added a SubtleSystem row to the no-JavaScript table and raised its counts to five/sixth. This branch rewrote the LocationSearch row in the same place, because map-search makes it the component's first adopter. Both rows are kept, with main's counts, which the five rows now match. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYHdujKUYuziQGJrot
sydevs-bot
pushed a commit
that referenced
this pull request
Nov 20, 2026
One conflict, in the `dom-no-dangerously-set-innerhtml` override. Both sides moved the subject it names: #303 split the SVG injection out into `SubtleSystemChart.tsx`, and this branch deleted `lib/atlas-head.tsx` and turned the head's JSON-LD sink into a string Unhead renders through vike's `headHtmlEnd`. `SubtleSystemChart.tsx` is the one remaining `dangerouslySetInnerHTML` in the tree, so the override lists it alone. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXtfncYqJccTNxDtv4
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
assets/chart.svg, ~325 KB of markup) used to ship in the shared RichText chunk on every page. It now loads in its own chunk, and only where a subtle-system block renders. The server HTML still has all 12 previews and their links. The drawing's box is held by an empty<svg>on the drawing's own viewBox, so nothing moves when the drawing arrives. If the chunk fails to load, the visitor loses only the picture, not the page.role="button",tabindex="0",aria-labelfrom the item's title,aria-controls,aria-expanded). Focusing a node shows its preview. Enter or Space moves focus to the preview's "Learn more" link. Closed previews areinert, so they are not in the tab order or the accessibility tree. A focused node keeps a visible 2px ring whatever the pointer has selected. Pointer behaviour is unchanged.dangerouslySetInnerHTMLexemption ineslint.config.jsnow namesSubtleSystemChart.tsx, and its comment says what that file injects: a bundled asset, not SahajCloud rich text.components/AGENTS.mdlists SubtleSystem in the table ofClientOnlyholes, and states what a visitor without JavaScript gets.Findings addressed
F14a: the chart drawing shipped on every rich-text page. On
main(5ee6ded),components/organisms/SubtleSystem/SubtleSystem.tsx:2importedassets/chart.svg?rawstatically, andblockConverters.tsx:28imports SubtleSystem. Sopnpm buildput the drawing inchunk-BnOoyE0P.js(474.21 KB, 152.14 KB gzip), and every rich-text page entry imports that chunk statically. The drawing now lives inSubtleSystemChart.tsx, which is reached only throughClientOnly+React.lazy, inside its ownSuspenseandSentry.ErrorBoundary. Each page's static client JS (its static-import closure), measured withpnpm buildbefore and after this PR (raw / gzip):/[slug]lectures/[id]fullmeditations/[id]fullThe drawing is now a lazy chunk of 318.4 KB raw (101.7 KB gzip), and only an
import()in the RichText chunk reaches it.dist/serverwithout source maps went from 3,247,871 B to 2,914,670 B, and the drawing's path data has 0 hits there. In Chrome (Ladle), the placeholder and the real drawing measured the same size: 293.98×370.77 at 390px wide and 436.09×550 at 1280px.Pinned by
SubtleSystem.test.tsx(node, server render): all 12 preview hrefs are present, the drawing is absent, and the placeholder's opening tag is exactly<svg aria-hidden="true" viewBox=…>with the viewBox read fromassets/chart.svg. It also runs a source guard: onlySubtleSystemChart.tsximportschart.svg, nothing imports it statically, andSubtleSystem.tsxreaches it only throughimport('./SubtleSystemChart').SubtleSystem.chunk-error.test.tsx(jsdom) makes the chunk's import reject. The previews and the box must stay. Without the boundary, the error escapes to the root and the test fails.F8g: chart nodes were unreachable by keyboard. On
main,SubtleSystem.tsx:225-229bound onlymouseover,mouseoutandclickon the SVG nodes. The nodes had notabindex, no role and no name. The fix is described in the Summary. A few details:kundaliniandchakra_7, which stay drawn in the channels view.box-shadow, so the ring is a CSSoutline. That rule also setsopacity: 1, because a node is drawn at opacity 0 unless it is.active, and an outline fades with its element.onNodeSelectis called on every focus and every Enter, as it already is on every click. No caller passes it today.Pinned by
SubtleSystem.keyboard.test.tsx. It runs in jsdom with the realClientOnlyand the real lazy module, and has 9 cases:tabindex,aria-controlsandaria-expanded.Against the unfixed component, cases 1-8 fail. Case 9 passes either way, as a regression guard.
SubtleSystem.test.tsxalso asserts that all 12 server-rendered previews areinert, and that the:focus-visiblerule draws the ring at opacity 1 and comes after every other node-opacity rule.Stale
eslint.config.jscomment (bundle item). The comment said SubtleSystem renders SahajCloud's rich text. It now saysSubtleSystemChartinjectsassets/chart.svg, and the exemption moved to that file.Not in this PR
title, and the link keeps the existingblocks.a11y.learn_more_aboutandblocks.general.learn_morekeys. No translation key is needed upstream.opacity: 1on the focus rule and the error boundary. A stylesheet test and a jsdom test pin them. Neither was re-checked in a real browser.Reconciled with open PRs
eslint.config.jslines 226-229, the@eslint-react/dom-no-dangerously-set-innerhtmlfiles block. That PR swapslib/atlas-head.tsxforlib/head.tsxand rewrites the comment. This PR rewrites the same lines to nameSubtleSystemChart.tsx. To resolve, keep feat(seo): share metadata and JSON-LD at parity with the old site #282'slib/head.tsxentry and its JSON-LD wording, and take this PR's SubtleSystem half. The result isfiles: ['lib/head.tsx', 'components/organisms/SubtleSystem/SubtleSystemChart.tsx'], with a comment sayingSubtleSystemChartinjectsassets/chart.svg, an asset this repo ships.components/AGENTS.md. This PR adds only a new row after LocationSearch and changes the counts ("Four" to "Five", "fifth" to "sixth", "none of the four" to "none of the five"). feat(player): move VideoPlayer from Vidstack to Video.js 10 #285 changes none of those lines, and the trial merge is clean.git merge-treeat this head are also clean against feat(server): legacy redirect map and lookup for the wemeditate.com cutover #276, feat(components): add a mobile menu, and make the compact bar the phone's header #283, feat(server): switch wemeditate.com over to the new site #288, feat(preview): stream unsaved lecture edits into the preview panel #290, chore(contracts): re-sync copied contracts from SahajCloud #292 and feat(components): a MeditationLibrary for the meditations index block #293. This PR does not touchlib/content-blocks.ts,blockConverters.tsx, the Header, the MeditationPlayer, the[slug]route orserver/.Test results
.claude/skills/pr-prep/check.sh --fullat a2eaffc, exit 0:SubtleSystem.tsxand in the untouchedSubtleSystem.stories.tsx.tsc --noEmit: passed.pnpm build: passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw