Skip to content

שיוניים נוספים במפרשים, והוספת תמיכה במפרש ריק#10

Merged
Y-PLONI merged 7 commits into
Otzaria:books_defaultfrom
palmoni5:master
Jun 30, 2026
Merged

שיוניים נוספים במפרשים, והוספת תמיכה במפרש ריק#10
Y-PLONI merged 7 commits into
Otzaria:books_defaultfrom
palmoni5:master

Conversation

@palmoni5

@palmoni5 palmoni5 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

@Y-PLONI
שים לב! יש פה שינויי לוגיקה לתמיכה במפרש ריק. אני לא בטוח שכדאי למזג לתוך הPR הפתוח ללא מתייאש.
זה לא השינוי עליו דיברנו בצ'אט, הוא עוד מחכה בצד

ההגיון מאחורי השינוי: אם יש מפרש מסויים שלא קיים על כל הספר, למשל מגיד משנה שלא קיים על כל הרמב"ם, אז המפרש הבא יופיע במקומו הראוי ולא במקום הספר החסר, לשמירה על תפיסת עין המשתמש.
(לבקשת @איש-שלום)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for non-contiguous positions (intentional gaps) in default commentators by utilizing a "-" sentinel in default_commentators.json. The database queries and repository methods have been updated to handle commentators as (commentatorBookId, position) pairs instead of simple ID lists, and unit tests have been added to verify this position resolution logic. The feedback suggests wrapping the delete and insert operations in setDefaultCommentatorsForBook within a database transaction to ensure atomicity and improve performance.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Y-PLONI

Y-PLONI commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

ההגיון מאחורי השינוי: אם יש מפרש מסויים שלא קיים על כל הספר, למשל מגיד משנה שלא קיים על כל הרמב"ם, אז המפרש הבא יופיע במקומו הראוי ולא במקום הספר החסר, לשמירה על תפיסת עין המשתמש.

תסביר יותר, בבקשה.
לא הבנתי.

@palmoni5

Copy link
Copy Markdown
Collaborator Author

@Y-PLONI

Y-PLONI commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

@palmoni5
עשיתי rebase, ולכן יש כ״כ הרבה בעיות...
מה הקומיטים שהוספת?

@palmoni5

Copy link
Copy Markdown
Collaborator Author

@Y-PLONI
כמדומה ששלושת הקומיטים האחרונים

@palmoni5

Copy link
Copy Markdown
Collaborator Author

הסתדת? אם זה חשוב לך אוריד שוב את המאגר למחשב המקומי ואבצע ריבייס

@Y-PLONI

Y-PLONI commented Jun 17, 2026 via email

Copy link
Copy Markdown
Collaborator

@palmoni5

Copy link
Copy Markdown
Collaborator Author

@Y-PLONI
בוצע

@palmoni5

Copy link
Copy Markdown
Collaborator Author

@Y-PLONI
שים לב לקומיט שהוספתי, לתיקון מה שדווח פה:
https://otzaria.org/forum/post/21941

@Y-PLONI Y-PLONI force-pushed the master branch 2 times, most recently from b6c6aed to 9b576c5 Compare June 23, 2026 05:15
@palmoni5

Copy link
Copy Markdown
Collaborator Author

@Y-PLONI
מה שוב קרה פה?

@palmoni5

Copy link
Copy Markdown
Collaborator Author

@Y-PLONI
אשמח לטיפול לפני שחרור הDB לציבור

palmoni5 and others added 6 commits June 30, 2026 09:58
…cha + Shaar HaTziyun

- Remove Mishnah Berurah and Shaar HaTziyun from Shulchan Aruch (OC) default commentators.
- Add 'משנה ברורה' as a base book whose default commentators are Biur Halacha and Shaar HaTziyun.
…sitions

A default-commentator list may leave a gap with the "-" sentinel, e.g. ["א", "-", "ב"]
keeps "ב" at position 2 (consumers decide how to interpret the gap).

- position now reflects the slot index (non-contiguous when a slot is skipped) instead
  of a running counter. Missing/duplicate commentators are still packed (back-compat).
- setter takes explicit (id, position); getter returns positions too (symmetric API).
- Extracted resolvePositionedCommentators with unit tests (gap/missing/duplicate/self).
Rambam: halachot without Magid Mishneh use "-" between Kesef Mishneh and Hasagot
HaRaavad, so Hasagot keeps position 2 and Magid's slot (1) stays empty — consistent
placement across all halachot. Yerushalmi: tractates without Korban HaEdah / Shayarei
Korban use "-" so Mareh HaPanim keeps position 2.

Pure data change relying on the existing "-" sentinel; trailing "-" trimmed.
ערכי alt-struct של Sefaria משתמשים לעיתים באיות שם שאינו הראשי (למשל
"Messilat Yesharim" מול הראשי "Mesillat Yesharim", מופיע ב-titleVariants).
שם ספר לא מזוהה נכשל בהתאמה הקנונית ונופל ל-tail fallback ("13"), שמתנגש
עם segment באותו מספר בהקדמה - וכך כל פרק במסילת ישרים נותב להקדמה.

