Clicking on the segment of the in-focus word causes Continuous View to jump to the start of that segment.

Abierto Apto para principiantes
#649 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
frontend

Línea de trabajo

Empieza en SegmentView.tsx y sigue su callback de selección hasta selectSegment en FocusStore.tsx, donde el issue identifica la escritura del foco y la comprobación del versículo. Comprueba el comportamiento existente de contención de focusToken para compararlo. El trabajo está hecho cuando seleccionar un segmento que ya contiene el foco no desplaza Continuous View ni restablece un versículo activo posterior al inicio del segmento.

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

Descripción

When Continuous View is focused on a word in a given segment, clicking that segment in the Segment View (e.g., to type a free translation), shouldn't need to cause the Continuous View to jump.

Cause

Clicking a segment's background or focusing its free-translation input calls onSelect(ref, firstWordTokenRef) in SegmentView.tsx. selectSegment in FocusStore.tsx then always focuses the segment's first word token, so Continuous View re-centers on it.

That write exists to make the segment active (including verse 0). When the focus is already in the segment, the segment is already active, so the write isn't needed.

Suggested fix

In selectSegment, skip the token write when the current focus is already in the same segment as tokenRef.

Related

selectSegment navigates unless the active verse is exactly the segment's start verse. focusToken instead checks whether the segment contains the active verse. So with a later verse of a multi-verse segment active, clicking that segment jumps the active verse back to its start. Worth switching to the containment check in the same change.

Lenguaje dominante
TypeScript
Estrellas
2
Forks
0
Merge medio
1 d 1 h
PR fusionados (30 d)
107

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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.

Más de sillsdev/interlinearizer-extension

Todos los issues de sillsdev/interlinearizer-extension

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.