Skip to content

Add password digit highlighting and settings toggle#192

Closed
metergames wants to merge 3 commits into
nextcloud:masterfrom
metergames:feature/color-password-digits
Closed

Add password digit highlighting and settings toggle#192
metergames wants to merge 3 commits into
nextcloud:masterfrom
metergames:feature/color-password-digits

Conversation

@metergames

@metergames metergames commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a new feature that allows users to highlight digits in revealed passwords with a different color, making it easier to distinguish similar-looking characters (like 0 and O). The feature can be enabled or disabled via a new setting in the app's settings screen. The implementation includes changes to the password display logic, user preferences, and the user interface.

Closes #191

Password Display Enhancements

  • Added logic in CopyTextItem to highlight digits in revealed passwords using a custom color (password_digit) when the new setting is enabled. This is handled by the new refreshDisplayedText method, which applies a ForegroundColorSpan to digits. [1] [2] [3] [4] [5]

Settings and Preferences

  • Introduced a new setting value COLOR_PASSWORD_DIGITS in SettingValues to control whether password digits are highlighted.
  • Updated SettingsFragment to include a new checkbox (settings_color_password_digits_switch) for enabling/disabling the digit-highlighting feature, and to persist the user's preference. [1] [2] [3] [4]
  • Updated the settings layout (fragment_settings.xml) to add the checkbox and its descriptive label.

User Interface and Localization

  • Added new string resources for the setting's label and description, and defined the color used for highlighting digits. [1] [2]

Render numeric digits in a distinct blue color when a password is revealed in CopyTextItem, so visually similar characters (e.g. 0 vs O, 1 vs l) can be told apart. Coloring is applied only while the password is shown - not while masked - so it never reveals digit positions behind the masking dots. Covers both the main password field and password-type custom fields, since both use CopyTextItem. Gated by a new COLOR_PASSWORD_DIGITS preference that defaults to on.
Signed-off-by: Ryan Morov <metergames22@gmail.com>
Add a checkbox in settings to enable or disable highlighting of digits in revealed passwords. Defaults to enabled. Wires the COLOR_PASSWORD_DIGITS preference through SettingsFragment and adds the corresponding strings.
Signed-off-by: Ryan Morov <metergames22@gmail.com>
@metergames
metergames force-pushed the feature/color-password-digits branch from 9b1b88f to 1237476 Compare June 19, 2026 18:41
@binsky08

Copy link
Copy Markdown
Collaborator

wtf, I just did merge it locally into master, pushed it but github failed to track it ?!? come on

@binsky08

binsky08 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

ah oh, you merged master after i pulled it, haven't seen it, sry. technically it's merged, so i'll close it.

Thanks for the implementation @metergames, nice feature!

I'll try to get it released the next days. I'll wait for some translations to come in for the new highlight string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Highlight digits in a different color when viewing a password

2 participants