Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time navigation buttons #8546

Closed

Conversation

jgowdyelastic
Copy link
Member

@jgowdyelastic jgowdyelastic commented Oct 5, 2016

Adds zoom in/out and move left/right buttons to kibana's time picker.

Closes #1956

@epixa
Copy link
Contributor

epixa commented Oct 5, 2016

jenkins, test this

@epixa
Copy link
Contributor

epixa commented Oct 5, 2016

@jgowdyelastic Can you reissue this PR against master? We'll then backport it to 5.x.

@jgowdyelastic jgowdyelastic changed the base branch from 5.x to master October 5, 2016 13:09
@jgowdyelastic
Copy link
Member Author

Done, rebased on master and PR is now against master.

@epixa
Copy link
Contributor

epixa commented Oct 5, 2016

@jgowdyelastic Thanks!


// travel forward in time based on the interval between from and to
$scope.foward = function () {
var time = getFromTo();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should all be const unless you will be overriding the reference, in which case they would be let.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, good point. i've pushed a change for this.
This was just copied from the kibana 4.x prelert app, which doesn't have much ES6 syntax.

@thomasneirynck thomasneirynck self-assigned this Oct 5, 2016
@LeeDr
Copy link

LeeDr commented Oct 6, 2016

Please add automated and/or manual tests for this new feature.

@dimitris-athanasiou
Copy link
Contributor

Just letting you folks @jgowdyelastic is on vacation, back on Tuesday 11th. He is not ignoring you all.

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I like the addition. It is very useful addition I think.

I only have some real minor cosmetic things.

@@ -2,6 +2,7 @@ import moment from 'moment';
import UiModules from 'ui/modules';
import chromeNavControlsRegistry from 'ui/registry/chrome_nav_controls';
Copy link
Contributor

@thomasneirynck thomasneirynck Oct 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this import is obsolete. linter was also complaining about unused function arguments in this file as well: config, newval, oldVal, $el, attrs

While we're at it, we may as well remove them ;)


time.from.subtract(diff, 'milliseconds');
timefilter.time.to = origFrom;
timefilter.time.from = time.from.toISOString();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: consider reordering the to/from assignments for symmetry with all the others.

@@ -25,6 +26,73 @@ UiModules
$rootScope.toggleRefresh = () => {
timefilter.refreshInterval.pause = !timefilter.refreshInterval.pause;
};

// functions for the time navigation buttons
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: consider removing this comment, I think the code is nice & dense enough to be self explanatory.

from: moment(timefilter.time.from)
};
} else {
timefilter.time.mode = 'absolute';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: consider not doing the side-effect in this getter/setter. If you prefer to avoid two function-calls, perhaps rename this function to something like setToTimeToAbsoluteAndGetToFrom (yeah, i know :$). But now, this state change is a little buried.

@@ -20,6 +20,9 @@
</li>

<li>
<i ng-click="zoomIn()" class="time-nav-btn fa fa-search-plus ng-scope"></i>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: I wouldn't mind tooltips on these buttons actually. 'move [forward|backward] in time', 'zoom out timeline', 'zoom in timeline'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tooltips added

@@ -28,5 +31,6 @@
<i aria-hidden="true" class="fa fa-clock-o"></i>
<pretty-duration from="timefilter.time.from" to="timefilter.time.to"></pretty-duration>
</button>
<i ng-click="foward()" class="time-nav-btn fa fa-arrow-right ng-scope"></i>
</li>
</ul>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry to hijack this PR for something a little broader ;)

image

With the 4 new additions, the top toolbar now looks like the above. From a UI perspective, would it make sense to better isolate the timepicker tools from the "new/save/open/share" buttons. Both are unrelated thematically. Putting a divisor in between/shading background differently/ .... might make the grouping a little clearer. @alt74, @cjcenizal, thoughts (?)

Copy link
Contributor

@cjcenizal cjcenizal Oct 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that, ultimately, we should rebuild the timepicker component so that these arrow buttons are part of the dropdown that appears when you click the time range. I don't think the user needs to have them visible at all times. However, this will take some time to implement, and I don't think we should hold up this PR for that.

I think the immediate problem is that the "back" arrow blends in with the + and - icons. We can create the separation you mention by moving them both to the right side, and letting the time range itself create visual separation:

image

As an additional benefit, the user doesn't need to move the mouse as far when navigating back and forward in succession.

What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that the timepicker controls should be obviously separate from the rest of the menu.
I've added a separator as I think it's the simplest and less intrusive solution.
untitled

I prefer the arrow buttons being either side of the date range as it's obvious that you'll be moving either side of the displayed range.
But it doesn't make too much difference either way. So I'm happy to be overridden.

