chime-experiment / Daily_validation

Daily validation notebook
0 stars 0 forks source link

Fix CSD nav buttons: #33

Closed ketiltrout closed 3 months ago

ketiltrout commented 3 months ago

I think this fixes issues with the nav buttons. Test running over here with the production render directory: https://bao.chimenet.ca/daily-test/view

Major points:

Because there's no longer any reason to calculate the next/previous CSD with no opinion (except in cases where the user has clicked one of those buttons), some of the CSD-finding calculation in csd_data has been simplified with the no-opinion-finding pushed into a subroutine that's only called when necessary.

This simplifies things, although this update is more disruptive to the code than I would have liked.

I think in a follow-up PR I'll change things again where the client has a notion of it's preferred revision (set by the button the user clicks on), which it can revert to, when possible. With this change, the server will switch revisions on you if you navigate to a day without the originating revision, which is probably fine, but might be annoying, if you're trying to get to rev 8 days.

(The "prev/next no-opinion" buttons respect the current revision. It's the others that do not (prev/next, first/last).

Bonus fix: if the client specifies no revision, the default revision is now the latest revision, not the first.