MathJax-src icon indicating copy to clipboard operation
MathJax-src copied to clipboard

Explorer rewrite

Open zorkow opened this issue 2 years ago • 0 comments

Rewrite of the explorer that fixes a number longstanding issues and introduces the new auto voicing feature.

Explore Pool

All explorers for a MathItem are now held in a dedicated ExplorePool object. Consequently, all explorers in one pool use only one highlighter, which is administered by the pool. Consequently there should no longer be interaction of highlighting by multiple explorers. In addition, the pool offers a second highlighter used for synchronised highlighting during auto voicing (see below).

The pool also ensures clean re-attaching and restarting of explorers on re-rendering. In that case all the explorers are re-initialised, while the pool stays the same object. As before, upon re-rendering we try to continue exploration at the sam position in the term as before (e.g., when a sub-term was collapsed on that sub-term). This works, well in the case of our collapse actions, however in the case of general toggle actions, this can potentially end in the wrong element.

Autovoicing

This is implemented in the new SpeechRegion class that takes care of extracting the SSML returned from SRE, putting together the utterances for the speechSynthesis API and the synchronised highlighting. This is superimposed in red over the normal level highlighting. I was originally thinking about using a frame but my CSS attempts looked ugly.

Note, that autovoicing is currently hidden behind a flag. In the future we should have a hotkey for switching it on. Note also, that at the moment SpeechRegion this is still a live region.

Exploration method

Replaces aria role application with tree. There is relatively little else done, as we can simply reuse the ARIA structure that SRE already produces given the structure feature. I am still in the process of testing this in more detail, so we might need another PR, once that is fully worked out.

SRE version

This currently needs SRE v4.1.0-beta.1 to work.

zorkow avatar Sep 14 '22 17:09 zorkow