-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
fix(sqllab): Handle long table names in SQL Lab #10518
Conversation
How does the width look when the tables don't have long names? is it too ridiculous? |
Mmmmh, it feels like the tooltip should only be where needed. Really unusual to see a tooltip in a dropdown list... I searched a bit to see if |
🏷 sqllab |
🗑🏷 sqllab |
🏷️ .ui |
*/ | ||
|
||
.ace_editor.ace_autocomplete { | ||
width: 520px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we need a new file here... this could be shoehorned under the .ace_editor
selector in main.less
Optionally, all o' that could be moved into Emotion (though that comes with the side mission of migrating the ligature settings into the SupersetTheme.
Also, is 520px based on... something? Maybe it could be a percentage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding it to main.less
makes sense to me. That would change autocomplete widths for every instance of ace editor that we have.
I chose 520 based on what looked good to me on-screen. Can't be a percentage because the element is absolute positioned. We could use vw
, but I don't really like how that can't be bounded.
superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
Outdated
Show resolved
Hide resolved
….tsx Co-authored-by: Evan Rusackas <evan@preset.io>
In your second screenshot it looks like you might be able to use some CSS to truncate the list item with an ellipsis, e.g.
|
I agree that having a dynamic dropdown width would be best. I couldn't find a way to make that work either, at least not without going and changing the I think the best way to improve this would be to give SQL Lab a thorough design pass. A dropdown might not actually be the best way to solve this user need. |
Interestingly, the dropdown is actually horizontally scrollable so this wouldn't work. In theory, the horizontal scrolling should solve the issue of long table names, but it's not a very discoverable pattern. Maybe a better solution would be to make the scrollbar clearly visible and get rid of the tooltips. |
I implemented the feature where long table names auto-expand the dropdown select. This is done only for non-virtualized list because it was easier. Didn't follow up to fix it for the virtualized list because once users start typing and narrow the list down to < 100 items, it becomes a non-virtualized list and will auto-expand anyway. We can potentially slightly increase the |
increasing the |
Another easy "fix" is instead of tooltips, we can add the less aggressive html |
Oh it hadn't even occurred to me to use |
It depends on the schema. Normally it'd be less than 100, but we also have schemas with 1000+ tables. |
We've got a >10k table schema, but that's the largest we have so far i think |
I tried passing a custom |
Did your IDE give you type hint? because it worked for me. There is also a Base on my experience, the scrolling starts to become janky even with just 200+ items, which is why I picked 100 as default in the first place. |
Codecov Report
@@ Coverage Diff @@
## master #10518 +/- ##
==========================================
- Coverage 70.74% 66.10% -4.65%
==========================================
Files 604 605 +1
Lines 32391 32430 +39
Branches 3282 3426 +144
==========================================
- Hits 22916 21438 -1478
- Misses 9363 10802 +1439
- Partials 112 190 +78
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
6b698a0
to
29f1a2d
Compare
@ktmud I believe that's exactly what I tried. Got the intellisense completion and everything. Maybe I did something subtly wrong somewhere. I changed to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, one comment to address in the future
@@ -22,14 +22,14 @@ import 'brace/mode/sql'; | |||
import 'brace/theme/github'; | |||
import 'brace/ext/language_tools'; | |||
import ace from 'brace'; | |||
import { areArraysShallowEqual } from '../../reduxUtils'; | |||
import sqlKeywords from '../utils/sqlKeywords'; | |||
import { areArraysShallowEqual } from 'src/reduxUtils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this from a lint rule? auto modifications from your IDE? Could we do a programmatic migration here to absolute paths everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably could do that, but I'm not sure it's worth it. I think I made a decision to change it here because it made more sense than a local path. But sometimes local paths are nice.
* widen the autocomplete menu for table names * display the full table name in a tooltip * license * Update superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx Co-authored-by: Evan Rusackas <evan@preset.io> * src importing * move autocomplete width css to main.less * use html title attribute instead of tooltip Co-authored-by: Evan Rusackas <evan@preset.io>
* widen the autocomplete menu for table names * display the full table name in a tooltip * license * Update superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx Co-authored-by: Evan Rusackas <evan@preset.io> * src importing * move autocomplete width css to main.less * use html title attribute instead of tooltip Co-authored-by: Evan Rusackas <evan@preset.io>
SUMMARY
In cases where there are lots of tables and/or tables with long names, SQL Lab can become difficult to use. This adds a couple of affordances for that use case:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
ADDITIONAL INFORMATION