2016-09-25, 06:09 PM
When one or more shows overflow past midnight, it is possible to scroll the modern guide so far that the shows are no longer aligned with the proper header/footer timestamps. I also noticed that if a channel has a show that starts right at midnight, it would be included at the end of the listing line.
The latter bug is very easy to fix: subtract 1 second from the end-time calculation (start + 86400 - 1).
The first bug has 2 possible fixes: prevent the shows from scrolling past midnight, or pad out the header/footer to be able to scroll as much as the listings. I chose the latter fix because I think it is valuable to be able to see a show in its full length in one spot in the guide (since it's truncated at the start of the day).
In my patch I changed the time-container divs to have an overflow div at the end with a horizonal ellipsis instead of a time. If there is no overflow, that div ends up with zero width and is invisible (I tested this with a one-channel group that doesn't overflow midnight to make sure of that). I then made the listing thread return back one extra payLoad item in its array: the max width of its line. The caller uses this value to see if the time-containers are wide enough yet, and if not, it adjusts the outdiv's width and the line-ending pad-div's width to fill in the gap.
The end result is a nice scrolling experience where all 3 divs are now the same width and thus stay aligned all the way across.
The patch: http://opencoder.net/npvr-hscroll.patch
The latter bug is very easy to fix: subtract 1 second from the end-time calculation (start + 86400 - 1).
The first bug has 2 possible fixes: prevent the shows from scrolling past midnight, or pad out the header/footer to be able to scroll as much as the listings. I chose the latter fix because I think it is valuable to be able to see a show in its full length in one spot in the guide (since it's truncated at the start of the day).
In my patch I changed the time-container divs to have an overflow div at the end with a horizonal ellipsis instead of a time. If there is no overflow, that div ends up with zero width and is invisible (I tested this with a one-channel group that doesn't overflow midnight to make sure of that). I then made the listing thread return back one extra payLoad item in its array: the max width of its line. The caller uses this value to see if the time-containers are wide enough yet, and if not, it adjusts the outdiv's width and the line-ending pad-div's width to fill in the gap.
The end result is a nice scrolling experience where all 3 divs are now the same width and thus stay aligned all the way across.
The patch: http://opencoder.net/npvr-hscroll.patch