הפתרון: זיהוי prefix של וריאנט שם מוכר (מ-titleAliasKeys) ושכתובו לשם
הראשי לפני הפתרון, כך שההתאמה הקנונית פוגעת בפרק הנכון.

נוסף טסט titleVariantWholeRefShouldResolveToChapterNotIntroduction.
…llision

Selecting two columns (commentatorBookId, position) made SQLDelight
generate a result class named SelectByBookId, colliding with the one
from TocQueries.sq. The collision pushed both classes into per-query
subpackages (db.tocQueries / db.defaultCommentatorQueries), so the flat
io.github.kdroidfilter.seforimlibrary.db.SelectByBookId referenced by
ModelExtensions.toModel() no longer resolved, breaking :dao:compileKotlinJvm
with overload-resolution-ambiguity errors across every toModel() call.

Rename the query to selectByBookIdWithPosition so its result class is
SelectByBookIdWithPosition, freeing the flat SelectByBookId name for toc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The new Mesillat Yesharim alt-toc test built a BookPayload without the
required heShortDesc parameter (added upstream), breaking
:sefariasqlite:compileTestKotlinJvm. Pass heShortDesc = null to match the
other BookPayload constructions in this file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Y-PLONI Y-PLONI changed the base branch from master to books_default June 30, 2026 08:17
@Y-PLONI

Y-PLONI commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

ממצאים

  • צריך לא לקבל כמו שזה בלי לוודא את צד הצריכה. התיקון לרמב״ם שומר “חור” רק דרך position: למשל כסף משנה ב־0, אין שורה ב־1, ראב״ד ב־2. אבל אם האפליקציה רק קוראת ORDER BY position ואז עושה mapIndexed, החור נעלם והראב״ד שוב יהיה “המפרש השני”. הקוד החדש כן מחזיר positions ב־SeforimRepository.kt, אבל ה־PR עצמו לא מוכיח שהצרכן באמת משתמש ב־position ולא באינדקס הרשימה.

  • שינוי API לא נקי מספיק. ה־PR מחק את ה־API הישן של רשימת IDs והחליף אותו ב־List<Pair<Long, Int>> ב־SeforimRepository.kt. זה גם שובר צרכנים קיימים וגם משתמש ב־Pair גנרי ב־public API. הייתי דורש שם מפורש, למשל DefaultCommentatorPosition(commentatorBookId, position), ולהשאיר מתודה תאימות שמחזירה IDs רציפים למי שלא צריך gaps.

  • יש שינוי מוצרי לא קשור לדיווחים: משנה ברורה הוגדר כספר בסיס עם ביאור הלכה ו־שער הציון, ובמקביל משנה ברורה ו־שער הציון הוסרו מברירות המחדל של שולחן ערוך, אורח חיים ב־default_commentators.json. יכול להיות שזה נכון, אבל זה לא חלק משתי הבעיות שתיארת וצריך אישור נפרד כי זה משנה מה נפתח כברירת מחדל לשו״ע או״ח.

מה ה־PR כן פתר

  • בעיית הרמב״ם: ב־default_commentators.json הוסיפו "-" במקומות שאין מגיד משנה. ה־loader הופך את זה ל־slot ריק, ו־resolvePositionedCommentators מקדם את position בלי להכניס שורה. זה פתרון נתוני, לא מנגנון קסם כללי.

  • בעיית מסילת ישרים: ב־SefariaAltTocBuilder.kt הם מנרמלים title variant כמו Messilat Yesharim אל הכותרת הראשית Mesillat Yesharim. בלי זה, הלחיצה על “פרישות” נפלה ל־tail fallback של 13, ופגעה בקטע 13 של ההקדמה במקום בפרק יג.

@Y-PLONI

Y-PLONI commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator
  • הלחיצה על “פרישות” נפלה ל־tail fallback

@palmoni5
עצם זה שיש fallback כבר יכול להרוס את כל הpr...

The default-commentator API exposed (commentatorBookId, position) as a generic
Pair in its public surface. Introduce a named DefaultCommentatorPosition model
(mirroring LineTocMapping) and thread it through getDefaultCommentatorsForBook /
setDefaultCommentatorsForBook, resolvePositionedCommentators, and callers/tests.

Documents the gap contract on the type: non-contiguous positions keep a stable
column in fixed-slot page layouts; honoring position is opt-in - a consumer that
ignores it renders commentators consecutively with no gap and is unaffected.
@palmoni5

Copy link
Copy Markdown
Collaborator Author

@Y-PLONI
תוקן, סוף סוף...
שים לב שה fallback היה קיים כבר, הוא רק כתב שהשינויים תיקנו את זה...

@Y-PLONI Y-PLONI merged commit c7d4dde into Otzaria:books_default Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants