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

Disable SQL auto-complete by default #464

Closed
jezdez opened this issue Jul 20, 2018 · 22 comments
Closed

Disable SQL auto-complete by default #464

jezdez opened this issue Jul 20, 2018 · 22 comments
Assignees
Labels
Milestone

Comments

@jezdez
Copy link

jezdez commented Jul 20, 2018

To quote @harterrt in 1477317:

The SQL formatter in re:dash should not be enabled by default. It disagrees with the SQL style guide and is generally more harmful than helpful in my experience.

@fbertsch
Copy link

Alternatively, can we fix the formatter to match our style guide?

@harterrt
Copy link

I would still argue to remove the autosuggest functionality. For example typing SELECT<enter> gets autocompleted to select

@jezdez
Copy link
Author

jezdez commented Jul 20, 2018

FTR we use the sqlparse library to do the reformatting, if you can match the style to the provided options, sure it's possible to match it. Otherwise this would need to be replaced with something else.

I should note, this feature is planned to be ported upstream, so any solution would require a non-NIH approach.

@fbertsch
Copy link

Should we split the concern of the auto-complete and it's relation to SQL formatting into a separate issue?

@tdsmith
Copy link

tdsmith commented Jul 20, 2018

It looks like autocomplete is provided by Ace and it reuses the syntax highlighting rules in https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/sql_highlight_rules.js#L39-L43 to suggest keywords.

@harterrt
Copy link

I'm fine with splitting this issue but my primary concern is with the autosuggest functionality. Sorry for the unclear description (and grumpy tone).

The SQL formatter only triggers when clicked so it's not an issue for me. The autocomplete is on by default and does interfere with my workflow. As noted above, the autocomplete appears to prefer lower-cased keywords and makes distractions suggestions even when typing variable names.

For example, in this query I'm trying to filter on submission_date but after typing sub I get a suggestion to autocomplete to the function days_ago.
submission-date-autocomplete

It would be better if this functionality was off by default.

@harterrt
Copy link

@jezdez What do you think about turning the auto-complete off by default?

@harterrt
Copy link

Friendly ping.

@jezdez
Copy link
Author

jezdez commented Aug 21, 2018

@harterrt Whoops, missed this last week! 👐

Yes, let's turn auto-complete off by default.

Also I was wrong in my earlier comment and @tdsmith was correct, I simply confused formatting and auto-completion. Sorry!

@jezdez jezdez changed the title Disable SQL auto-formatter by default Disable SQL auto-complete by default Aug 21, 2018
@jezdez
Copy link
Author

jezdez commented Aug 21, 2018

I've updated the title to better match what @harterrt wants.

BTW, I should note, since the default for the auto-complete is something that is set in the upstream repo (despite us having the additional fork feature of the autocomplete toggle) we'll have to consult with upstream to solve this by introducing a config value there to fully get this done.

@harterrt
Copy link

Hey all, just checking in on this. Do we have an ETA for when this may be turned off by default?

Thanks!

@jezdez jezdez added this to the 17 milestone Sep 18, 2018
@jezdez
Copy link
Author

jezdez commented Sep 18, 2018

Hey @harterrt, no estimate since it'll require changes upstream and we've been working on a related change in getredash#2746.

If you think this is urgent, we can make an exception and add the feature in our fork, but since we're trying to move changes in our custom fork upstream it would make sense to do that only if it's a blocker for your workflow. I hadn't read your issue so far with that scope, apologies in case that happened.

@jezdez
Copy link
Author

jezdez commented Sep 18, 2018

@alison985 Do you think you could add this feature to getredash#2746?

@harterrt
Copy link

Thanks, @jezdez. I agree we should solve this upstream. It's an annoyance, but not worth maintaining it in the fork. I only pinged this thread to make sure the issue doesn't slip through the cracks.

When should I check back next? 4 weeks?

@jezdez
Copy link
Author

jezdez commented Sep 24, 2018

@harterrt Understood, thanks for understanding. 4 weeks sound like a good timebox.

@alison985
Copy link

We closed getredash#2746 because the changes aren't relevant upstream yet. I've opened getredash#2893 upstream in order to have any needed conversation about adding a configuration toggle for this setting.

@alison985 alison985 self-assigned this Oct 4, 2018
@alison985
Copy link

@jezdez Arik talks about local storage in getredash#2893 - Does that mean a cookie? Can you point me to where local storage is talked to in the code?

@alison985
Copy link

@jezdez Bumping up this question.

@jezdez
Copy link
Author

jezdez commented Nov 1, 2018

@alison985 I think he refers to the web storage backend window.localStorage which is a web platform technology key/value-store available in all major browsers.

@rafrombrc rafrombrc modified the milestones: 17, 18 Nov 7, 2018
@rafrombrc rafrombrc removed the blocked label Nov 8, 2018
@rafrombrc rafrombrc modified the milestones: 18, 19 Nov 8, 2018
@alison985
Copy link

@washort I think I'm running into a React difference. What's the React equivalent of $watch that we're using? A quick google shows multiple npm modules, and our package.json doesn't list one.

@rafrombrc
Copy link
Member

Well, we have good news and bad news about this ticket. The bad news is that this particular effort to fix up auto-complete is being scrapped. The good news is that this effort has prompted the following decisions:

@alison985
Copy link

@rafrombrc @jezdez For getredash#3079 I'm not sure we want that in the codebase after Janni's comments here when I tried to port it before.

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

No branches or pull requests

6 participants