feat(sc-46669): let siddur instruction rubrics span both columns - #3623
feat(sc-46669): let siddur instruction rubrics span both columns#3623EliezerIsrael wants to merge 2 commits into
Conversation
Siddur texts carry English rubrics in <i class="instruction"> tags, living on
the translation side of segments that have no source text at all. In
side-by-side bilingual they were confined to the 50% translation column and
wrapped against an empty facing column; in source-only mode the blanket
`.readerPanel.hebrew .contentSpan.translation { display: none }` hid them
entirely, so those segments rendered empty.
Expose the already-computed `hasNoPrimarry` from TextSegment.render as a
`noPrimary` class and key the new CSS on that:
- side-by-side: the translation spans the full width and the empty source span
is hidden so its float can't reserve the facing half
- source-only + English UI: show the rubric (it is English, so the Hebrew UI
keeps the current hidden behavior)
The trigger is deliberately "segment has no source text" rather than
":has(> i.instruction)". Sampling 11 siddur sections (498 segments, 174 with
instructions) found 32 segments where a rubric sits at the top level of a span
that also holds a real translation with facing Hebrew — Tefillin 11 and every
"Leader:" line in Kaddish and Kedusha. Full-widthing those would break the
parallel layout. Of 102 segments with no Hebrew, 101 carry a rubric, and no
instruction-only translation has facing Hebrew, so `noPrimary` selects exactly
the rubrics. SID-002 is the regression guard for the mixed case.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
📊 Code Quality Score: 23/100
Was this score accurate? 👍 Yes · 👎 No Scored by GitVelocity · How are scores calculated? |
…electors
setContentLanguage targeted `getByRole('button', { name: 'Toggle Reader Menu
Display Settings' })`, which no longer matches anything: the toggle is a div
whose accessible name is now `common.text_display_options`. The method had no
callers, so it had gone stale unnoticed.
Both the toggle's accessible name and the radios' labels are interface-language
dependent -- the toggle renders as "אפשרויות תצוגת טקסט" and the layout radios
as "Show RTL Text Right of LTR Text" / their Hebrew equivalents. Anchor instead
on the class hardcoded in DisplaySettingsButton (Misc.jsx) and on the radios'
`value` attributes, which are always the English keys (CLAUDE.md §2 rule 15).
Also click the wrapping <label> rather than the <input>, which sits behind it,
and assert toBeChecked so a swallowed click fails loudly instead of silently
leaving the previous layout in place.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Red baseline captured against productionRan both specs against
Both new-behavior tests fail for the intended reason and both guards pass, so a green run can't come from the page simply failing to load. Green run against a local instance on this branch is pending — the local Mongo dump predates the siddur import. One extra commit
|
✅ Green run — verified end to endRan against a local instance on this branch (webpack client build, siddur data restored from the prod dump, redis TOC cache cleared so the siddur appears in the TOC).
Both behaviors flip red→green, and both guards hold on each side. Confirmed in the DOM that 6 of the 16 segments in Ready for review. |
Closes sc-46669
Siddur texts carry English rubrics in
<i class="instruction">tags — "Some say the following meditation before putting on the tefillin." They live on the translation side, in segments that have no source text at all.Example: https://www.sefaria.org/The_Koren_Shalem_Siddur%3B_Ashkenaz%2C_Weekdays%2C_Tefillin.1?lang=bi
Before / after
Why the trigger is "no source text", not "has an instruction tag"
Keying off
:has(> i.instruction)alone misfires. Sampling 11 siddur sections via/api/v3/texts(498 segments, 174 containing instructions):Those 32 include
Tefillin 11("Some say:" + a full translation) and everyLeader:/Cong. then Leader:line in Kaddish and Kedusha — all with facing Hebrew. Full-widthing them would break the parallel layout.Of 102 segments with no Hebrew, 101 carry a rubric, and zero instruction-only translations have facing Hebrew. So this exposes the already-computed
hasNoPrimarryas anoPrimaryclass and keys the CSS on that. The source-only rule additionally requires:has(> i.instruction)so missing-source segments library-wide don't start showing English in Hebrew-only mode.SID-002is the regression guard for the mixed case — without it a:has(i.instruction)implementation would look correct.Notes for review
.basetext, so the connections panel is unaffected (TextList/VersionsTextListpassbasetext={false})..primary/.translationrather than.he/.en, because those language classes are currently unreliable on this text — see sc-46469, fixed in the follow-up PR stacked on this branch.:has()already appears 8× in these stylesheets.Tests
e2e-tests/library/siddur-instruction-rubrics.spec.ts— SID-001 … SID-004, plus newSourceTextPagemethods (setBiLayout,getSegmentSpanLayout,isInstructionRendered).🤖 Generated with Claude Code