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

ux: wrapping to top/bottom when scrolling past bottom/top is confusing #49

Open
schweikert opened this issue May 27, 2024 · 5 comments
Open
Labels
ux User interface and user experience issue

Comments

@schweikert
Copy link

Description of the bug

When I edit changes using scm-record, I often go past the last entry and I am temporarily confused by the fact that the UI brings me to the top entry, instead of stopping.

Steps:

  • Press the down arrow key until the last entry
  • Press the down arrow key once more

Expected behavior

It should stay on the same line.

Actual behavior

It goes to the first line.

Version of rustc

No response

@schweikert schweikert added the bug Something isn't working label May 27, 2024
@arxanas
Copy link
Owner

arxanas commented May 27, 2024

Can you elaborate on the justification? Many kinds of menus do loop around, and many do not, so we ought to decide what kind of UI idioms apply in this case. I originally picked the UI idiom that I felt was most natural for CLI/TUIs.

  • Presumably if you use other ways of moving around (ctrl-u/ctrl-d or mouse scroll) then the issue doesn't happen, and it's specific to the arrow keys. (I don't remember.)
  • Alternative or complementary features might include —
    • specific commands to go to the next/previous item, rather than the arrow keys
      • there's also several variations like "next item of same kind" that ought to be worked out
    • specific commands to go to the top/bottom

@schweikert
Copy link
Author

This is mostly a matter of personal preference, and in general I prefer when UIs don't behave like this. In the case of scm-record, I feel like the behavior is however worse than usual, because the UI elements are expandable and so I often can't tell visually / intuitively that I am on the last line. I just find myself often hitting the bottom arrow key once too much and being confused by the fact that I am on the top again afterward. If this was configurable, it would be great (but I still would recommend the default behavior to be not to wrap).

@arxanas arxanas changed the title Avoid wrapping to top/bottom when scrolling past bottom/top ux: wrapping to top/bottom when scrolling past bottom/top is confusing Jun 1, 2024
@arxanas arxanas added ux User interface and user experience issue and removed bug Something isn't working labels Jun 1, 2024
@schweikert
Copy link
Author

(small additional note of something that I realized: one possible explanation why it is confusing for me, is that wrapping breaks a "spatial" mental model for what I see on the screen. In the physical world, usually when you come to the end of somewhere, you don't come back to the top of it if you try to go further)

@hotsphink
Copy link

This bothered me enough that I patched my local copy to stop wrapping. (I use 'j'/'k' to move around.)

The reason I prefer to not wrap is because when I run eg jj split, the order of the items matters (a lot) in my mental model. I frequently hold down j or k to go to the end/beginning of the list. I also think of it as sort of a todo list, and I know I'm done when going to the next item no longer goes anywhere. Wrapping de-emphasizes the ordering. It also removes mental anchor points and "directions": "I'm below another mention of this change, so I need to go back up and add it back in" vs "I already saw another mention of this change, so I need to re-scan through everything to find it again, and hope I notice when I'm rereading the same stuff". As I'm working on a split, for example, I want to have the UI help me maintain a strong distinction between what I've seen and haven't seen yet.

I guess it's not the ordering, since it's ordered with and without wrapping. It's more about the list of items having a beginning and an end? It's more of a "todo" list to handle, not a selection to choose an arbitrary element from. I guess that's the UI idiom I would point to.

@hotsphink
Copy link

My modifications, which do a little more than just this, are at https://github.com/hotsphink/scm-record/tree/keybindings if you want to try out the feel of it. It's a little more extreme, though; in addition to the focus next/prev wrapping, I also keep PageUp/PageDown (also bound to shift-J/K) constrained to not advance past a higher level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux User interface and user experience issue
Projects
None yet
Development

No branches or pull requests

3 participants