8000 Added widget header refresh indicator by ranbena · Pull Request #3970 · getredash/redash · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added widget header refresh indicator #3970

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

Merged
merged 10 commits into from
Jul 29, 2019
Merged

Added widget header refresh indicator #3970

merged 10 commits into from
Jul 29, 2019

Conversation

ranbena
Copy link
Contributor
@ranbena ranbena commented Jul 10, 2019
  • Feature

Description

Testing indicator design.
Play with it in the preview.

ezgif com-video-to-gif

Related Tickets & Documents

#3878

@arikfr
Copy link
Member
arikfr commented Jul 10, 2019

It looks good, but why in the right top corner and not in the bottom left where we already have a spinner? Just replace the existing spinner with this one when the query executes?

@ranbena
Copy link
Contributor Author
ranbena commented Jul 10, 2019

It looks good, but why in the right top corner and not in the bottom left where we already have a spinner? Just replace the existing spinner with this one when the query executes?

Our assumption is that it's not clear when a widget is refreshing. It's obvious that the text and spinner are inconspicuous, so that's what I went for with my first experimentations.
But I concluded it's still not clear enough since lower/tall widgets had their bottom part obscured, hiding the indication - so I added the indication up top.
Also, conceptually this type of information feels to me like the "front and center" kind.

I 8000 can make the bottom only version to get the feel and help decide.

@arikfr
Copy link
Member
arikfr commented Jul 10, 2019

But I concluded it's still not clear enough since lower/tall widgets had their bottom part obscured, hiding the indication - so I added the indication up top.

Good point.

It just bothers me that we have multiple spinners and counters. Maybe we should move the counter next to the spinner at the top?

@ranbena
Copy link
Contributor Author
ranbena commented Jul 10, 2019

It just bothers me that we have multiple spinners and counters.

Yeah, it's now 3 corners with refresh spinners :D

Maybe we should move the counter next to the spinner at the top?

Depends what this info is for - to gain a rough estimate of how much longer it's gonna take? To indicate a stuck job?

@arikfr
Copy link
Member
arikfr commented Jul 10, 2019

Depends what this info is for - to gain a rough estimate of how much longer it's gonna take? To indicate a stuck job?

Very deep questions for 11PM ... :-)

Another option is to drop the spinner next to the counter, but keep the counter where it currently is.

@ranbena
Copy link
Contributor Author
ranbena commented Jul 10, 2019

Another option is to drop the spinner next to the counter, but keep the counter where it currently is.

Why not show the timer next to the spinner?

  1. It's not valuable information unless job stuck.
  2. It'll take up widget title real-estate.

Proposed UX:

  1. Remove the bottom spinner and timer.
  2. Show timer in tooltip when hovering the spinner.
  3. When job stuck, change spinner color to red and link to troubleshooting doc from tooltip.

@arikfr
Copy link
Member
arikfr commented Jul 11, 2019

Ok, let's give a try to:

Remove the bottom spinner and timer.
Show timer in tooltip when hovering the spinner.

(we have no concept of "stuck", so we can skip this for now)

@ranbena
Copy link
Contributor Author
ranbena commented Jul 11, 2019

Ok, let's give a try to:

Remove the bottom spinner and timer.
Show timer in tooltip when hovering the spinner.

(we have no concept of "stuck", so we can skip this for now)

Actually, it's a bit more complex than that. The bottom refresh indicator has two more features that can't be easily ported to the top:

  1. Time ago info - important to have at a glance. So can't be put it in a tooltip, nor persist in the widget header.
  2. Acts as a refresh button - but top indicator was designed to be an indication only, not an interactive component (moves away and resizes on hover).

I might need to make some more changes.

@arikfr
Copy link
Member
arikfr commented Jul 11, 2019

Time ago info - important to have at a glance. So can't be put it in a tooltip, nor persist in the widget header.

I thought of keeping only this, and hiding it when the query executes.

@ranbena
Copy link
Contributor Author
ranbena commented Jul 12, 2019

I thought of keeping only this, and hiding it when the query executes.

It doesn't make sense to me. You press a button, it disappears, and an indication shows up at the opposite corner (which might be off-screen).

@ranbena
Copy link
Contributor Author
ranbena commented Jul 12, 2019

I'm trying a different approach - a candy stripe animation atop but my current implementation is cpu intensive and doesn't work well.

ezgif com-video-to-gif (1)

But lmk if you think this has potential.

@ranbena
Copy link
Contributor Author
ranbena commented Jul 12, 2019

Oh and also, if the run time is under an hour I display mm:ss instead of HH:mm:ss.

@arikfr
Copy link
Member
arikfr commented Jul 19, 2019

It doesn't make sense to me. You press a button, it disappears, and an indication shows up at the opposite corner (which might be off-screen).

It shows when the query was executed, so in a way it makes sense that you won't see it when you're currently executing the query.