Ultimately I think these controls should remain in the navigation bar and not inside the dropdown. They provide a fast way of navigating through time and made a noticeable difference when we originally added them to the Prelert app.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good. I'm not 100% confident about it but that's because I haven't used it as much as you have. Once I've had the chance to use it for awhile I'm sure I'll either be on board or be able to provide some better suggestions. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, the arrows work better on either side of the range, for the reasons mentioned by @jgowdyelastic

@epixa epixa removed the review label Oct 8, 2016
@@ -232,6 +232,11 @@ a {
background-color: transparent;
border-radius: 0;
}

i.time-nav-btn {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be .time-nav-btn because using the element selector increases the selector's specificity unnecessarily.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. element selector removed

@@ -28,5 +31,6 @@
<i aria-hidden="true" class="fa fa-clock-o"></i>
<pretty-duration from="timefilter.time.from" to="timefilter.time.to"></pretty-duration>
</button>
<i ng-click="foward()" class="time-nav-btn fa fa-arrow-right ng-scope"></i>
</li>
</ul>
Copy link
Contributor

@cjcenizal cjcenizal Oct 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that, ultimately, we should rebuild the timepicker component so that these arrow buttons are part of the dropdown that appears when you click the time range. I don't think the user needs to have them visible at all times. However, this will take some time to implement, and I don't think we should hold up this PR for that.

I think the immediate problem is that the "back" arrow blends in with the + and - icons. We can create the separation you mention by moving them both to the right side, and letting the time range itself create visual separation:

image

As an additional benefit, the user doesn't need to move the mouse as far when navigating back and forward in succession.

What do you think?

@alt74 alt74 added the Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. label Oct 11, 2016
@tbragin
Copy link
Contributor

tbragin commented Oct 23, 2016

Could I ask for some screenshots or a quick animated gif in this PR? Will help reviewers that don't have time to check it out to at least have an idea where in the interface these new buttons are.

@@ -218,6 +218,8 @@ a {
}

.navbar-timepicker {
border-left: 1px solid @kibanaGray4;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for me, I think it looks good.

@thomasneirynck
Copy link
Contributor

@tanya this was buried in one of those "outdated" collapsing sections, but here is a screenshot to what it looks like: #8546 (comment). The arrows move the time forward and backward with the size of the current interval, and the magnifiers zoom out and or zoom in the time with a factor of two

@@ -25,6 +26,71 @@ UiModules
$rootScope.toggleRefresh = () => {
timefilter.refreshInterval.pause = !timefilter.refreshInterval.pause;
};

// travel forward in time based on the interval between from and to
$scope.foward = function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, foward -> forward

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha, embarrassing....
i've corrected this, thanks

@kimjoar
Copy link
Contributor

kimjoar commented Oct 24, 2016

I find the icons confusing, but there are tooltips so it's probably good enough. However, I think we should add better descriptions to the tooltips. For example, I think Zoom in and Zoom out are unclear about what you're actually doing (Maybe something along the lines of Double the timespan — or maybe we already have some other word we use for the timepicker range(?)).

Also, to me something looks off about the spacing between all the timepicker controls. I think it needs tighter spacing between the controls, plus I think it should have the same amount of padding on each side of the new border.

@ppisljar
Copy link
Member

ppisljar commented Oct 24, 2016

this looks really great!

icons are quite clear to me, also positioning makes sense. Zoom in makes more sense to be than Double the timespan ... but i agree we could come up with a better tooltip.

alignment and spacing between elements don't look right to me:
screenshot-localhost 5601 2016-10-24 10-18-56

  • padding on icons (10px) is different that on timepicker button (15px)
  • timepicker button has line-height defined as 20px (should be 16 as everything else in this toolbar)
  • icon inside timepicker button sets vertical-align: middle (button does the same which misaligns things)
  • button has 1px trans border, which misaligns things
  • there is some additional spacing on the left and right (3px) and i have no idea where it comes from.
    untitled

@Bargs
Copy link
Contributor

Bargs commented Nov 4, 2016

I'll echo what @tbragin said, some screenshots and a gif in the description, along with some extra explanation of the details of how this is supposed to behave would be very helpful.

@ppisljar ppisljar removed the v5.1.0 label Nov 21, 2016
@Bargs Bargs assigned lukasolson and unassigned Bargs Nov 22, 2016
@lukasolson
Copy link
Member

Replaced by #9253.

@lukasolson lukasolson closed this Nov 29, 2016
daveyholler added a commit to daveyholler/kibana that referenced this pull request Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Timepicker Timepicker release_note:enhancement Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. tests_needed v6.0.0-rc1 v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.