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

Misplaced keyboard focus on startup screen #748

Closed
ghost opened this Issue Nov 14, 2017 · 6 comments

Comments

Projects
None yet
2 participants
@ghost

ghost commented Nov 14, 2017

When I open git-cola without parameters, the startup screen shows up with a list of recent repositories. The list used to have keyboard focus, so that it was possible to choose and open a repository with a few keypresses.

With #526, additional UI elements were added to the startup screen. This means that a different element gets the initial keyboard focus, instead of the repository list. The dialog now requires mouse interaction, or a couple of blind Tab presses —I think the logo might have the initial focus, then the text underneath, then comes the list.

The initial focus should probably be assigned to the repository list when creating the dialog. In addition, non-interactive elements should probably not focus-able.

startup.py, around line 84, might be the place to add the focus assignment:

self.bookmarks = QtWidgets.QListView()
# ...
self.bookmarks.setModel(self.bookmarks_model)
self.bookmarks.setFocus()
@davvid

This comment has been minimized.

Member

davvid commented Nov 15, 2017

This should have been fixed in b0ecdfe
Please test master and let me know if you're seeing the fix ~ we're going to tag a new release soon.

@jtumano

This comment has been minimized.

jtumano commented Nov 22, 2017

I can confirm the commit related to #741 issue is ok, but in master version git-cola starts with previously opened repository. To test this functionality should use parameter --prompt, which works perfectly - in the opened window focus will be in repository list

@davvid

This comment has been minimized.

Member

davvid commented Nov 22, 2017

I'm not understanding what you mean by "in master version git-cola starts with previously opened repository". Do you mean the repository in your current directory?

When launched without parameters we check the current directory first, and only show the prompt if nothing can be found automatically. If you want it to always prompt the --prompt flag is provided.

The launchers that run when you click on cola from the application menu on linux typically run with the --prompt flag set, but they may be running an older version from /usr/bin.

What does it say when you type which git-cola in your shell?

@jtumano

This comment has been minimized.

jtumano commented Nov 22, 2017

I mean master branch. So if I git clone the repo and start it with "python3 bin/git-cola" cmd so it opens me previously opened repository (which was opened last time in my stable version 2.11 of cola), so I should start it with parameter --prompt

@davvid

This comment has been minimized.

Member

davvid commented Nov 22, 2017

Do you have cola.defaultrepo configured? cola will default to the "default repo" when no parameters are passed and the current directory contains no repository.

The repository discovery is sensitive to your current directory, and mimics the same "find the .git repo" logic done by git when cola.defaultrepo is unset.

In lieu of any configuration, it will always try to find a repository in the current directory, or its parent directory, and so on (just like git). Only when nothing is found will it show the prompt. Otherwise, the prompt can be forced.

I guess I'll close this issue since the focus issue seems to be okay(?), but if there's something not working as expected then we can take it to a new issue ;-)

@davvid davvid closed this Nov 22, 2017

@jtumano

This comment has been minimized.

jtumano commented Nov 22, 2017

@davvid , thanks.
Yes, it works as you described.
Seems everytime I've started that from my project dir or from cloned cola repo dir. After trying to open it from non-git repository folder the prompt screen appeared.
And the repository list is focused so this issue duplicates #741 and can be closed.

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