Autocorrect aggressiveness: default behaves as "Modest", although "Balanced (Default)" is labeled as default

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
android, kotlin
领域
mobile

调研方向

从默认阈值常量 Defaults.PREF_AUTO_CORRECT_THRESHOLD 开始,然后将它与 Settings.applyAutoCorrectAggressivenessPreset() 中的 Balanced 值进行比较。接着阅读 Settings.readAutoCorrectAggressiveness(),了解全新安装时阈值如何映射到级别,并检查 SettingsValues 读取的是否为相同的默认值。完成标准是:全新安装在界面中显示 Balanced 并使用 Balanced 阈值,同时用户已保存的级别仍保持原有行为。

由索引模型根据 Issue 内容生成。

描述

Describe the bug
On a fresh install, Text correction → Autocorrect aggressiveness shows Modest, but the slider labels level 2 as "Balanced (Default)". The keyboard also really uses the modest threshold, so users get much weaker autocorrection than the settings suggest.

Cause

  • Defaults.PREF_AUTO_CORRECT_AGGRESSIVENESS = 2 (Balanced), but Defaults.PREF_AUTO_CORRECT_THRESHOLD = 0.185f, which is the Modest value in Settings.applyAutoCorrectAggressivenessPreset() (Balanced = 0.067f).
  • As long as no aggressiveness is saved, Settings.readAutoCorrectAggressiveness() derives the level from the threshold: threshold >= 0.18f -> AUTO_CORRECT_LEVEL_MODEST. That's why the UI shows Modest.
  • SettingsValues reads the threshold with the 0.185 default, so autocorrection itself also runs at Modest.

Possible fix
Set Defaults.PREF_AUTO_CORRECT_THRESHOLD = 0.067f so it matches the Balanced preset (that's what we did). Users who saved a level themselves are not affected, since their threshold is stored.

To Reproduce

  1. Fresh install (or clear app data).
  2. Settings → Text correction → enable Autocorrect.
  3. Autocorrect aggressiveness shows "Modest", while level 2 is labeled "Balanced (Default)".

Expected behavior
The default level is Balanced, both in the UI and in the actual threshold.

App version & Flavor
Found in GlassType, my fork based on LeanType 4.3.0 (d634e26), standard flavor. The code is unchanged in current main (0e673e1).

Device Info

  • Model: Samsung Galaxy S23 Ultra (SM-S918B) and Galaxy Z Fold 3 (SM-F926B)
  • OS version: Android 17 / Android 15
主要语言
Kotlin
星标
1k
派生
59
平均合并
14 小时 9 分钟
30 天内合并 PR
56

环境准备

从这里开始

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

LeanBitLab/LeanType 的其他 Issue

查看 LeanBitLab/LeanType 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 发到你的邮箱

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