The client now knows nothing about the target of PNO and NNO buttons. Instead, it just sends a request to the server to tell it where to go.
Navigation as a whole is now revision independent. Revision will change if navigation to a CSD without the current revision occurs.
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.
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.