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

Minimap should start dragging when on mouse down outside of viewport area #21708

Closed
Tyriar opened this issue Mar 2, 2017 · 6 comments
Closed
Assignees
Labels
*as-designed Described behavior is as designed editor-minimap Code/Text minimap widget issues

Comments

@Tyriar
Copy link
Member

Tyriar commented Mar 2, 2017

Right now dragging will start on mouse down of the viewport area, I think it would feel better if it dragged even outside of the viewport area.

@Tyriar Tyriar added the editor-minimap Code/Text minimap widget issues label Mar 2, 2017
@alexdima
Copy link
Member

alexdima commented Mar 2, 2017

We cannot implement this because the minimap geometry is not the same as the vertical scrollbar geometry (the minimap also scrolls -- i.e. the minimap slider moves like the scrollbar slider, but the text of the minimap under the slider also scrolls, which is not the case for the scrollbar).

Clicking on the minimap will not move the slider to where you clicked, clicking on the minimap will reveal the line where you click in the center of the viewport. This might result in the slider moving and in the minimap scrolling, especially for files that overflow the minimap, but the slider will not necessarily end up at the mouse position.

I try to exemplify in the following gif:
minimap-geometry2

Notice how I click on the minimap near its top. The lines I clicked on get revealed in the viewport, but the slider has only moved a little bit up, since we've scrolled 4-5% up in the file. Having the slider move to where the mouse was clicked would mean clicking on a location would take you somewhere completely different.

@SteveVanOpstal
Copy link

SteveVanOpstal commented Mar 2, 2017

IMHO this works counter intuitive, it seems to me that it would work better if you stretch/shrink the minimap content vertically depending on the file line length. In a very large file you'll lose the overview a bit but you'll gain a very logical minimap system where the top of the minimap is the top of the file and the bottom of the minimap is also the bottom of the file.
This would also allow the user to just drag in the minimap and get the center of the viewport

@smlombardi
Copy link

@SteveVanOpstal The minimap in Code seems to work just like the one in Sublime and Atom, and I think the implementation so far is excellent. I personally would NOT want the minimap to stretch to match the window height nor have clicking outside it make it scroll. I prefer the"scale" of the map to be the same across files, long or short, as they've got it now. Just my opinion.

@SteveVanOpstal
Copy link

@smlombardi you are right that 'stretching to match the window height' is probably not a good idea. I've used the minimap a bit more now and I think I found what is really bothering me (and the reason why I provided the stretching solution):
The minimap viewport grey area is only visible on hover, which requires me to first hover, then look for the viewport area to then drag it. Most of the times this results in me not clicking on the viewport area, trying to drag, which is not possible. Having the viewport area always visible seems more logical overal (not only in this situation).

@smlombardi
Copy link

@SteveVanOpstal Sublime offers a setting to put a border on the minimap. Perhaps such a setting would help what you're saying?

@SteveVanOpstal
Copy link

SteveVanOpstal commented Mar 2, 2017

@smlombardi the always_show_minimap_viewport setting you mean. Yes that would greatly improve my experience. I made an feature request for it: #21784

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed editor-minimap Code/Text minimap widget issues
Projects
None yet
Development

No branches or pull requests

4 participants