superset icon indicating copy to clipboard operation
superset copied to clipboard

[Design Proposal] Improve SQL Lab Editor Resizer

Open thinmatt opened this issue 7 years ago • 13 comments

The current UI of the SQL Resizer is not as discoverable as it could be. Want to update the UI to use a more standard convention than he single 2px rule. In addition, the location of the resizer between the SQL Toolbar actions and the results tabs does not communicate to users that sql editor pane is resizeable. I've seen users struggle with this as I've observed them use SQL lab.

My recommendation would be to

  • (1) add an additional UI element to the resizer component to hint that the resizer can be "grabbed." A single line isn't often enough to communicate that concept in a UI (especially with borders on so many elements in the SQL Lab layout).
  • (2) assess the location of the resizer element or the visual design of the SQL Toolbar actions. From a UI standpoint, it would be more intuitive for the resizer component to be above the SQL toolbar or for the SQL toolbar to visually match up with the editor pane -- that way the resizer is the true visual edge of the editor pane

I have attached a few different UI mocks to represent the ideas:

Additional UI for resizer with resizer at the visual botton of the sql editor pane

sql lab pull - 3 1

Making the SQL toolbar visually a part of the editor

screen shot 2018-12-21 at 2 11 55 pm

Both concepts combined (recommended approach)

sql lab pull - 3 3

If it's decided that we want to make the SQL toolbar visually appear as a part of the SQL editor pane, we will need to make a small adjustment to how Ace Editor styles the gutters (likely a simple override in the styles). Ace currently darkens the gutters, which in and of itself isn't an issue, but when you get to more than 10 lines of code, the gutter widens slightly. My recommendation would be to make the gutter the same color as the main editor pane, then add a border-right to designate where the right most part of the gutter is.

thinmatt avatar Dec 21 '18 23:12 thinmatt

@thinmatt can we put some thought into where those buttons should be placed if within the SQL editor panel? ie. usually action buttons are in the lower right. also, SQL queries tend to be more vertical than wide, so gives more usable real estate for the SQL query if it's over in the lower right. thoughts on why parameters is over there vs. with the other ones? i'm not sure how i feel about the buttons being in the editor itself, but i think it's because it's something i'm not used to. not against, but may take some time to sink in

vylc avatar Dec 21 '18 23:12 vylc

For the "Making the SQL toolbar visually a part of the editor" (2nd mock). How would it look if the SQL code has many lines and exceed the editor height?

  • How would it look with scrollbar on the right?
  • Does the code still show up behind the button? If there is a hard-end above the buttons, this seems a bit odd without border or some kind of indicator.

kristw avatar Dec 24 '18 12:12 kristw

I agree with @thinmatt that we need an additional UI element to indicate the panel is resizable. Also agree with making "the SQL toolbar visually match up with the editor pane -- that way the resizer is the true visual edge of the editor pane".

How about this, which would accomplish both of the above without introducing buttons overlaid on query text?

sql lab pull

We could also consider, as @vylc mentioned, moving the action buttons to the lower right where the current "parameters" and timer are, but I think that update addresses a different issue than this ticket.

dorq avatar Jan 03 '19 22:01 dorq

I like @dorq 's proposal. The color difference between the light and dark grey should serve as a natural divide between code and the button area (i.e. code in the light grey area only). When the scorbar comes up, it would only scroll the code area.

I'm not sure where we want to left-align the 'Run Query' button. It looks a bit odd somehow to me to have it aligned "into the gutter" (now that the button area is the same grey, the left end of it looks like an extension of the gutter to me).

I was thinking perhaps we could align it to the right side of the gutter. As @thinmatt pointed out, the gutter of the ace editor (code area) resizes based on the digits of the line number so in order to align the buttons to the right side of the gutter, we would need to reposition the buttons as the code area grows, which is silly. One possible way around it is to push all the buttons to the right. Perhaps?

xtinec avatar Jan 04 '19 00:01 xtinec

I like the idea of pushing all the buttons to the right. A couple of questions following up on that...

  • Are the "parameters" button and time functionally different than the other buttons? Would we want to keep them in a separate group from the other buttons?
  • Would we want to reverse the order of the buttons so that the default "Run Query" is at the far right?

cc @vylc

dorq avatar Jan 04 '19 00:01 dorq

Here's what the buttons look like indented to the right side of the gutter (even though we won't do exactly this), in case it's helpful: sql lab pull - indent

dorq avatar Jan 04 '19 00:01 dorq

We could try a subtle top border to the buttons container to distinguish it from the gutter: image

This also helps denote the scroll area.

dorq avatar Jan 04 '19 01:01 dorq

Recently I tweaked the CSS at tiny bit in an unrelated PR. I made the separation brand-blue (though low opacity) and made it a bit wider. Not sure if that's enough. We should probably also empty the content of the boxes while dragging to prevent the bad lags.

I don't think it's great/ideal by any mean, but a tiny bit more discoverable than before.

durtjlllq1

mistercrunch avatar Jan 04 '19 06:01 mistercrunch

Thanks @mistercrunch! I agree that we should be careful about the lag while dragging; thanks for pointing that out. I do still think we want to add a visible handle and improve the grouping of the buttons with the query text area, to make this even more discoverable and intuitive.

Would love to hear your and everyone's thoughts on https://github.com/apache/incubator-superset/issues/6565#issuecomment-451327291

dorq avatar Jan 04 '19 16:01 dorq

re: button organization and placement - we should probably table that right now since there will be even more with lightweight pipeline functionality. Ideally (not in any particular order): Group 1 - Execute: Run query, Run query & create table Group 2 - Do something with SQL: Save query, share query Group 3 - Advanced SQL Editing: Parameterize query, possible UDF stuff Group 4 - Advanced Execute: Backfill, Schedule, Make Dependent

I think we tackle in this order: (1) Add grip bar/handle to existing separator w/out touching buttons (image) (2) Figure out where we want to place buttons, whether or not that's in the SQL editor, an extended part of the gray area from the editor, etc. (3) Button re-org screen shot 2019-01-04 at 10 33 16 am

vylc avatar Jan 04 '19 18:01 vylc

Related: https://github.com/apache/incubator-superset/pull/6593

mistercrunch avatar Jan 05 '19 17:01 mistercrunch

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar May 19 '19 01:05 stale[bot]

Fixed, props to @xtinec!

mistercrunch avatar May 19 '19 16:05 mistercrunch