Skip to content

Snap slider over empty months in direction of travel#63

Open
jakejellinek wants to merge 1 commit intomainfrom
feat/slider-skip-empty-dates
Open

Snap slider over empty months in direction of travel#63
jakejellinek wants to merge 1 commit intomainfrom
feat/slider-skip-empty-dates

Conversation

@jakejellinek
Copy link
Copy Markdown
Contributor

Summary

  • When the user drags the date slider to a month with no data, the slider now snaps to the nearest populated month in the direction of travel (right if moving forward, left if moving backward)
  • No flicker — uses populated_dates from the backend TimeRange response to know upfront which months are empty
  • Ticks and line length are unchanged; the slider just jumps over gaps
  • Requires the backend change in flowkit-ui-backend#29 to be deployed first (falls back to all_dates if populated_dates is absent, preserving current behaviour)

Test plan

  • Drag slider rightward into the June–October 2025 gap — should snap forward to November
  • Drag slider leftward into the gap — should snap back to May
  • Verify normal months still work as before

When the user drags the date slider to a month with no data, it now snaps
to the nearest populated month in the direction they were dragging — right
if moving forward, left if moving backward — instead of stopping on an
empty slot and clearing the map.

Uses populated_dates from the backend TimeRange response to know upfront
which dates have data, so the snap is instant with no flicker.
@jakejellinek jakejellinek force-pushed the feat/slider-skip-empty-dates branch from 94bc9af to 0219d94 Compare March 24, 2026 16:39
@jakejellinek
Copy link
Copy Markdown
Contributor Author

Not sure if we want this / if it is a user experience improvement. We could test in Dev and see if we like it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant