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

Add tab completions for PathCombobox #2692

Merged
merged 10 commits into from
Nov 16, 2015
Merged

Add tab completions for PathCombobox #2692

merged 10 commits into from
Nov 16, 2015

Conversation

goanpeca
Copy link
Member

Fixes #2677

Description

The PathComboBox now has auto completion which improves the UX. This affects the Global Working Directory Toolbar and the Find in Files pane.

Screenshot

image

@goanpeca goanpeca self-assigned this Sep 14, 2015
@goanpeca goanpeca added this to the v3.0 milestone Sep 14, 2015
@goanpeca goanpeca changed the title Add completion for PathCombobox (Global Working dir and find files) Add completion for PathCombobox Sep 14, 2015
@goanpeca
Copy link
Member Author

Want to give it a try @gb119?

@blink1073
Copy link
Contributor

  File "/Users/ssilvester/workspace/spyder-ide/spyderlib/widgets/comboboxes.py", line 200
    return
         ^
TabError: inconsistent use of tabs and spaces in indentation

@goanpeca
Copy link
Member Author

what the f...

@blink1073
Copy link
Contributor

I'd expect to be able to hit Tab to make a completion instead of taking me to the next widget, what do you think?

@goanpeca
Copy link
Member Author

hmmm did you use it?

You mean hitting tab once you have selected from the list should be the same as enter (enter is the current behaviour)

@blink1073
Copy link
Contributor

I removed the tab locally 😄
When I hit enter, it just closes the dialog.

@blink1073
Copy link
Contributor

I mean while typing, just like in the command prompt.

@blink1073
Copy link
Contributor

or in our completions widget in the editor.

@goanpeca
Copy link
Member Author

Ahhh hmm ok then that means that you want the inline mode, instead of the popup mode, http://doc.qt.io/qt-4.8/qcompleter.html#CompletionMode-enum ?

@goanpeca
Copy link
Member Author

Yes it totally makes sense, will fiddle around a bit more ;-)

@blink1073
Copy link
Contributor

Dead link, but yes, that sounds right.

@ccordoba12
Copy link
Member

Cool @goanpeca! Given this new functionality, I think we should remove the green and red coloring present in that dialog. What do you think?

@goanpeca
Copy link
Member Author

I could not agree more with you! I hate that red/green coloring! HATE!

@goanpeca
Copy link
Member Author

@blink1073 can you give it a try now? (use tab and double tab... it should feel like bash completion)

@ccordoba12 I have not changed the colors yet.

@blink1073
Copy link
Contributor

@goanpeca, beautiful!

@goanpeca
Copy link
Member Author

@ccordoba12 can you try this one out? I think we can leave the colors for now... and make those changes in a new PR, lets keep this one short

@gb119
Copy link

gb119 commented Sep 14, 2015

Looks nice. On the colours issue - it's not great UI design to use red/green fonts to signify things as the most common form of colour blindness is red/gree (!). A small tick/cross emblem at the start of the path might have worked better - probably still has a value even with autocomplete as the user can typoe any sort of random string in there.

@goanpeca
Copy link
Member Author

Ok so I made a code update to get rid of colors and now display status icons.

  • Single tab autocompletes if only one option
  • Double tab shows completions if more that one option
  • There are three icons, valid, invalid and set. To set the path an enter is required. If the box looses focus without having pressed enter it will returned to the last selected path.

This is how it looks

Comments, @gb119 , @ccordoba12 , @blink1073 ?

@goanpeca
Copy link
Member Author

Maybe the icon would look better to the right :-p ?

@gb119
Copy link

gb119 commented Sep 21, 2015

Very nice :-) I guess the icon location is a matter of taste, but I was going left on the analogy with the way valid https sites are shown in most web browsers (at least the ones I use...) which modify the appearance of the left side of the adress entry field. But you guys are the coders not me.....

self.set_default_style()
self.valid.emit(False, False)
# else:
# self.set_default_style()
Copy link
Member

