• Eduardo Sanz García's avatar
    Show buckets in the bucket-bar for VitalSource · c3f6ebe9
    Eduardo Sanz García authored
    Background information
    
    Currently, the bucket-bar should display anchor positions only from a
    _single_ guest frame. This is because there is no merging mechanism for
    anchor positions from multiple guest frames.
    
    Before this PR
    
    * The host frame listened for `anchorsChanged` events from
    _all_ the guest frames.
    
    * Only _one_ guest frame sent this event. We referred to this guest
      frame as having the 'main' annotatable content.  The 'main'
      annotatable guest frame was identified by not having a
      `subFrameIdentifier` (a configuration option added to a guest frame
      when the Hypothesis client was injected). Hence, the 'main'
      annotatable guest frame was always the frame where the Hypothesis
      loaded initially (in contrast with the injection mechanism).
    
    In this PR
    
    We have reversed the logic of how the `anchorChanged` RPC
    events are send and received:
    
    * _Every_ guest frame sends `anchorsChanged` RPC events to the host
      frame.
    
    * The host frame chooses to listen to only _one_ guest frame for the
      `anchorsChanged` RPC events: the guest frame that connects first with
      the host.
    
    For non-VitalSource case, the first guest frame that connects to the
    host frame is the one where the Hypothesis client was initially loaded
    (doesn't contain `subFrameIdentifier` option).
    
    For the VitalSource, because of #4176, there is no guest frame in the
    host frame. This allows the guest frame in the book content, where the
    Hypothesis client was injected, to send anchor positions, and positions
    to be reflected in the host's bucket-bar.
    c3f6ebe9
Name
Last commit
Last update
.github Loading commit data...
bin Loading commit data...
dev-server Loading commit data...
docs Loading commit data...
embedding-examples Loading commit data...
images Loading commit data...
requirements Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.dockerignore Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.prettierignore Loading commit data...
.python-version Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Dockerfile Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
codecov.yml Loading commit data...
gulpfile.mjs Loading commit data...
package.json Loading commit data...
pyproject.toml Loading commit data...
requirements-dev.in Loading commit data...
rollup-boot.config.mjs Loading commit data...
rollup-tests.config.mjs Loading commit data...
rollup.config.mjs Loading commit data...
tailwind.config.mjs Loading commit data...
tox.ini Loading commit data...
tsconfig.json Loading commit data...
yarn.lock Loading commit data...