Open lyonsil opened 2 months ago
I don't have access to BUX-17 (no YouTrack account - this is an issue for several of us) so I can't see what I need to respond well, but here are some questions around the implementation:
Ira, regarding your question 3, I imagine you probably have much more context to work with inside the editor such that you could make a better, less-hacky version of the scrolling than I did. Would be great if you could investigate sometime what it would look like to implement the scrolling inside the editor (maybe with a prop to enable/disable) and we could compare.
Regarding your question 2, I believe UX wanted me to try to scroll so 3 lines above the current focus were visible for the UX testing they did. I was too lazy to get the literal line height in pixels in order to do the scrolling, though, so I faked it haha
Another note: I think it would be especially helpful to have this kind of scrolling (or at least verse click handler) functionality in the editor itself so other contexts can have this functionality without having to rewrite it themselves. Like in the text collection, we don't have scrolling or verse selecting hooked up because all that code is only in the editor web view even though the text collection web view is using the editor component.
It might be worth mentioning: when a pane gets focus, before updating the scroll location of all other panes, first check whether the current verse is already in view in all panes. For a while we had really annoying behaviour in Paratext where one or two panes would needlessly update their scroll location as a user clicked between panes.
This might be a natural time to hook up the editor selection into web view state
Reworking this and #788:
Example of tracking which iframe has focus https://jsfiddle.net/9285tbsm/9/ unfortunately it doesn't work if you click one iframe then the other. Only works if you click top again. Not a great solution
User Story As a user, I want to have different tabs scroll together at different references so that I can view different texts at different places in Scripture for things like Parallel Passages or cross references.
Description Implement the functionality side following the UX Scroll Group Design at https://paratext.myjetbrains.com/youtrack/issue/BUX-17.
Make this work with the editor as a starting point. It is assumed that the mechanism determined would work with other extensions.
Making scroll groups work with other applications running in the OS at the same time is out of scope for this ticket.
One possible implementation:
getScrRef
andsetScrRef
as if they could be data provider methods and madeonDidUpdateScrRef
to go with them. This fit my needs better this time. I think, once we open the data provider event up to listeners, we could rework this without much of a problem as a data providerscrollGroupScrRef
to web view definition updatable propertiesuseWebViewState
useScrRefScrollGroup(): [scrRef, setScrRef, scrollGroup, setScrollGroup]
?