Choose a reason for hiding this comment

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

Please remove these comments

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok

@ccordoba12
Copy link
Member

Ok, I tried the separator and it basically breaks all the logic

Ok, no problem. This is still an improvement ;-)

The icon I can do, but I would like some opinions

I'm strongly +1 on hiding it on focus out. It's very distracting to see it there all the time.

@ccordoba12
Copy link
Member

The AppVeyor failure is related to conda-build being unable to do a git checkout with non-ascii chars on its log.

I think that means we should stop testing on Python 2.7 until that bug is fixed. @goanpeca, what do you think?

@goanpeca
Copy link
Member Author

goanpeca commented Nov 3, 2015

@ccordoba12 ok, I will look into hiding the icon after focus out.

Can you test it on windows?

@ccordoba12
Copy link
Member

Yes, will do. I'm also going to comment our Appveyor tests for PY 2.7 so your PRs can be merged :-)

@goanpeca
Copy link
Member Author

goanpeca commented Nov 4, 2015

@ccordoba12 done!

Now the icon hides on focus out and shows on focus in. Can you test locally?

@ccordoba12
Copy link
Member

Will do later today. Thanks for the change :-)

El 04/11/15 a las 00:00, Gonzalo Peña-Castellanos escribió:

@ccordoba12 https://github.com/ccordoba12 done!

Now the icon hides on focus out and shows on focus in. Can you test
locally?


Reply to this email directly or view it on GitHub
#2692 (comment).

@ccordoba12
Copy link
Member

You need to rebase this one for my changes to Travis to take effect here.

@ccordoba12
Copy link
Member

Now I don't like the white space that is left in focus out:

seleccion_001

Can't we just remove the status icon in focus out and add it in focus in?

@Nodd
Copy link
Contributor

Nodd commented Nov 5, 2015

The text would jump left and right, that would be disturbing. One solution is to put the icon on the right side.

@ccordoba12
Copy link
Member

@Nodd's solution is nicer, and simpler to implement than mine. @goanpeca could you make it happen?

@goanpeca
Copy link
Member Author

goanpeca commented Nov 9, 2015

Icon is on the right now, and it disappears on focus out.. reappears on focus in

image

Any last comments before merging?

@goanpeca
Copy link
Member Author

goanpeca commented Nov 9, 2015

Its failing for one build test

https://travis-ci.org/spyder-ide/spyder/jobs/90208316

@ccordoba12, ideas?

@ccordoba12
Copy link
Member

It was a random failure. I think you can restart the build when that happens, as all other @spyder-ide/core-developers :-)

If not, please let me know how to change that.

@goanpeca
Copy link
Member Author

@ccordoba12 so merge?

@@ -195,7 +280,7 @@ class UrlComboBox(PathComboBox):
def __init__(self, parent, adjust_to_contents=False):
PathComboBox.__init__(self, parent, adjust_to_contents)
self.editTextChanged.disconnect(self.validate)

Copy link
Member

Choose a reason for hiding this comment

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

Please remove blanks only if they're around the code you're touching. This is not a problem in this case because we almost never touch comboboxes, so it's not a blocker for merging :-)

But I've had major headaches trying to merge things between 2.3 and master when that rule is not followed :-)

My idea is to (slowly) move to remove blanks and adhere to pep8, by following Raymond Hettinger advice: https://www.youtube.com/watch?v=wf-BqAjZb8M

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I have seen that video more than once ;-)

@ccordoba12
Copy link
Member

Very nice addition @goanpeca! Thanks for working on it :-)

@ccordoba12 ccordoba12 changed the title Add completion for PathCombobox Add tab completions for PathCombobox Nov 16, 2015
ccordoba12 added a commit that referenced this pull request Nov 16, 2015
@ccordoba12 ccordoba12 merged commit 496ecfc into spyder-ide:master Nov 16, 2015
@goanpeca
Copy link
Member Author

👍

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

Successfully merging this pull request may close these issues.

5 participants