Skip to content

Add a reveal toggle to the lock screen password field - #7680

Open
thooams wants to merge 5 commits into
omacom:quattrofrom
thooams:lock-password-reveal
Open

thooams wants to merge 5 commits into
omacom:quattrofrom
thooams:lock-password-reveal

Conversation

@thooams

@thooams thooams commented Aug 21, 2026 •

Copy link
Copy Markdown

Problem

The lock screen password field only ever shows dots. There's no way to check what you typed before submitting, so a single typo means guessing again -- more annoying the longer/more complex the password is.

Solution

  • Add an eye button pinned inside the field (to the left of the fingerprint icon, when one is configured) that toggles the field between masked and plain text.
  • Add Ctrl+Space as a mouse-free equivalent.
  • The toggle stays visible but dimmed while the field is empty (nothing to reveal yet), and brightens once you start typing.
  • Revealing resets to masked whenever the field is cleared (Escape, Ctrl+U, or a submit attempt), so it never carries over into the next attempt.
  • The fingerprint-icon reserved-space math is untouched (fingerprintReserve); the eye toggle gets its own eyeReserve, and both are summed for the field's margins.

Why Ctrl+Space

There's no established convention here -- no OS, browser, or password manager agrees on one shortcut for this. I deliberately avoided an Alt-based chord: Alt (and AltGr specifically) composes special characters on many non-US keyboard layouts, French AZERTY among them, so an Alt combo risked colliding with that.

Screenshots

Masked (default) Revealed (toggled)
masked revealed

Testing

  • qmllint shell/plugins/lock/LockView.qml
  • test/shell.d/lock-fingerprint-indicator-test.sh and test/shell.d/lock-password-overflow-test.sh (both exercise the reserved-space math this change also touches)
  • Full test/shell (185 files) and test/cli (116 files) suites -- the only 3 shell-suite failures need a sibling omarchy-pkgs checkout and are unrelated to this change
  • Manually verified with omarchy-shell lock preview and a real omarchy system lock session

The field only ever showed dots, with no way to check what you typed
before submitting -- a single typo means guessing again, which stings
more the longer/more complex the password is.

Adds an eye button pinned inside the field (left of the fingerprint
icon when one is configured) that toggles between masked and plain
text, plus Ctrl+Space as a mouse-free equivalent. The toggle stays
visible but dimmed while the field is empty, and resets to masked
whenever the field is cleared so it never carries over into the next
attempt.

Ctrl+Space over an Alt-based chord: there's no established convention
for this (no OS, browser, or password manager agrees on one), and Alt
composes special characters on many non-US layouts (French AZERTY,
for one), so an Alt combo risked colliding with that.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings August 21, 2026 14:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds password reveal controls to the lock screen.

Changes:

  • Adds eye-button and Ctrl+Space toggles.
  • Resets reveal state when cleared.
  • Scales revealed passwords to fit the field.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Suppressed comments (2)

shell/plugins/lock/LockView.qml:206

  • The keyboard path can arm reveal while the field is empty, unlike the disabled mouse button. Pressing Ctrl+Space after a clear sets passwordRevealed to true, so the first character of the next attempt is shown and the clear no longer guarantees a masked next attempt. Require non-empty input before toggling here.
          } else if (event.modifiers === Qt.ControlModifier && event.key === Qt.Key_Space) {

shell/plugins/lock/LockView.qml:251

  • This custom clickable item has no accessible role, name, or press action, so assistive technology cannot discover or operate the show/hide-password control or announce its current state. Expose it as an accessible button with a dynamic “Show password”/“Hide password” name and route its press action through the same toggle behavior.
      Rectangle {

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread shell/plugins/lock/LockView.qml Resolved
thooams and others added 2 commits August 21, 2026 16:34
- Route both the mouse toggle and Ctrl+Space through a single
  root.toggleReveal(), guarded on non-empty input. Previously Ctrl+Space
  had no such guard (unlike the mouse button's `enabled` check), so
  pressing it right after clearing the field armed a reveal that then
  applied to the next attempt's first keystrokes.
- Add Accessible.role/name/description/onPressAction to the reveal
  toggle so assistive tech can discover, name (dynamically, "Show" vs
  "Hide password"), and operate it.
- Add test/shell.d/lock-password-reveal-test.sh covering: both toggle
  paths (via the now-shared toggleReveal()), the empty-field no-op,
  reset-on-clear, and revealed-text overflow scaling.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Ctrl+Space had no on-screen hint, so it was undiscoverable without
reading the source. Reuses qs.Ui's existing PanelToolTip (already the
established hover-tooltip pattern elsewhere in the shell, e.g. the
network panel's "Forget network") rather than hand-rolling a new one.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@thooams

thooams commented Aug 21, 2026

Copy link
Copy Markdown
Author

Added a tooltip (17bed05) on the reveal toggle, surfacing "Show/Hide password · Ctrl+Space" on hover -- the shortcut previously had no on-screen hint. Reused qs.Ui's existing PanelToolTip (already the established hover-tooltip pattern elsewhere in the shell) rather than hand-rolling one.

Resolve the LockView.qml conflict by keeping both toggleReveal() and
upstream's dropsAutoRepeat(), which landed in the same spot.

Also bring the branch in line with rules added upstream since it forked:
- Declare textFormat on the reveal toggle's icon, now required for every
  Text with a dynamic binding (qml-text-format-test.sh).
- Report a missing quickshell as skip rather than pass in the reveal
  test, matching lock-password-overflow-test.sh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds password visibility toggle to lock screen.

The PR appears safe to merge, with both previous test findings addressed.

What we checked:

  • Keyboard shortcuts still work: The field passes the same event to handlePasswordKey(). The moved code keeps the wake call, repeat filter, clear shortcuts, and reveal shortcut unchanged.

Summary

Adds a lock-screen eye button and Ctrl+Space shortcut to show or hide the typed password. Clearing the field restores masking, and long revealed passwords shrink to fit beside the icons.

  • The latest changes extract the keyboard handler so the fixture can call it.
  • The fixture now checks both reveal handlers, the field's display mode, and available text space with and without fingerprint support.
  • Both previous findings are addressed. No new actionable issues were found.

Reviews (2) · Last reviewed commit: "Test the lock reveal controls and the re..."

The reveal fixture called toggleReveal() directly and compared the revealed
text against the whole field, so a broken click handler, a broken Ctrl+Space
shortcut, a field stuck in password echo mode, or text clipped by the icon
reserves would all still pass.

Move the key handler onto the view root as handlePasswordKey() so the fixture
can drive it without a focused window, then exercise both entry points and
assert on the input's echoMode. The overflow check now measures against the
input's own width, with and without the fingerprint icon.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants