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

Đang mở Phù hợp với người mới
#760 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
android, kotlin
Lĩnh vực
mobile

Hướng nghiên cứu

Bắt đầu với hằng số ngưỡng mặc định Defaults.PREF_AUTO_CORRECT_THRESHOLD, sau đó so sánh với giá trị Balanced trong Settings.applyAutoCorrectAggressivenessPreset(). Tiếp theo, đọc Settings.readAutoCorrectAggressiveness() để xem cách một bản cài đặt mới ánh xạ ngưỡng thành mức, và kiểm tra SettingsValues đọc cùng giá trị mặc định. Hoàn thành khi bản cài đặt mới hiển thị Balanced trên giao diện và dùng ngưỡng Balanced, còn các mức do người dùng lưu vẫn hoạt động như trước.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Kotlin
Star
1k
Fork
59
Merge trung bình
14 giờ 9 phút
Pull request đã merge (30 ngày)
56

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của LeanBitLab/LeanType

Tất cả issue của LeanBitLab/LeanType

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.