Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Pinned chapter header stays stale after dragging the scrollbar thumb

Aperta
#476 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à
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Start in src/components/SegmentListView.tsx at correctIndexAgainstLayout and the pinned-chapter effect, then read src/hooks/useSegmentWindow.ts around the content wrapper observer and window re-seating. Check how the visible range updates after a scrollbar drag. Done when tests or manual checks confirm the header matches the topmost visible segment after dragging to the top, middle, and bottom of a long book.

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

Descrizione

In the segment list, dragging the scrollbar thumb a long way leaves the pinned chapter header showing the chapter you left. For example, drag from Psalm 115 to the top of the book: the list shows Psalm 1, but the header still says "Psalms 115":
Image

This happens whether continuous view is on or off.

Cause

The header reads the chapter on the last scroll event, before the window has re-seated around the new position, and nothing reads it again after the window moves.

  1. correctIndexAgainstLayout clamps the height table's guess into the mounted range (Math.max(guess, range.start)). When the guess is outside the range, it returns a mounted segment from the old location instead of the correct guess.
  2. The pinned-chapter effect re-reads on scroll events and on container resizes only.
    • The re-seat triggers no scroll event: at scrollTop === 0, useSegmentWindow skips compensation (L1059).
    • The container's box doesn't change when its contents do. useSegmentWindow also observes the content wrapper for this reason (L1045).

A slow drag mostly avoids this because the skim renders ahead of the drag. A fast drag, or the final position of any drag, outruns it.

Fix

  • Return guess unchanged when it falls outside [range.start, range.end).
  • Re-read the top chapter after the window moves, by observing the content wrapper or by re-running on range.start/range.end. This settles a guess that is slightly off near a chapter boundary.

Done when: after dragging the thumb to the top, the bottom, and the middle of a long book (e.g. Psalms on WEB), the header shows the chapter of the topmost visible segment once the drag ends.

Introduced in #337.

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

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.