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

Aperta Adatta ai principianti
#649 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Inizia da SegmentView.tsx e segui il callback di selezione fino a selectSegment in FocusStore.tsx, dove l’issue identifica la scrittura del focus e il controllo del versetto. Confronta il comportamento esistente di contenimento di focusToken. Il lavoro è completo quando selezionare un segmento che contiene già il focus non sposta Continuous View e non reimposta un versetto attivo successivo all’inizio del segmento.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
2
Fork
0
Merge medio
1g 1h
PR unite (30g)
107

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sillsdev/interlinearizer-extension

Tutte le issue di sillsdev/interlinearizer-extension

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.