Closed birchamp closed 1 year ago
@jincypjose we need to know how big of an effort this is.
@birchamp - @larsgson, @Joel-C-Johnson and i were debugging this issue and found out it's a few day's effort not a quick fix And for the future reference.Its in single-scripture-rcl these are two files where focus is needed: ScripturePane.tsx useScripture.tsx
and then search for "verseObjectsArray", which is the structure @larsgson created to solve this within gE
we made progress on this but later found that it only works if the occurrence happens on the first verse, if there is no occurrences on the first verse non of the words would be highlighted for eg php1:1-2,2:5
Edge case 1:
if there is no occurrences in the middle verses then only the words in the first verse would be highlighted
Edge case 2:
working-1.png
If there are no occurrences of the quote in some of the mid verses of a reference range, the occurrence numbers will not match what is actually highlighted. i.e. if we have three verses and the quote refers to a word that only appears in verses one and three, the occurrence numbers for those two words should be 1 and 2, but they are assigned 1 and 3.
Edge case 3:
AREA OF FOCUS (export const selectionsFromQuoteAndString = ({ quote, stringMap: rawStringMap, occurrence, })) this is in selection.js file (https://github.com/unfoldingWord/scripture-resources-rcl/blob/master/src/core/selections/selections.js) line-62
Does this issue scope for occurrences -1 only? Or does it cover Occurrence 2 or more in verse ranges? @abelpz @jincypjose
translationCore Create - v1.11 build 235-a32731d. Highlighting in verse ranges works fine. -1 occurrence highlights all the occurrences in the range and if occurrences are changed to 1 or higher, the correct occurrence of the Quote is highlighted.
If the occurrence number is -1, the word should be highlighted every time it appears in ANY of the verses in the reference range. This is the most common use case, but the current way of highlighting based on specific occurrence numbers (like 1, 2, 3) should still work.