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 摘要。