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

Outline pane, clicking on file name should move to start of file #7214

Closed
gb119 opened this issue May 28, 2018 · 7 comments
Closed

Outline pane, clicking on file name should move to start of file #7214

gb119 opened this issue May 28, 2018 · 7 comments

Comments

@gb119
Copy link

gb119 commented May 28, 2018

Feature Suggestion Description

Clicking on a leaf node in the outline pane tree takes you to the start of the relevant bit of code, but clicking on the root node (the filename) does nothing. It would be better if it took you to the start of the file.

This would be a useful feature for when one realizes halfway through adding some code that some extra modules need to be imported at the start of the file - being able to quickly get there using the outline view would be handy. It would also make the root node behave in a more consistent fashion to the leaf nodes.

Package Versions

  • Spyder version: 3.2.8
  • Python version: 3.6.4
  • Qt version: 5.6.2
  • PyQt5 version: 5.6
  • Operating system: Linux 4.13.0-43-generic
@ccordoba12 ccordoba12 changed the title Outline pane, clicking on file name should move to srart of file Outline pane, clicking on file name should move to start of file May 28, 2018
@ccordoba12 ccordoba12 added this to the v3.3 milestone May 28, 2018
@ccordoba12
Copy link
Member

Thanks for the suggestion. It seems simple enough that we could implement it in our next release.

@bcolsen
Copy link
Member

bcolsen commented May 28, 2018

I'm currently using the outliner with "show all files" and clicking back and forth on the files in the list to switch files like switching between tabs. In this work flow, putting the cursor to the top when I switch between files would be less than ideal.

Changing the cursor to the file start if you click on the file name could work if it only brought you to the top of the file when that file is in focus.

Another idea would be to always have a "File Start" top level item at the start of the file tree. This would be a little strange to see but it would be more obvious what will happen when you click on it.

@ccordoba12 ccordoba12 modified the milestones: v3.3, v3.3.1 May 28, 2018
@ccordoba12
Copy link
Member

@bcolsen, thanks for your input. What if a double-click takes you to the top of the file?

@bcolsen
Copy link
Member

bcolsen commented May 28, 2018

That would work for me but I don't think it's very discoverable.

I was going to submit the idea that the outliner position should follow the current cursor position. Placing the cursor at the file start before the first tag tag was one of the corner cases for what should be highlighted. Having a "start tag" would help with that.

@gb119
Copy link
Author

gb119 commented May 28, 2018

So when you double click leaf nodes they expand or contract - for UI consistency I'd expect the root file nodes to do the same rather than move the cursor - the fact that currently it does neither is possibly an orthogonal problem!
I don;t normally use the all-files option, but I did notice that when you clicks on a new filename, the old file node is collapsed and the new file node is expanded - so only the current file is expanded. This made me think that you could get both the switch and move to top of the file behaviors by looking at whether the file node is expanded or not.
If the file node is not expanded, switch the editor tab, expand the outline view, but don't move the cursor
If the file node is expanded, then move the cursor (and switch editor tabs if necessary).

I don't think that is overloading the UI too much and it seems to my mind consistent with how the outline pane works in other respects. The special 'top-of-file' entry is also possible, but it's a bit VB-esque with a [declarations] section heading....

@bcolsen
Copy link
Member

bcolsen commented May 29, 2018

So when you double click leaf nodes they expand or contract - for UI consistency I'd expect the root file nodes to do the same rather than move the cursor - the fact that currently it does neither is possibly an orthogonal problem!

Yes this is what double clicking should do. It actually does do this currently when you click on a file name but since that file becomes the active file then the tree is automatically expended because it is the active file. I don't think this needs to be fixed.

If the file node is not expanded, switch the editor tab, expand the outline view, but don't move the cursor
If the file node is expanded, then move the cursor (and switch editor tabs if necessary).

This is a fine idea. I don't think that I'll accidentally click on the file twice.

@CAM-Gerlach
Copy link
Member

It actually does do this currently when you click on a file name but since that file becomes the active file then the tree is automatically expended because it is the active file. I don't think this needs to be fixed.

This is somewhat orthogonal, but I'd personally rather it be fixed and not be expanded on a single click. I'd like to use it as a "vertical tab bar" like @bcolsen suggested, and love the similar functionality in Notepad++ and have switched to it as my primary navigation mechanism when I'm switching between too many files for Alt-Tab or the normal tab bar. However, it is much more difficult to do so when it autoexpands on each file, making it much harder to consistently navigate in this fashion.

Furthermore, double-clicking a top-level file to minimize it again currently does nothing, even though the "triangle" expand-contract toggle still works, as does the expand/contract all button up top. For UI consistancy, there is no reason this shouldn't work normally as it does at all other levels with this keystroke.

That, then, leaves the issue of jumping to the top. Double-clicking to go to the top of the file was the natural suggestion that popped into my head for that as well, but would be inconsistant and possibly confusing Ux compared to what it does at all other levels, and would prevent the above from being implemented. This currently can still be accomplished by other quick means, like Ctrl-PageUp or Ctrl-Home.

However, what would be really nice and a meaningful addition, especially for the usage scenario the @gb119 described which I often face as well (jumping to the top to modify some imports, etc), is a way to quickly jump to the top of the file, then jump back down to the previous position—at least in my workflow, it's that latter part that takes way more time and effort then just jumping to the top in the first place, and which this wouldn't really solve. But that's probably out of scope, and with double-clicking (should be) already taken for expanding/contracting outline elements there isn't an obvious UI for it.

@ccordoba12 ccordoba12 modified the milestones: v3.3.1, v3.3.2 Jul 15, 2018
@ccordoba12 ccordoba12 modified the milestones: v3.3.2, v4.0betaX Aug 18, 2018
@jnsebgosselin jnsebgosselin self-assigned this Sep 28, 2018
@ccordoba12 ccordoba12 modified the milestones: v4.0betaX, v4.0beta2 Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants