Skip to content

feat(lockscreen): add a password reveal toggle to the login box - #4127

Open
liamwh wants to merge 1 commit into
noctalia-dev:mainfrom
liamwh:gh-lockscreen-reveal
Open

feat(lockscreen): add a password reveal toggle to the login box#4127
liamwh wants to merge 1 commit into
noctalia-dev:mainfrom
liamwh:gh-lockscreen-reveal

Conversation

@liamwh

@liamwh liamwh commented Aug 27, 2026

Copy link
Copy Markdown

Summary

Adds the same eye/eye-off password reveal toggle the control-center
Wi-Fi password prompt already has (network_tab.cpp) to the lock
screen's login box — a ghost button between the password field and the
login button that flips setPasswordMode and swaps its glyph.

Motivation

The Wi-Fi prompt lets you briefly check a long password while typing;
the lock screen — where typos cost a full retype and an unlock attempt —
offers no such check. The interaction pattern already exists in-shell,
so this ports it to the one password field that lacked it.

Behaviour details:

  • concealed by default; reveal is a momentary toggle, never persisted;
  • the reveal state resets on every lock (setLockedState(true)), so a
    revealed password never survives into the next unlock;
  • disabled while authentication is in flight, alongside the field and
    the login button;
  • follows the login box's visibility (blackout, loginVisible) and
    picks up the same radius/size/glyph sizing as the login button.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Build / packaging

Related Issue

None found; searched issues/PRs for lock-screen reveal/show-password.

Testing

  • just format
  • just configure (debug) + full build + meson test -C build-debug:
    92/92 OK
  • Manual: code-path review only so far — I can attach a screenshot of
    the lock screen login box with the toggle before review if wanted
    (avoided locking a live session while preparing this PR).

The setPasswordMode primitive this reuses is covered by
tests/input_password_mode_test.cpp; the lock surface itself has no
unit-test scaffolding upstream (scene/wallpaper machinery), matching
the Wi-Fi prompt's reveal button, which is also untested at that layer.

Manual Coverage

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Tested with different bar positions and density settings
  • Tested at different interface scaling values
  • Tested with multiple monitors

Screenshots / Videos

Can provide on request (requires locking a session to capture).

Checklist

  • This PR is ready for review, or it is marked as Draft.
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format with clang-format v22+ installed, or this PR has no code changes.
  • I ran the relevant build or test commands, or explained why they were not run.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I will update end-user documentation after merge, or this PR does not change user-facing configuration or behavior.
  • I added or updated assets/translations/en.json, or this PR adds no new user-facing strings.
  • I did not edit non-English translation files unless this PR is explicitly for translation tooling, an import/export sync, or a maintainer-requested locale change.
  • I used the existing canonical names for config keys, IPC names, paths, and identifiers.

Additional Notes

No new settings key: the Wi-Fi prompt's toggle is unconditional, so
this mirrors it rather than growing the login-box style surface. Happy
to add a show_reveal_password_button style flag if maintainers prefer
configurability.

Disclaimer: AI-assisted tooling was used.

The control-center Wi-Fi password prompt has an eye toggle that
temporarily reveals the typed password; the lock screen's password
field has none, so a long password can only be typed blind. Add the
same ghost eye/eye-off button between the password field and the login
button, reusing the identical interaction: setPasswordMode(!revealed)
plus a glyph swap.

The password stays concealed by default, the reveal state never
carries across lock cycles (each lock starts concealed), and the
button is disabled while authentication is in flight, exactly like the
field and the login button.
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.

1 participant