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

Aperta Adatta ai principianti
#760 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
android, kotlin
Ambito
mobile

Direzione di ricerca

Inizia dalla costante di soglia predefinita Defaults.PREF_AUTO_CORRECT_THRESHOLD, poi confrontala con il valore di Balanced in Settings.applyAutoCorrectAggressivenessPreset(). Successivamente leggi Settings.readAutoCorrectAggressiveness() per vedere come una installazione nuova associa la soglia a un livello, e verifica che SettingsValues legga lo stesso valore predefinito. È completato quando una installazione nuova mostra Balanced nell'interfaccia e usa la soglia di Balanced, mentre i livelli salvati dall'utente continuano a funzionare come prima.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Kotlin
Stelle
1k
Fork
59
Merge medio
14h 9m
PR unite (30g)
56

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LeanBitLab/LeanType

Tutte le issue di LeanBitLab/LeanType

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.