unfoldingWord / tc-create-app

translationCore Create
https://create.translationcore.com/
MIT License
0 stars 5 forks source link

Highlight when multiple verses are in the reference field in TSV7 #1491

Closed birchamp closed 1 year ago

birchamp commented 1 year ago

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.

birchamp commented 1 year ago

@jincypjose we need to know how big of an effort this is.

jincypjose commented 1 year ago

@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

jincypjose commented 1 year ago
  1. 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: failing-2.png

  2. 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.pngfailing-1.png

  3. 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: Screenshot from 2023-03-07 20-03-23 Screenshot from 2023-03-07 20-03-35 Screenshot from 2023-03-07 20-03-42

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

elsylambert commented 1 year ago

Does this issue scope for occurrences -1 only? Or does it cover Occurrence 2 or more in verse ranges? @abelpz @jincypjose

elsylambert commented 1 year ago

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. Screenshot 2023-03-16 at 10.01.54 AM.png