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

未关闭 适合新手
#649 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 小时
30 天内合并 PR
107

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sillsdev/interlinearizer-extension 的其他 Issue

查看 sillsdev/interlinearizer-extension 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。