eeditiones / tei-publisher-components

Web components used by TEI Publisher and apps generated by it
https://cdn.tei-publisher.com/
GNU General Public License v3.0
18 stars 14 forks source link

Improve browser history support and URL handling #123

Closed wolfgangmm closed 1 year ago

wolfgangmm commented 1 year ago

This PR addresses some long standing problems with components in TEI Publisher and introduces a consistent state handling. In particular, two use cases are targeted:

  1. bookmarkable URLs: users expect that navigating to a given URL will consistently result in the same display (i.e. restore a certain state). If users bookmark a specific page of a document shown in TEI Publisher's pb-view, they expect that the same page is displayed when they open the bookmark again.
  2. browser history navigation: the user interacts with the application, i.e. triggers actions, which cause components to change state – but without leaving or reloading the page. Moving back or forward in browser history should consistently restore the previous or following state.

All components now rely on a central registry for the management of their state. The registry is the single source of truth for both use cases described above.

For this PR nearly all components had to be refactored, which resulted in a long list of changes over months. Nevertheless we tried to preserve backwards compatibility. Consequently, no major release is needed.

line-o commented 1 year ago

We are down to a single failing test.