Skip to content

fix: prevent hidden-word flicker when switching practice words#266

Open
didyhu wants to merge 1 commit into
zyronon:masterfrom
didyhu:fix/practice-word-flicker-hidden
Open

fix: prevent hidden-word flicker when switching practice words#266
didyhu wants to merge 1 commit into
zyronon:masterfrom
didyhu:fix/practice-word-flicker-hidden

Conversation

@didyhu
Copy link
Copy Markdown

@didyhu didyhu commented May 14, 2026

Summary

  • 修复了在低性能场景(如节能模式)下,切换到下一个单词时“本应隐藏的单词短暂闪现”的问题。

Root Cause

  • 在 props.word 切换时,上一词的瞬时 UI 状态(如 showWordResult、showFullWord)有机会先被渲染一帧,再被 reset 覆盖。
  • 在设备性能不足或调度延迟时,这个时序窗口更容易出现,从而造成可见抖动。

Changes

  • 将单词切换时的 reset 监听改为同步刷新(flush: 'sync'),确保在同一更新周期内完成重置。
  • 引入稳定的显隐判定 shouldHideWordByDefault,统一“默认隐藏单词”的模式判断。
  • 将单词和释义相关渲染路径统一接入该判定,避免首帧状态泄漏导致的闪现。

Affected Modes

  • 默认隐藏:Spell、Listen、Dictation、Identify
  • 默认显示:FollowWrite

Validation

  • 本地手动验证:在非照着打模式下连续切词,未再出现“先显示几帧再隐藏”的现象。
  • 编辑器静态检查:改动文件无新增报错。

Scope

  • Core TypeWord 组件
  • vscode-web TypeWord 对应实现

Copilot AI review requested due to automatic review settings May 14, 2026 01:54
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

@didyhu is attempting to deploy a commit to the zyronon's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant