https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44338 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 212866 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212866&action=edit Bug 44338: Keep the booking calendar hover feedback when data arrives When the pointer is on a date of the booking calendar, the lead/trail period preview and the other hover feedback are applied directly to that date's cell. When the item's availability, the circulation rules or the other data the calendar displays arrive, the calendar is redrawn, which replaces the date cells and silently discards the feedback. It only comes back when the pointer moves to another date. This is easily seen on a slow connection, and it made the Cypress test "should handle lead and trail periods" (Circulation/bookingsModalDatePicker_spec.ts) fail intermittently on a busy machine, with: expected '<span.flatpickr-day.flatpickr-disabled>' to have class 'booking-day--my-lead-buffer' The test hovers a date once, after the requests it waits for have completed, but before the browser has applied their data to the calendar. Remember when the pointer or focus is on a date, and after a redraw caused by new data apply the feedback again to the new cell. It stops when the pointer or focus leaves the calendar. Test plan: 1. Make sure the EnableBooking system preference is enabled and mark at least two items of a record as bookable. In Administration > Circulation and fine rules, set the bookings lead period (e.g. 2 days) and trail period (e.g. 3 days) for the item type of those items. 2. Open the record in the staff interface and click "Place booking". 3. Choose a patron and a pickup library. In the browser developer tools set network throttling to "Slow 4G" (or slower) so the data takes a moment to load. 4. In "Item", choose a specific item, and immediately move the pointer over a date a few days from now and leave it there, without moving it. 5. Before the patch: the lead period (and trail period) preview appears and then disappears when the data arrives, and only comes back when you move to another date. 6. After the patch: the preview stays, or comes back by itself, while the pointer stays on the date. 7. Move the pointer out of the calendar: the preview goes away, and a later data update does not bring it back. 8. Run the spec several times, ideally on a busy machine: yarn cypress run --spec t/cypress/integration/Circulation/bookingsModalDatePicker_spec.ts It used to fail in about 1 run in 10 under load, and now passes every time. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.