Conversation
VisTimeline only set the vis-timeline min/max options when updateTimelineWindow was passed, which only the Timeline view does. The Daily Timeline visualization on the Activity page passes a queried interval but not that flag, so once events loaded it could be scrolled far outside the day it renders. Set min/max from the queried interval whenever one is provided, and keep only the setWindow() reset behind updateTimelineWindow. Fixes ActivityWatch#996
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #998 +/- ##
=======================================
Coverage 57.66% 57.66%
=======================================
Files 51 51
Lines 3231 3231
Branches 794 794
=======================================
Hits 1863 1863
- Misses 1291 1352 +61
+ Partials 77 16 -61 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
vis-timeline doesn't re-clamp the visible window when min/max change, so a Daily Timeline left zoomed into one day would stay on it after switching days. Reset the window whenever the bounds move, and keep the user's zoom when the same interval is re-rendered.
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #996.
Problem
The "Daily Timeline (Chronological)" visualization on
/#/activitycan be scrolled far past the start and end of the day it shows, where there's nothing to see.VisTimeline.update()only set vis-timeline'smin/maxoptions whenupdateTimelineWindowwas passed. OnlyTimeline.vuepasses it;SelectableVisualization.vuepassesqueriedIntervalbut not the flag. So once events loaded, the Activity page's timeline had no scroll limits. (The empty-data branch did setmin/maxfromqueriedInterval, so the bounds depended on which branch happened to run last.)Change
options.min/options.maxfromqueriedIntervalwhenever it is provided (as well as whenupdateTimelineWindowis set, same as before).setWindow()whenupdateTimelineWindowis set (as before) or when the bounds actually change. vis-timeline'sRange.setOptionsstores newmin/maxwithout re-applying the current range, so without this a view zoomed into one day would stay there after switching days. Re-rendering the same interval (e.g. a data refresh) keeps the user's zoom.Callers without a
queriedInterval(Bucket view, Report, search results) behave the same as before.Tests
Added regression tests to
test/unit/VisTimeline.test.jsforupdate():queriedIntervalwithoutupdateTimelineWindow(fails before this change)updateTimelineWindow, bounds are set and the window is resetqueriedInterval, no bounds are set