2.1 KiB
User Preferences, Page State, Bookmarkability and Navigation History
We have a number of pages or places that build up complex state as the user works with them. For example, a leaderboard has its settings (which columns are shown) and other, non-setting state such as the expansion state of the race columns. When the user navigates away from such a page, settings and other state are currently lost, and browser back/forward history navigation doesn't bring it back. The settings can only partly and rather inconsistently be captured in URL parameters and therefore cannot be reasonably bookmarked. The non-setting state cannot be expressed in URL parameters at all.
The problem becomes even more evident for the RaceBoard.html entry point which represents our 2D race viewer. It contains several components, each of which having their own settings and their own non-setting state. For example, the time slider has a refresh interval setting, and its non-setting state consists of the current play state (playing/paused, live/replay), the current time point, its zoom state and the acceleration factor. The same holds for the chart components. The leaderboard component has the same setting and non-setting state as described above for the leaderboard entry point. Finally, the map has important non-setting state in addition to its comprehensive settings state, particularly its pan/zoom state, the map type (satellite / map) selection and the scale unit selection (feet / meters). The overall page then has additional state describing the components' visibility (Is the leaderboard currently expanded? Is a video being shown? ...).
We need a consistent pattern for serializing settings and non-settings state of all components as well as of an overall page composing the components. The serialized form of these settings can then be stored in the Place part of a URL and the user managements' user data store. The Place URLs can then be managed by the browser history, so the back/forward navigation will re-construct the entire page state. Sharing such a link will allow the receiver of the link to re-construct the entire page state exactly the way it was when the link was created.