feat(liturgy): concept tooltips + Heart Sutra + dharani rebuild + AI-text cleanup#68
Merged
Merged
Conversation
…attern)
When a Heart Sutra token attests one or more concepts (registry
membership computed by `conceptsForToken`), clicking the token now
advances the tooltip through facets:
facet 0: morpheme/word gloss (unchanged surface-level reading)
facet 1: ◇ <concept preferredLabel> · first sentence of definition
facet 2..N: same, one per additional concept
The pattern is borrowed from `components/sutta-studio/PaliWord.tsx` —
the mn10 demo shows multiple `tooltips[]` facets per segment cycled by
click, indicated by a small "1/N" badge on the tooltip. Heart Sutra
gets the same affordance for free, sourcing facet content from the
30-concept registry built earlier this session.
This surfaces the registry's rich data (definitions grounded in 84000,
DDB, Princeton Dictionary, Wikipedia) without bloating the default
hover. Readers see the gloss first; one click reveals "what concept is
this token a member of?" with a one-sentence registry-grounded answer.
Honours `feedback_tooltip_bulk.md` (memory 2026-05-12): tooltips remain
hover-only — no pin, no persistent sticky state. Click only cycles the
facet *while still hovering*; mouseLeave closes everything.
New helper: `data/concepts/tooltipFacets.ts` — `conceptFacets()` takes
conceptIds, returns one short facet string per known concept. Uses only
the first sentence of multi-sentence definitions to keep the tooltip
scannable.
Tests:
- `tests/components/liturgy/concept-tooltip-facets.test.ts` — unit
test of the helper (4 tests, all pass).
- Coverage probe + alignment audit still pass.
- Pre-existing song-of-zazen TS error unchanged (out of scope).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous bezier ran straight down from a source token to its English mapping, passing through any intervening row (transliteration, sibling words). Visually the line looked like it terminated at the first text it touched, not the actual target several rows below. Two changes: 1. Margin-arc routing — the curve now bows OUT to one side margin (chosen by which half of the container the line midpoint is in) and back, so the path travels through empty page space rather than slicing through text. `arcPath` computes a bezier whose control points share a "lane X" pulled `max(40, min(120, containerWidth * 0.06))` outside the further endpoint. SVG `overflow: visible` (already set) lets the arc render past the container's bounds. 2. Endpoint dots — small 2.5px-radius filled circles at each line end. Termination is now unambiguous: the dot is the actual endpoint, even if the curve sweeps past other text on its way out to the margin. Requested by user after seeing the existing renderer cut through the Heart Sutra page's transliteration row, e.g. a curve from a Devanāgarī token to "Prajñāpāramitā" appeared to end at the transliteration "gambhīrāṃ..." line above it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
User feedback: the margin-arc made alignment lines look "perverse" —
the dramatic lane offset created a J-shaped loop. Reverted to the
gentle near-vertical bezier that already exists, kept the endpoint
dots as the unambiguous termination cue.
Other strips, all driven by user pointing at AI-generated curator
prose:
- Sangha index footer: removed "Hand-curated. Each sangha's chants…"
meta-boilerplate.
- Sangha cards: removed primaryTradition badge (ZEN / MIXED).
- Sangha descriptions: replaced AI-generated text with the
monasteries' own self-descriptions, fetched from bodhizendo.org and
monasticacademy.org (one-line each, cited as comments in the data).
- Heart Sutra opening: deleted the three-paragraph framing block
about "shortest and most widely-chanted Mahāyāna sutra…"
- Heart Sutra core section: deleted "Above: the canonical core…"
commentary that interrupted the chant flow with structural
scaffolding.
- Sho Sai dharani page: deleted the framing prose section ("A
dharani — a sound-formula, not a translatable phrase…") and the
separate `framing:` line above the chant itself.
- Morning Chants subtitle: was timing prose ("Theravāda devotional
sequence, chanted before breakfast at MAPLE"), now describes the
chant content itself ("Threefold Refuge · Five Precepts · Ovāda
Pāṭimokkha (Dhp 183)").
- Segment notes: removed the "+ NOTE" expand-toggles on every chant
segment — user-flagged as noise. Note text in data is left in
place so we can decide later whether to surface it differently.
Captured but NOT yet executed (in task list): the bigger sweep across
chant `context:` fields, the rewrite of descriptions to grounded
what-it-IS prose, the dharani interleaving with Chinese kanji
breakdown, and the authoring work to convert the two MAPLE elided
prose passages into proper Xuanzang chant-line segments matching the
surrounding rhythm.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…h variant
Heart Sutra dharani section:
- Removed `framing:` ("The sutra ends not with a translation but with
a mantra...") and `reconstruction:` ("Read literally: gate (locative
or vocative of gata)...") — both flagged as scholarly prose-feel.
- Added a 5th script variant `en` ("gone, gone, gone-beyond,
fully-gone-beyond — awakening, svāhā") so the meaning is reachable
by clicking the script-cycle dots, without a prose paragraph.
- Removed the "On translating the Heart Sutra" prose-commentary
section at the bottom of the page.
SoundFormula component: bumped chant body from text-2xl/3xl to
text-4xl/5xl/6xl. The dharani text was too small to read in chanting
practice; the larger size matches the TripleScriptWitness chant-line
treatment on the rest of the page.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ing middle The two MAPLE-elided prose passages — "Śāriputra, all dharmas are characterized by emptiness..." and "Therefore in emptiness there is no appearance..." — were previously rendered as raw prose-commentary, breaking the visual rhythm of the surrounding Xuanzang chant-line segments. Replaced both with a new `heart-middle` triple-script-witness section containing 15 properly-broken segments matching the rest of the page. Six-negations passage (5 segments): 舍利子 / 是諸法空相 / 不生不滅 / 不垢不淨 / 不增不減 Long-enumeration passage (10 segments): 是故空中無色 / 無受想行識 / 無眼耳鼻舌身意 / 無色聲香味觸法 / 無眼界 乃至 無意識界 / 無無明 亦無無明盡 / 乃至 無老死 亦無老死盡 / 無苦集滅道 / 無智亦無得 / 以無所得故 Each segment carries Sanskrit (IAST + Devanāgarī), Chinese (Xuanzang T251), Sino-Japanese, and Tibetan (Kangyur short-form), plus four witness translations: MAPLE chant text, Conze 1958, Red Pine 2004, and Thich Nhat Hanh / Plum Village 2014. Word-level glosses + key morphemes for the doctrinally load-bearing terms (skandhas, six faculties, six objects, dhātus, twelve nidānas, Four Noble Truths, *jñāna*, *prāpti*). The concept-graph already auto-resolves new attestations from the registry on hover. `alignTo` arrays validated by the existing alignment-audit test (`tests/components/liturgy/alignment-audit.test.ts`) — 118 new assertions, all green. The renderer's per-token whitespace-split English count must match the `alignTo` length and each non-(-1) entry must point at a valid surface Pāli word; the audit caught 24 off-by-ones in the first authoring pass, fixed here. Refs #71. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Index UI:
- LiturgyIndex.tsx — removed the small `{doc.tradition}` badge that
rendered next to each chant title. Same call as the sangha-card
badge removal; user-flagged as noise.
Chant data — `context:` field rewritten across 16 chants to describe
what the chant *is* rather than when it's chanted at MAPLE or Bodhi.
The schedule already shows order/timing; the context line is the
chant's own subtitle blurb on the index card.
Pattern, per chant:
- bodhi-enmei-jikku-kannon-gyo: invocation of Kanzeon, 10 phrases
- bodhi-heart-sutra: Aitken-Rochester / Diamond Sangha lineage of the
English recension
- bodhi-vows: pan-Mahāyāna bodhisattva-vow formula
- bodhicitta-dedication: bodhicitta as aspiration to awaken for all
beings; dedication of merit toward that aim (per user's exemplar)
- bodhisattva-vow-torei: Tōrei Enji's late-18th-c. composition
- dedication-and-evening-call: ceremonial closing pieces
- enmei-jikku-kannon-gyo (MAPLE): 延命 = "life-extending"; protection
- heart-sutra (MAPLE): hṛdaya of the Perfection-of-Wisdom literature
- jade-method: MAPLE-composed contemplative practice
- metta-sutta: Khp 9 / Sn 1.8, loving-kindness
- om-mani-padme-hum: six-syllable mantra of Chenrezig
- precepts: two-voice format (Bodhidharma + Dōgen) + Dhp 183
- shin-jin-no-mei: Sengcan's Xinxin Ming, non-duality foundation
- sho-sai-myo-kichijo-darani: 消災 + 妙吉祥 etymology
- song-of-zazen: Hakuin's defining "this very place is the Lotus
Land" declaration
- ti-sarana: Pali devotional pieces in Bodhi's Japanese-Zen liturgy
- vows (MAPLE): Four Great Vows + closing Mitákuye Oyás'iŋ
- way-of-compassion: Burtt 1955 rendering + Om Tat Sat closing
All-tests green; pre-existing TS errors in
song-of-zazen.ts/AboutThisText.tsx/build-dpd.ts unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…se kanji
Converted the Sho Sai Myō Kichijō Darani from a single sound-formula
block into 9 chant-line triple-script-witness segments — one per
breath of the chant book layout. Each segment carries:
- Sanskrit IAST + Devanāgarī (the doctrinal anchor)
- Sino-Japanese phonetic line (the MAPLE chant text)
- Chinese kanji (phonetic carriers from T251)
- A literal English gloss (for the meaningful lines; "(ritual sound)"
where the syllables are non-semantic mantra particles)
Each kanji is broken into `scriptMorphemes` for hover tooltips that
disambiguate phonetic-carrier vs semantic readings — e.g. 曩 ("long
ago" semantically) is annotated "phonetic: transliterates *na*",
making it clear the kanji is a sound vehicle, not a meaning vehicle.
Each Sanskrit word's `scriptAlts` link to the corresponding
Japanese-phonetic and Chinese-kanji chunks so alignment lines connect
the sound to the Sanskrit word it phoneticizes.
Lines:
1. namaḥ samanta-buddhānāṃ — homage to all the buddhas
2. apratihata-śāsanānām — whose teaching is unimpeded
3. tadyathā oṃ kha kha khāhi khāhi
4. hūṃ hūṃ jvala jvala
5. prajvala prajvala — blaze forth, blaze forth
6. tiṣṭha tiṣṭha — stand, stand (be established)
7. ṣṭri ṣṭri — (ritual sound)
8. sphaṭ sphaṭ — (ritual sound)
9. śāntika śrīye svāhā — for peace, for prosperity, svāhā
Removed the now-redundant "Why Namu Samando" and "Sanskrit traces"
prose-commentary sections — the per-segment data carries that ground.
Alignment audit: 11 new assertions, all green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
This branch follows up on the merged Heart Sutra concept-graph (PR #67) with two big features and a broad cleanup pass — driven entirely by reader feedback on the live
/liturgy/maple/heart-sutrapage.Features
Click-to-cycle concept tooltips (mn10 pattern) — when a token attests one or more concepts from the registry, clicking the token cycles its tooltip through facets:
◇ <concept preferredLabel> · <first sentence of definition>per attested conceptThe
1/Nindicator on the existing sutta-studio Tooltip lights up automatically. Honours the user's earlier "no-pin" preference — facets advance only while the cursor is still over the token.15 new Heart Sutra chant-line segments — the two MAPLE-elided prose passages between the form-emptiness chiasmus and the result-section (six negations, long enumeration) are now broken into per-breath triple-script-witness segments matching the surrounding rhythm. Sanskrit + Devanāgarī + Chinese (Xuanzang T251) + Sino-Japanese + Tibetan + four English witnesses (MAPLE, Conze, Red Pine, Plum Village). 118 new alignment-audit assertions, all green.
Sho Sai dharani interleaving — converted from monolithic sound-formula to 9 chant-line triple-script-witness segments. Each line shows Sanskrit IAST + Devanāgarī, the Sino-Japanese chant text, the Chinese kanji as phonetic carriers, and a per-line English meaning. Kanji morphemes carry
scriptMorphemestooltips that disambiguate phonetic-carrier vs semantic readings (e.g. 曩 "long ago" → "phonetic: transliterates na").Endpoint dots on alignment lines — small filled circles at each line's source + target, so the termination is unambiguous even when the curve sweeps past intervening text rows. Earlier margin-arc experiment reverted at user request ("perverse and wrong") in favour of the original gentle vertical bezier + dots.
Cleanup
Driven by user-flagged AI-generated curator prose:
data/liturgy/sanghas.ts): replaced AI-generated text with the monasteries' own self-descriptions, fetched from bodhizendo.org and monasticacademy.org and cited as comments.enscript variant accessible via dots — short gloss instead of paragraph.context:field rewritten across 16 chants from when-chanted prose to what-it-IS prose. Examples:{doc.tradition}badge per chant.text-2xl/3xltotext-4xl/5xl/6xlso dharanis are easy to read during chanting practice.MN10 audit (informational)
User asked whether mn10 curation tapers off toward the back of the sutta. Yes — modestly:
Not blocking; logged for a future curation round.
Commits
Test plan
Pending threads (not in this PR)
🤖 Generated with Claude Code