• Robert Knight's avatar
    Make sidebar app responsible for opening sidebar to edit draft · f6ac11fc
    Robert Knight authored
    Move the responsibility for opening the sidebar when there is a draft to
    edit from the guest into the sidebar's `FrameSyncService`.
    
    The initial motivation for this was to make the logic in the
    `beforeAnnotationCreated` event handler in the `Sidebar` class work if
    the annotation is created in a non-host guest frame. The plan was to
    make the sidebar send an `openSidebar` request with custom options that
    would trigger the logic that used to be in the `beforeAnnotationCreated`
    event handler.
    
    However it appears that focusing the sidebar frame is no longer necessary. In my
    testing the input field in the sidebar was successfully focused regardless
    of whether `iframe.contentWindow.focus()` was called or not. Therefore I
    have just removed the handler.
    
    Even though the original need no longer exists, moving the logic still
    seems sensible because logically it is the sidebar application that
    knows it is awaiting user input after a new draft is created. It also means that
    if we do find a need to re-introduce the frame-focusing logic that used
    to be in the `beforeAnnotationCreated` handler, we can do so in a way
    that works with annotations created in non-host frames.
    f6ac11fc
Name
Last commit
Last update
..
anchoring Loading commit data...
components Loading commit data...
config Loading commit data...
integrations Loading commit data...
test Loading commit data...
util Loading commit data...
.eslintrc.js Loading commit data...
adder.js Loading commit data...
annotation-counts.js Loading commit data...
annotation-sync.js Loading commit data...
bucket-bar.js Loading commit data...
features.js Loading commit data...
frame-observer.js Loading commit data...
guest.js Loading commit data...
highlighter.js Loading commit data...
hypothesis-injector.js Loading commit data...
icons.js Loading commit data...
index.js Loading commit data...
notebook.js Loading commit data...
range-util.js Loading commit data...
selection-observer.js Loading commit data...
sidebar-trigger.js Loading commit data...
sidebar.js Loading commit data...
toolbar.js Loading commit data...