gitui-org / gitui-org/gitui

UX: Wherever Arrow keys may scroll or switch to other view, switch only if no scroll happened in last 0.5 s

Abierto
#2,898 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

feature-request
Lenguaje dominante
Rust
Estrellas
22.5k
Forks
774
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

The Problem

In a number of views, Arrow keys allow to scroll contents horizontally and/or vertically. Those views include full screen diff (Up/Down) or commit message body (Up/Down). However, those views are also left by the same Arrow key if you're at the edge already and press the key once more.

UX wise, this overloading is problematic, because scrolling is often used with autorepeat, which unintendedly runs into the other view too easily.

In the case of the commit message body, there's no way for the user to separate switching from scrolling, other than paying high attention to the tiny scroll bar and slowing down near the end.

In the case of full screen diff, the problem has been mitigated, for the time being, by disabling Left as a way to leave. However, that workaround comes at a price of its own, as it breaks "Lynx mode" navigation.

Suggested Solution

Wherever a view area can be left by an Arrow key that also is used to scroll that view's content, perform the switch only if there hasn't been any input from the specific key in the last 0.5 s. (Time window may be adjusted.)

This ensures that switching generally works instantly (as opposed to an hard delay), whilst only in conflicting moments there's a barrier that prevents autorepeat from running too far.
In the latter case, simply pressing the key anew suffices to switch views if indeed intended.

Considered Alternatives

Alternatively, different keys could be bound to scrolling vs. switching by default. However, Arrow keys make a lot of sense for both (even if for mostly distinct user groups).

Additional Context

This FR is based on a suggestion by @smammy on how to safely re-enable Arrow key back navigation in full screen diff.

However, just like the underlying problem, the solution is more general, and should be applied globally to all scrollable views.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza rastreando el manejo de las teclas de flecha en el diff a pantalla completa, el cuerpo del mensaje de commit y otras vistas desplazables para identificar dónde el desplazamiento y el cambio de vista comparten la entrada. Implementa y verifica la protección de 0,5 segundos por tecla para que el desplazamiento no active la navegación durante la repetición automática, mientras que una tecla pulsada recientemente siga cambiando de vista cuando corresponda.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
rust
Área
cli
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.