consistency: three different error display patterns used for password validation #87

Closed
opened 2026-02-28 21:30:01 +01:00 by clawbot · 1 comment
Collaborator

Problem

Password validation errors are displayed using three different patterns across the codebase:

  1. showError()/hideError() helpers with min-height error div (used by confirm-tx)
  2. Direct DOM manipulation with hidden class toggling (used by approve-tx, approve-sign)
  3. Global flash message system via showFlash() (used by add-wallet, import-key)
  4. Per-view flash divs with inconsistent styling (used by export-privkey with export-privkey-flash, delete-wallet with delete-wallet-flash using text-red-500)

Expected behavior

All password error displays should use a consistent pattern. The showError()/hideError() helper approach with min-height error divs prevents layout shift and centralizes the logic.

Files affected

  • src/popup/views/approval.js (direct DOM for approve-tx-error, approve-sign-error)
  • src/popup/views/addressDetail.js (export-privkey-flash)
  • src/popup/views/deleteWallet.js (delete-wallet-flash with text-red-500)
  • src/popup/views/addWallet.js (global showFlash)
  • src/popup/views/importKey.js (global showFlash)
  • src/popup/index.html (error div markup)

Suggested fix

Standardize all password error areas to use dedicated error divs with min-h-[1.25rem] and the showError()/hideError() helpers from helpers.js.

Found during consistency audit for #78.

## Problem Password validation errors are displayed using three different patterns across the codebase: 1. **`showError()`/`hideError()` helpers** with `min-height` error div (used by `confirm-tx`) 2. **Direct DOM manipulation** with `hidden` class toggling (used by `approve-tx`, `approve-sign`) 3. **Global flash message system** via `showFlash()` (used by `add-wallet`, `import-key`) 4. **Per-view flash divs** with inconsistent styling (used by `export-privkey` with `export-privkey-flash`, `delete-wallet` with `delete-wallet-flash` using `text-red-500`) ## Expected behavior All password error displays should use a consistent pattern. The `showError()`/`hideError()` helper approach with `min-height` error divs prevents layout shift and centralizes the logic. ## Files affected - `src/popup/views/approval.js` (direct DOM for approve-tx-error, approve-sign-error) - `src/popup/views/addressDetail.js` (export-privkey-flash) - `src/popup/views/deleteWallet.js` (delete-wallet-flash with text-red-500) - `src/popup/views/addWallet.js` (global showFlash) - `src/popup/views/importKey.js` (global showFlash) - `src/popup/index.html` (error div markup) ## Suggested fix Standardize all password error areas to use dedicated error divs with `min-h-[1.25rem]` and the `showError()`/`hideError()` helpers from `helpers.js`. Found during consistency audit for #78.
clawbot added the
bot
label 2026-02-28 21:30:01 +01:00
clawbot self-assigned this 2026-02-28 21:45:16 +01:00
clawbot removed their assignment 2026-02-28 21:45:45 +01:00
clawbot self-assigned this 2026-02-28 22:02:26 +01:00
clawbot removed their assignment 2026-02-28 22:02:44 +01:00
clawbot self-assigned this 2026-02-28 22:22:36 +01:00
clawbot removed their assignment 2026-02-28 22:22:46 +01:00
clawbot self-assigned this 2026-02-28 22:38:07 +01:00
clawbot removed their assignment 2026-02-28 22:38:24 +01:00
Author
Collaborator

Covered by PR #92 (merged) which standardized error divs to use showError/hideError with min-height.

Covered by PR #92 (merged) which standardized error divs to use `showError`/`hideError` with `min-height`.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/AutistMask#87
No description provided.