Skip to content

feat(tui/login): add ctrl+v password visibility toggle#685

Merged
andrinoff merged 1 commit intofloatpane:masterfrom
mvanhorn:osc/593-password-visibility
Apr 20, 2026
Merged

feat(tui/login): add ctrl+v password visibility toggle#685
andrinoff merged 1 commit intofloatpane:masterfrom
mvanhorn:osc/593-password-visibility

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

@mvanhorn mvanhorn commented Apr 20, 2026

Closes #593.

Summary

Adds a ctrl+v chord on the Password / App Password field in tui/login.go to toggle between textinput.EchoPassword and textinput.EchoNormal. The chord only fires when the password input has focus; on any other field it falls through to normal input handling.

When the password field is focused, the existing help line under the form adds • ctrl+v: toggle password visibility so the chord is discoverable without cluttering the view while other fields are focused.

Why

Under EchoPassword, typos in long app-passwords are effectively invisible. The previous workaround was to delete and retype carefully; this just reveals the masked characters in place.

Implementation notes

  • The toggle is a direct EchoMode flip on m.inputs[inputPassword], which matches the approach the issue body proposed. Returns m, nil so bubbletea doesn't also treat the chord as a regular keystroke into the input.
  • ctrl+v was picked for consistency with common TUIs and because matcha doesn't already bind it (grep confirmed).
  • Help-line addition is appended conditionally so it only appears while the password field is focused.

Verification

go build ./...   ok
go vet ./...     ok
go test ./tui/   ok (0.368s)

Manual check: running the login form, typing into the password field, pressing ctrl+v flips the masked dots to plain text. Pressing again re-masks. Focus changes don't leak the reveal into other fields.

AI assistance

This contribution was developed with AI assistance (Claude Code). Per matcha's AI Policy: I understand what was submitted, the change was verified via go build, go vet, and go test ./tui/, and the manual-check bullet above was the hands-on confirmation. No AI-generated tests were added for coverage padding.

@mvanhorn mvanhorn requested a review from a team as a code owner April 20, 2026 09:05
@github-actions github-actions Bot added ci CI / build pipeline enhancement New feature or request question Further information requested labels Apr 20, 2026
@andrinoff
Copy link
Copy Markdown
Member

andrinoff commented Apr 20, 2026

@mvanhorn remove the first commit. (git rebase -i HEAD~2 and replace pick on the first commit with d, or drop).

@andrinoff andrinoff removed ci CI / build pipeline question Further information requested labels Apr 20, 2026
@andrinoff andrinoff force-pushed the osc/593-password-visibility branch from 0b4bb57 to e5a755a Compare April 20, 2026 09:13
Closes floatpane#593.

Typos in app-passwords are hard to spot under EchoPassword and the
workaround was to delete and retype. This wires ctrl+v (only while
the password input has focus) to flip between EchoPassword and
EchoNormal on inputs[inputPassword], matching the approach the issue
suggested.

The help line under the form already lists the other chord shortcuts
(enter / tab / esc), so the new chord is appended to that same line
and only while the password field is focused — keeps the hint
discoverable without cluttering the view when focus is elsewhere.

Go build, go vet, and go test ./tui all pass locally.

Signed-off-by: drew <me@andrinoff.com>
@andrinoff andrinoff force-pushed the osc/593-password-visibility branch from e5a755a to 71f2390 Compare April 20, 2026 09:15
@andrinoff
Copy link
Copy Markdown
Member

re-signed the commit.

Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

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

lgtm

@andrinoff andrinoff merged commit 125208f into floatpane:master Apr 20, 2026
11 checks passed
@github-actions github-actions Bot added ci CI / build pipeline question Further information requested labels Apr 20, 2026
@andrinoff andrinoff removed ci CI / build pipeline question Further information requested labels Apr 20, 2026
@mvanhorn
Copy link
Copy Markdown
Contributor Author

Thanks for landing the password visibility toggle, @andrinoff.

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.

FEAT: Password visibility toggle in Login

2 participants