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

Đang mở Phù hợp với người mới
#649 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/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ệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu từ SegmentView.tsx và lần theo callback chọn đến selectSegment trong FocusStore.tsx, nơi issue chỉ ra thao tác ghi focus và kiểm tra câu. Kiểm tra hành vi chứa hiện có của focusToken để so sánh. Hoàn thành khi việc chọn một phân đoạn đã chứa focus không làm Continuous View di chuyển hoặc đặt lại một câu đang hoạt động ở vị trí sau về đầu phân đoạn.

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

Mô tả

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.

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

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.