Add Password keyboard type to password input fields#475
Conversation
…stions Add KeyboardOptions(keyboardType = KeyboardType.Password) to both password OutlinedTextField fields in PasswordDialog. This tells the on-screen keyboard to use incognito mode, preventing it from showing or learning password text in suggestions. https://claude.ai/code/session_01TjG6GLMhjnTX8SNxRDQz6Q
Greptile SummaryAdds
Confidence Score: 5/5
Important Files Changed
Flowchartflowchart TD
A[User opens PasswordDialog] --> B[OutlinedTextField: Password]
A --> C[OutlinedTextField: Confirm Password]
B --> D[keyboardOptions: KeyboardType.Password]
C --> E[keyboardOptions: KeyboardType.Password]
D --> F[Keyboard disables autocorrect & suggestions]
E --> F
B --> G[visualTransformation: PasswordVisualTransformation]
C --> G
G --> H[Characters hidden unless toggled visible]
F --> I[Improved password input UX]
H --> I
Last reviewed commit: f6d9ad4 |
| import androidx.compose.foundation.text.KeyboardOptions | ||
| import androidx.compose.ui.text.input.KeyboardType |
There was a problem hiding this comment.
Import ordering is inconsistent
The new KeyboardOptions import from androidx.compose.foundation.text is placed after the androidx.compose.ui block (line 58), but the rest of the file groups androidx.compose.foundation.* imports together at lines 8–21. Moving this import up to that group would keep the file consistent with its existing alphabetical ordering convention.
| import androidx.compose.foundation.text.KeyboardOptions | |
| import androidx.compose.ui.text.input.KeyboardType | |
| import androidx.compose.ui.text.input.KeyboardType |
And add at line 21 (after import androidx.compose.foundation.verticalScroll):
import androidx.compose.foundation.text.KeyboardOptions
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: app/src/main/java/com/lxmf/messenger/ui/screens/MigrationScreen.kt
Line: 59:60
Comment:
**Import ordering is inconsistent**
The new `KeyboardOptions` import from `androidx.compose.foundation.text` is placed after the `androidx.compose.ui` block (line 58), but the rest of the file groups `androidx.compose.foundation.*` imports together at lines 8–21. Moving this import up to that group would keep the file consistent with its existing alphabetical ordering convention.
```suggestion
import androidx.compose.ui.text.input.KeyboardType
```
And add at line 21 (after `import androidx.compose.foundation.verticalScroll`):
```
import androidx.compose.foundation.text.KeyboardOptions
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Added proper keyboard type configuration to password input fields in the MigrationScreen's PasswordDialog to improve user experience on mobile devices.
Key Changes
KeyboardOptionsimport fromandroidx.compose.foundation.textKeyboardTypeimport fromandroidx.compose.ui.text.inputkeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password)to the password input fieldkeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password)to the confirm password input fieldImplementation Details
By setting the keyboard type to
KeyboardType.Password, the on-screen keyboard will now display appropriate input options for password fields (typically hiding characters and disabling autocorrect/suggestions). This improves the user experience when entering passwords on mobile devices and follows Android/Compose best practices for sensitive input fields.https://claude.ai/code/session_01TjG6GLMhjnTX8SNxRDQz6Q