Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Pinned chapter header stays stale after dragging the scrollbar thumb

Đang mở
#476 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
2
Fork
0
Merge trung bình
2 ngày 5 giờ
Pull request đã merge (30 ngày)
47

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sillsdev/interlinearizer-extension

Tất cả issue của sillsdev/interlinearizer-extension

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.