Repository navigation
feat(siddur): customize the Koren siddur by hiding sections (POC) - #3824
Draft
mickeysefaria wants to merge 4 commits into
Draft
mickeysefaria wants to merge 4 commits into
mickeysefaria wants to merge 4 commits into
Conversation
A Customize button on the book TOC of The Koren Shalem Siddur; Ashkenaz opens a checkbox tree of every section. Unchecked sections (leaves, or whole roots like Shabbat) are saved in localStorage, dropped from the book TOC, skipped by the reader's infinite scroll, and skipped by Start Reading. No account needed. - sefaria/siddurCustomization.js: pure storage, tree, prune and skip helpers - SiddurCustomizeModal.jsx: the tree modal (tri-state parents, collapsible) - BookPage / TextTableOfContents / TextColumn: read state after mount only, so SSR output is unchanged - common/modal.jsx: optional className Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G4XFnHB38fPvuMVpc35cMd
The weekday nodes of the Koren siddur gain sub-sections (e.g. On Waking › Tzitzit, Minha › The Amida › Kedusha, Aleinu) that the Customize tree lists under their node, collapsed by default. A partially hidden node stays in the TOC and in the reader; its hidden paragraphs are filtered out of the TextRange. Hiding every sub-section of a node hides the node as before. - sefaria/siddurSubsections.json: curated map built from the text's bold headings, with nesting (Amida blessings) and unheaded parts (Ashrei, Aleinu, Elokai Netzor) added; children cover each node's whole range - siddurCustomization.js: buildCustomizeTree, normalizeHiddenRefs, resolveHidden (whole leaves vs paragraph ranges), hiddenSegmentsFor - TextRange: optional hiddenSegments prop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G4XFnHB38fPvuMVpc35cMd
Two display options at the top of the Customize modal, saved per device with the hidden sections: - Show instructions (default on): off strips the text's <i class="instruction"> elements; paragraphs that were only instructions drop out. - Show a note where sections are hidden (default off): on puts an inline "Not showing “Tzitzit”. Customize" note where hidden paragraphs or skipped sections were; Customize opens the modal from the reader. - siddurCustomization.js: display options storage, subscribeCustomization (replaces subscribeHiddenRefs), stripInstructions, visibleSegments, hintGroups, interleaveHints, hiddenRun, namesFor; resolveHidden ranges now carry their names - SiddurHiddenHint.jsx: the inline note - TextRange / TextColumn: apply the options; TextColumn hosts the modal Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G4XFnHB38fPvuMVpc35cMd
Hiding a section from the reader left it on screen if infinite scroll had already loaded it, right under the note saying it was hidden. On a change, TextColumn now drops loaded sections that are hidden (except the one in view, which stays where it was on screen). Notes for skipped sections now render inside the neighbouring TextRange (hiddenBefore / hiddenAfter), so they share the text's width instead of spanning the whole panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G4XFnHB38fPvuMVpc35cMd
This branch has not been deployed
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.
Description
POC, deployed to the
customsiddurcauldron only.The book TOC of The Koren Shalem Siddur; Ashkenaz gets a Customize button. It opens a modal with a checkbox tree of the whole siddur, all checked. Unchecking a section (e.g. Weekdays › Tallit) or a root (e.g. Shabbat) hides it:
Weekday sub-sections: the Weekdays nodes also list sub-sections, collapsed by default. Examples: On Waking › Tzitzit, Minha › The Amida › Kedusha, Aleinu. Unchecking one hides just those paragraphs inside the section. Unchecking every sub-section of a node hides the whole node.
Display options at the top of the modal:
<i class="instruction">elements, and paragraphs that held only instructions disappear.Not showing “Tzitzit”. Customizewhere hidden paragraphs or skipped sections were. Customize opens the modal right in the reader.Everything is saved in localStorage (
siddur.hiddenSections,siddur.displayOptions), per device, with no account needed. Direct links to a hidden section still open it.Code Changes
static/js/sefaria/siddurCustomization.js(new, pure):subscribeCustomization(same tab and cross-tab);buildCustomizeTreefor sub-sections;resolveHidden, which splits stored refs into whole sections and named paragraph ranges;pruneSchema,isRefHidden,skipHidden,firstVisibleSectionRef;stripInstructions,visibleSegments,hintGroups,interleaveHints,hiddenRun,namesFor.static/js/sefaria/siddurSubsections.json(new, ~3 KB gzipped): a curated map of the 13 Koren weekday nodes that have sub-sections.static/js/SiddurCustomizeModal.jsx(new): the display toggles; tri-state, collapsible tree; Show All / Cancel / Save.static/js/SiddurHiddenHint.jsx(new): the inline note.BookPage.jsx: Customize button (shows "N hidden"), the modal, a pruned schema inTextTableOfContents, and the first visible section for Start Reading.TextColumn.jsx:neighborRef()replaces rawnext/prevfor infinite scroll;TextRange;TextRange.jsx: optionalhiddenSegments,hideInstructions,showHiddenHintsandonSiddurCustomizeprops.common/modal.jsx: optionalclassName.s2.css, i18nsiddur_customize.*(en/he).siddurCustomization.test.jsandsiddurCustomizeModal.test.js. The tests include a check that every node's sub-sections cover all of its paragraphs, plus cases for instruction stripping taken from the Koren text.Notes
…, Weekdays, On Waking 8-12. A ref saved for a section that has since gained sub-sections stands for all of them.🤖 Generated with Claude Code
https://claude.ai/code/session_01G4XFnHB38fPvuMVpc35cMd