1. 06 May, 2020 9 commits
    • Lyza Gardner's avatar
      Merge pull request #2128 from hypothesis/show-sidebar-label · 809f9ab3
      Lyza Gardner authored
      Change show/hide sidebar button label depending on state
      809f9ab3
    • Lyza Gardner's avatar
      Merge pull request #2120 from hypothesis/fix-long-url-overflow · 9403c5a1
      Lyza Gardner authored
      Add word-break rule to prevent long-string overflows
      9403c5a1
    • Robert Knight's avatar
      Merge pull request #2129 from hypothesis/fix-new-note-label · c5063edf
      Robert Knight authored
      Fix "New annotation"/"New page note" label
      c5063edf
    • Robert Knight's avatar
      Fix "New annotation"/"New page note" label · 801a9ee3
      Robert Knight authored
      The button label should be "New annotation" if text is selected or "New
      page note otherwise", but it was the wrong way round.
      
      Fixes a regression introduced in #2102
      801a9ee3
    • Robert Knight's avatar
      Change show/hide sidebar button label depending on state · 5471223e
      Robert Knight authored
      Change the sidebar toggle button from being a toggle button with the
      label "Show annotation sidebar" to a normal button that changes between "Show
      annotation sidebar" and "Hide annotation sidebar" labels.
      
      WAI-ARIA guidelines [1] suggest that both are valid ways of implementing
      toggle actions and looking around web and native apps on macOS one can
      find plenty of both for similar actions. The one clear
      requirement is to use a label change OR aria-pressed, but not both.
      
      We think [2] a label change will make the state slightly easier to quickly
      discern and it provides a more useful tooltip for sighted desktop users.
      
      [1] https://www.w3.org/TR/wai-aria-practices-1.1/#button
      [2] https://github.com/hypothesis/client/issues/2055#issuecomment-622512247
      
      Fixes https://github.com/hypothesis/client/issues/2055.
      5471223e
    • Robert Knight's avatar
      Merge pull request #2102 from hypothesis/preact-sidebar-toolbar · ff015542
      Robert Knight authored
      Re-implement the sidebar's vertical toolbar
      ff015542
    • Robert Knight's avatar
      Remove an obsolete TODO · 51ccbef9
      Robert Knight authored
      This is addressed by the `if @frame` logic a few lines down which only
      adds the toolbar if we're providing our own frame.
      51ccbef9
    • Robert Knight's avatar
      Improve several test descriptions · 7568192d
      Robert Knight authored
      Address PR feedback by rewriting several test descriptions and adding
      comments.
      7568192d
    • Robert Knight's avatar
      Re-implement the sidebar's vertical toolbar · a4d8fa7f
      Robert Knight authored
      This commit re-implements the vertical toolbar on the left edge of the sidebar
      to make future changes to the toolbar UI easier (eg. some upcoming a11y changes)
      and to decouple it from the rest of the annotator application (the toolbar and
      `Sidebar`/`Guest` classes currently access each other's internals in a rather
      haphazard way).
      
      The new implementation has a similar code structure to the `Adder` toolbar that is
      shown when selecting text. It consists of:
      
       1. A Preact component in `src/annotator/components/toolbar`
          which renders the toolbar UI according to the current state
      
       2. A controller class in `src/annotator/toolbar.js` which renders the
          Preact component into a container element and has provides properties
          that the `Sidebar` and `Guest` classes can use to update its state.
      
          The controller takes only the container element and callbacks
          associated with each button as inputs, so it no longer calls methods
          on the Guest/Sidebar.
      
          The sidebar and guest now update the toolbar UI by setting properties
          on the toolbar controller, rather than using a mixture of manual
          manipulation of the toolbar DOM and publishing events which get
          eventually translated to method calls on the toolbar.
      
          If we convert the remainder of the sidebar UI from jQuery/manual DOM
          updates to Preact in future, then we can remove the toolbar
          controller entirely and just render the toolbar component from
          within the sidebar component.
      a4d8fa7f
  2. 05 May, 2020 17 commits
  3. 04 May, 2020 14 commits