This improves the design of the session view a lot. However, several
things still need to be done:
1. The rules section is not styled.
2. The session list is not styled.
3. The design is not responsive yet. This will take longer, as the base
view will need to be overhauled substantially to take advantage of
wider screens.
4. A light mode needs to be added.
This is a more flexible system than the previous goal variable. It makes
it possible to conform to the association rules, without sacrificing
backwards compatibility. Also, it makes it easier to add other
changeable rules later on.
The base view now does a better job at keeping the sessions list up to
date with the current session, without having to reload it all the time.
The purpose of this is to be able to show the list and the current
session at the same time, and keep them in sync without polling the
database.
The previous implementation only looked at the URL (and state) during
initialization. This allowed users to open a specific session via URL
(e.g. when reloading the page).
History navigation, however, was completely ignored. I.e. if the user
pressed the back button the URL would change, but the content would
remain the same.
This has now been corrected.
The purpose of this is data safety. If there ever was a broken model
that corrupted data previously it would have ruined everything if it
coincided with a schema migration. Now this is much less likely.
This will be needed for database upgrades going forward. For example, an
old session without an update timestamp will not be visible in the index
that will soon be added. But since the UI will switch to that index, it
is paramount that all sessions are part of that.
The session model was built with that in mind, and has the corresponding
"update" logic. However, for that to matter old records first need to be
readded to the database.
It was gettig tedious to add the change tracking logic in all of the
methods. And since there likely will be many more such methods, I have
now extracted that bit into its own function.
This makes editor help, such as autocomplete, much more usefull, while
still allowing me to use absolute paths for imports. The latter is
needed, so that I don't need an extra build step and also don't need to
wory too much about browser imports.
Does this violate the _browser based development_ principle? Yes, a tiny
little bit. However, using an editor is basically required, and making
it that much better seems worthwhile.
Did I waste too much time trying to make this perfect? Also yes. A
strong reminder why that principle is so important.
Specific sessions can now be opened by setting a query param to their
id. This is needed to allow users to reload the page without being
kicked out to the session selection.
The tailor calculation did not go down to one point if the losing team
scored points only after the winning team reached the tailor goal. This
has been fixed.
This made me realize that I forgot to write tests for the `results`
property of the game and session models. Those will follow in a later
commit.