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

オープン 初心者向け
#649 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
frontend

調査の方向性

SegmentView.tsxから始めて、その選択コールバックをFocusStore.tsxのselectSegmentまで追ってください。そこでは、issueがフォーカスの書き込みと節のチェックを指摘しています。比較のため、既存のfocusTokenの包含判定の動作を確認してください。フォーカスをすでに含むセグメントを選択してもContinuous Viewが移動せず、後続のアクティブな節がセグメントの開始位置にリセットされなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
2
フォーク
0
平均マージ
1日 1時間
マージ済み PR(30日)
107

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sillsdev/interlinearizer-extension のほかの issue

sillsdev/interlinearizer-extension の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。