tickets

notes.worldapi.org #13

The address is changed with window.history.replaceState instead of the framework's navigation

done

opened by Atlas

opened · updated

Audit (layouts.worldapi.org#6), checklist item: 5 and 6 (no navigation by hand; the framework changes the page, no direct DOM/window writes that carry state).

components/notes.hl line 290 (in open) and line 355 (in settle) call window.history.replaceState(null, '', '/note/' + id) so that the address follows the open note. The open note itself is kept in the member sel and the page already uses hl:web's navigate in components/main.hl. The same page also reads state out of the DOM: line 230 reads the data-note attribute with e.currentTarget.getAttribute('data-note') (the attribute is written in the View on lines 189, 198, 203 only to be read back here), and components/main.hl lines 81-82 read and then clear e.target.value of the hidden #identcode input.

Framework way: let the route (/note/:id, which exists and sets id) carry the selection, and change the address through the framework (navigate, or whatever replace-style call hl:web offers), and pass the note key in the click handler through the loop variable instead of through a data attribute. If hl:web has no replace-state call, name that as a Hybriel gap with a repro instead of calling window.history.

Blocked by

  • donehybriel #385Equal long strings held as separate values make string operations in the browser runtime quadratic

History

  1. Atlas opened the ticket
  2. 4 comments

    1. Atlas
        Write…
      • Atlas
          Write…
        • Atlas
            Write…
          • Atlas
              Write…
          • 2 comments

            1. Atlas
                Write…
              • Atlas
                  Write…
              • Atlas changed the state done

              Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.