Project

General

Profile

Bug #2755

Clicking a verse causes a complete reload

Added by Luke Murphey over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
High
Assignee:
Target version:
Start date:
05/21/2020
Due date:
% Done:

100%

Associated revisions

Revision 1157 (diff)
Added by luke.murphey over 4 years ago

Fixing caching issues when merging in verse info

Reference #2755

Revision 1158 (diff)
Added by luke.murphey over 4 years ago

Code cleanup

Reference #2755

Revision 1159 (diff)
Added by luke.murphey over 4 years ago

Adding a description of the verse to the output

Reference #2755

History

#1 Updated by Luke Murphey over 4 years ago

  • % Done changed from 0 to 70
Qs:
  • How does the history get loaded right now?
    • Uses setTimeout in highlightVerse()
  • When is updateHistory() called? Would I need to include the ability to set history with this?
    • navigateToChapter()
      • changeWork()
      • onSelectWork()
      • changeChapter()
      • goToReference()
      • goToNextChapter()
      • goToPriorChapter()
    • From loadChapter() when redirected
      • This one could use the verse to highlight
  • Why does highlightOverridden have to exist in Chapter?
  • How would I select the verse with https://github.com/remarkablemark/html-react-parser?
Solns:
  • Have onVerseClick() loadChapter directly
    • Would not update the URL
    • Would not fix history lookup
  • [Partial Fix] Keep a history of verses to chapters, don't reload accordingly
    • This works, but you need to handle two others things:
      • Know what chapter to load when the user changes to another verse in another chapter
  • Have a call de-reference the verse before loading it
    • Not sure that the call is actually necessary
  • [Done] Do I have a way to determine what chapter is loaded?
    • The reference list does support this now
  • What are the scenarios to test?
    • [Done] Load chapter plain, change verse
    • [Done] Load chapter, change verse, change to another chapter, change to verse, then use browser back button to go to first chapter
      • This doesn't work yet because loadChapter() doesn't use the cached href
      • I could make loadChapter use the href, but Chapter doesn't
    • [Done] Load chapter/verse, change verse
    • [Done] Load chapter, change verse, change chapter, change verse, use browser back button once
      • This loads the chapter again because I am not populating the reference list on first load
      • I have this working, but it doesn't update all of the UI (like the verse indicator in the reference input nor the highlighted verse
  • [Done] Have history push the ID of the verse so that it can be reloaded
  • Use the match.params to find the verse number and setState accordingly
    • I'm not sure how to determine if this URL includes a verse reference though
  • [Done] Parse the HTML and select the verse
Obs:
  • Overall, I don't like how verse handling works as it pertains to verses
    • Mapping verses to chapters is hard to know (is a verse part of the current chapter?)
  • Chapter doesn't know what chapter is loaded and thus include it in the onVerseClick handler

#2 Updated by Luke Murphey over 4 years ago

Problem: the verse reference doesn't change when the user navigates via the browser back/forth buttons.

Qs:
  • What states are based on the reference?
    • URL (already handled)
    • Selected verse (already handled)
    • Reference in input box

#3 Updated by Luke Murphey over 4 years ago

  • Status changed from New to Closed
  • % Done changed from 70 to 100

Also available in: Atom PDF