I'm trying a different approach - a candy stripe animation atop but my current implementation is cpu intensive and doesn't work well.

I think it has potential. Mainly because it works well with the existing elements. The downside is that it feels a bit out of touch with the rest of the visual language of the application.
Maybe we can use an image animation to reduce the CPU overhead?

@ranbena
Copy link
Contributor Author
ranbena commented Jul 27, 2019

Reverted candy stripe and updated the following changes:

  1. Bottom refresh button now shows "last updated" persistently and refresh runtime counter moved to top on hover. Also, removed HH when runtime is under 1 hour.

  2. It was agreed that the bottom spinner adds too much visual noise and that one spinning icon would suffice. So I halted it.
    But this resulted in no clear indication that the refresh has started when clicking the two bottom widget refresh buttons.
    My solution is to have the clicked icon spin till the refresh cycle is done, or the other button gets clicked. All other scenarios they stay still.
    I think it strikes the right balance between usability and visual noise.

  3. Since the timer indication could potentially overlap a long query title, added a semi-transparent underlay.

    Screen Shot 2019-07-27 at 10 25 30

@ranbena ranbena requested a review from arikfr July 27, 2019 07:34
@ranbena
Copy link
Contributor Author
ranbena commented Jul 27, 2019

Also, added a simple dashboard "🔄Refresh" button indication.

@arikfr
Copy link
Member
arikfr commented Jul 28, 2019

My solution is to have the clicked icon spin till the refresh cycle is done, or the other button gets clicked. All other scenarios they stay still.

The inconsistency feels confusing. Maybe they shouldn't animate at all? In most cases they will see the top indicator, so it's clear refresh started.

Also on Ubuntu/Chrome the refresh indicator looks unaligned:
image

@ranbena
Copy link
Contributor Author
ranbena commented Jul 28, 2019

The inconsistency feels confusing. Maybe they shouldn't animate at all? In most cases they will see the top indicator, so it's clear refresh started.

If you played around with it and feel it's inconsistent and visually cluttered - I'm convinced.
But if not - plz do, the experience is the true test of this feature.

Also on Ubuntu/Chrome the refresh indicator looks unaligned:

👍Thanks, fixed. 87a7f44

@arikfr
Copy link
Member
arikfr commented Jul 28, 2019

If you played around with it and feel it's inconsistent and visually cluttered - I'm convinced.

I did play with it, but don't forget I'm biased: I already know what should happen...

@ranbena
Copy link
Contributor Author
ranbena commented Jul 28, 2019

I did play with it, but don't forget I'm biased: I already know what should happen...

Good enough for me.
I revoked the button click spin in ab5494a. But keeping it on the dashboard refresh button.

@arikfr lmk if this feature is complete as far as you're concerned and I'll release it from draft.

@ranbena ranbena marked this pull request as ready for review July 29, 2019 10:57
@ranbena ranbena requested review from gabrieldutra and kravets-levko and removed request for arikfr July 29, 2019 10:57
@ranbena ranbena self-assigned this Jul 29, 2019
@@ -14,7 +14,10 @@ export function Timer({ from }) {
return () => clearInterval(timer);
}, []);

return moment.utc(moment.now() - startTime).format('HH:mm:ss');
const diff = moment.now() - startTime;
const format = diff > 1000 * 60 * 60 ? 'HH:mm:ss' : 'mm:ss'; // no HH under an hour
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@ranbena ranbena requested a review from kravets-levko July 29, 2019 12:34
Copy link
Collaborator
@kravets-levko kravets-levko left a comment

Choose a reason for hiding this comment

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

I like how it looks and works, and the code looks pretty clean 👍

@ranbena ranbena merged commit 6f811f1 into master Jul 29, 2019
@ranbena ranbena deleted the widget-refresh branch July 29, 2019 13:43
@@ -480,6 +490,86 @@ body {
background-color: fade(@redash-gray, 12%) !important;
}

.refresh-indicator {
Copy link
Member

Choose a reason for hiding this comment

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

Something that I missed when doing the review: we need to stop adding styles to redash-newstyle.less. The refresh indicator should've been a component and its style should've been next to it.

Not worth revisiting at the moment, just wanted to point out so we keep this in mind for future stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to be done! #4017

@arikfr
Copy link
Member
arikfr commented Jul 31, 2019

@ranbena ,

I did play with it, but don't forget I'm biased: I already know what should happen...

Now that I had real life experience with it, I can say that I was wrong. When you click on a widget to refresh, it's in the more subtle mode of the refresh indicator. Therefore it's easy to miss, and because the button doesn't animate it feels like nothing happens.

I guess that we should bring back the animation on the button you click you had there...

@ranbena
Copy link
Contributor Author
ranbena commented Jul 31, 2019

I had an alternative I tried - making the buttons have a hover+press+pressed state.
Still, it's enough without the icon spinning.

@ranbena
Copy link
Contributor Author
ranbena commented Jul 31, 2019

Reverted in #4027

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0