-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
feat(sqllab): Highlight and make actionable table name in the editor #29783
base: master
Are you sure you want to change the base?
feat(sqllab): Highlight and make actionable table name in the editor #29783
Conversation
/testenv up |
9e1a2ff
to
80e4290
Compare
@justinpark that looks nice! I think I have only one comment about preview tab which is - can copy + search (instead of filter) match the pattern in samples in explore? |
@kasiazjc This preview result is output in the same way by reusing the existing preview result component. |
honestly, that would be amazing as I think this would declutter SQL Lab a little bit! Is it something you would be able to work on? I am also wondering about discoverability of this feature, because it can be hard to find if you dont know what you're looking for. Maybe for example in the empty empty state for SQL we could have some kind of "default doc placeholder sql comment" (sorry for the name lol), that would list shortcuts and features like the one you are implementing? What do you think? |
Sure. Since it's separate issue, I'll push a new PR for the change.
Of course, I have been considering the discoverability. As shown in the screenshot below, similar to existing editors, we have highlighted certain clickable keywords to provide feedback. When the cursor hovers over them, a tooltip is provided, making it easier to find the functionality. mouse-over-token-tooltip.mov |
Makes sense, thank you! |
SUMMARY
Following #26096
To make the editor smart, this commit highlights actionable items (such as table names) among the tokens hovered over by the mouse. When cmd + click is pressed, additional data linked to the relevant metadata is displayed in a popup.
The first item implemented in this commit is table names. If the SQL content includes a table name with a schema (e.g., main.bart_lines) or if the text matches a table name from the list of tables in the currently selected schema, it is marked as actionable. When clicked, it displays table metadata (including columns) and a preview query in a popup, similar to the left panel.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
highlight-ace-editor-table-token.mov
TESTING INSTRUCTIONS
type a sql including a table name and then mouse over the table name string
ADDITIONAL INFORMATION