Skip to content

feat(textfield): a password revealable by an eye - #30

Merged
adammharris merged 1 commit into
mainfrom
cc/loving-mendel-0icfvy
Nov 19, 2026
Merged

adammharris merged 1 commit into
mainfrom
cc/loving-mendel-0icfvy

Conversation

@adammharris

Copy link
Copy Markdown
Member

TextField { kind: InputKind::Password, revealable: true } puts an eye at the field's end that shows the password as text and hides it again. It is the same <input> with its type changed, so its text and caret stay.

  • src/components/text_field.rs: the revealable prop. It is a ToggleButton (Ghost, "Show password" / "Hide password", aria-pressed) beside the input, before the field's action if it has one. On any kind other than Password it does nothing.
  • src/icon.rs: Lucide's eye joins the icons, next to eye-off.
  • Gallery: the Text card has a password field. A new Blitz test, a_password_is_shown_by_its_eye_and_hidden_again, presses the eye both ways and types afterwards. An SSR test in src/lib.rs checks the markup.

Related. Blitz draws a password input's text exactly as typed, hiding it only from assistive tech. A KeePass client built on Unit (adammharris/kdbx) found this. The fix belongs in diaryx-org/blitz: a feat/password-input branch is written and tested but not yet pushed. It draws a bullet per character and keeps the text in a buffer that is wiped when it changes. This PR doesn't depend on it; under Blitz from leaf, the field still draws as typed until that branch lands.

Checks. ship and corgi aren't installed in this environment, so I ran each job in .config/ship.figl by hand with cargo:

  • fmt, clippy -D warnings, the wasm32 web lint, and docs -D warnings are clean.
  • cargo test --workspace passes: 78 library tests, 79 Blitz tests and the audit.
  • The Blitz tests also pass with UNIT_APPEARANCE=dark.

Generated by Claude Code

TextField { kind: InputKind::Password, revealable: true } puts an eye at
the field's end that shows the password as text and hides it again: the
same <input>, its type changed, so its text and caret stay. lucide's eye
joins the icons. The gallery's Text card has a password field, and a Blitz
test presses its eye both ways and types after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P3EBi4NUiH6dAfkRnuv9cz
@adammharris
adammharris merged commit 38df93d into main Nov 19, 2026
6 of 7 checks passed
@adammharris
adammharris deleted the cc/loving-mendel-0icfvy branch November 19, 2026 05:13
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