Closed Reptilioo closed 3 weeks ago
As a user of the app, it would be convenient to have this feature. As far as intensivity is concerned, my experience is that we tend to underestimate how efficient modern devices are. In saying that if you want to implement it we can do a quick profile of it and see how it goes.
When the user goes from english-only to showing pali the text of the page is shifted, so if the user was trying to check a specific word in pali in the current paragraph he is reading, he is going to have to search again for that specific paragraph.
I was thinking about using an IntersectionObserver on every ".segment" so as to always know which ones are currently displayed and being able to use a similar function than
scrollToHash()
so as to scroll to the last displayed paragraphs before the user clicked on "Toggle Pali" button.But I have never used an IntersectionObserver and I prefer to ask for insights about whether or not this might be too intensive for our app or if there might be better ways to do that, before implementing it.
Something like that to know which segments are displayed: