Fix unlocked TUI field values and selected-field contrast #66

Closed
opened 2026-08-10 15:24:01 +00:00 by hugo · 1 comment
Owner

Goal

Make the unlocked TUI entry viewer readable and useful: render field values according to storage-provided sensitivity and keep the selected field legible with clear high contrast.

Observed behavior

In the TUI Viewer after an entry is unlocked, field labels are visible but values are rendered as identical bullet placeholders, including ordinary fields such as autoType_enabled and icon. The selected Password row uses a light selection background while its foreground and nested field styling remain too faint to read reliably. This was reproduced in the native terminal UI shown in the report screenshot.

Scope

  • Trace the production TUI viewer path from the storage-provided structured EntryDocument through viewer row construction and terminal styling; fix the actual runtime path rather than only test fixtures.
  • After authentication, render ordinary/non-sensitive field values as their real text, including empty, Unicode, repeated, long, and multiline values.
  • Keep sensitive values masked by default according to crates/storage metadata, but make explicit reveal display the real value and ensure focus changes, lock, and authentication expiry hide it again.
  • Apply a selected-field style whose foreground and background remain clearly distinguishable, and ensure selection styling overrides nested label/value colors instead of producing low-contrast spans.
  • Preserve a readable monochrome and limited-color fallback; do not hard-code assumptions that work only in one terminal theme.
  • Keep parsing and sensitivity decisions in crates/storage. The TUI must render typed fields and must not infer security policy from labels or display strings.

Tests and verification

  • Add a regression test that drives the same unlocked production viewer path with ordinary and sensitive fields and asserts ordinary values are present, sensitive values are masked until reveal, and revealed values disappear again on focus change or lock.
  • Add rendering assertions for selected label/value spans in normal color and monochrome/limited-color capabilities so selected content has an explicit contrasting foreground and background.
  • Exercise a representative real entry fixture through unlock and render, not only a hand-built row helper.
  • Run cargo fmt --all -- --check, RUSTFLAGS="-D warnings" cargo check --workspace --all-targets, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace.

Acceptance criteria

  • An unlocked entry displays every ordinary field value losslessly in the Viewer.
  • Sensitive fields are readable after explicit reveal and are otherwise masked according to storage policy.
  • The currently selected field label and value are visibly high-contrast on supported color capabilities and remain readable in monochrome fallback.
  • Changing focus, locking, or authentication expiry cannot leave a sensitive value visible.
  • The fix is covered through the real viewer/render path and introduces no TUI-owned parsing or sensitivity rules.
## Goal Make the unlocked TUI entry viewer readable and useful: render field values according to storage-provided sensitivity and keep the selected field legible with clear high contrast. ## Observed behavior In the TUI Viewer after an entry is unlocked, field labels are visible but values are rendered as identical bullet placeholders, including ordinary fields such as autoType_enabled and icon. The selected Password row uses a light selection background while its foreground and nested field styling remain too faint to read reliably. This was reproduced in the native terminal UI shown in the report screenshot. ## Scope - Trace the production TUI viewer path from the storage-provided structured EntryDocument through viewer row construction and terminal styling; fix the actual runtime path rather than only test fixtures. - After authentication, render ordinary/non-sensitive field values as their real text, including empty, Unicode, repeated, long, and multiline values. - Keep sensitive values masked by default according to crates/storage metadata, but make explicit reveal display the real value and ensure focus changes, lock, and authentication expiry hide it again. - Apply a selected-field style whose foreground and background remain clearly distinguishable, and ensure selection styling overrides nested label/value colors instead of producing low-contrast spans. - Preserve a readable monochrome and limited-color fallback; do not hard-code assumptions that work only in one terminal theme. - Keep parsing and sensitivity decisions in crates/storage. The TUI must render typed fields and must not infer security policy from labels or display strings. ## Tests and verification - Add a regression test that drives the same unlocked production viewer path with ordinary and sensitive fields and asserts ordinary values are present, sensitive values are masked until reveal, and revealed values disappear again on focus change or lock. - Add rendering assertions for selected label/value spans in normal color and monochrome/limited-color capabilities so selected content has an explicit contrasting foreground and background. - Exercise a representative real entry fixture through unlock and render, not only a hand-built row helper. - Run cargo fmt --all -- --check, RUSTFLAGS="-D warnings" cargo check --workspace --all-targets, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace. ## Acceptance criteria - An unlocked entry displays every ordinary field value losslessly in the Viewer. - Sensitive fields are readable after explicit reveal and are otherwise masked according to storage policy. - The currently selected field label and value are visibly high-contrast on supported color capabilities and remain readable in monochrome fallback. - Changing focus, locking, or authentication expiry cannot leave a sensitive value visible. - The fix is covered through the real viewer/render path and introduces no TUI-owned parsing or sensitivity rules.
hugo added this to the 03 - Cross-platform Iced desktop app milestone 2026-08-10 15:24:01 +00:00
hugo added the bug label 2026-08-10 15:24:01 +00:00
Author
Owner

Implemented and verified in commit 7c64be3.

  • Storage now classifies autoType_enabled and icon as ordinary presentation metadata, so the unlocked TUI renders their real lossless values while passwords, OTP data, notes, and unknown fields remain masked by storage policy.
  • Viewer/editor selection now overrides every nested span with bold black-on-white contrast and retains reverse-video monochrome fallback.
  • Added an encrypted OpenPGP regression that drives sidebar activation, authentication grant, document load, render, reveal, focus-change hiding, and authentication-expiry cleanup.

Verification passed: cargo fmt --all -- --check; RUSTFLAGS="-D warnings" cargo check --workspace --all-targets; cargo clippy --workspace --all-targets -- -D warnings; cargo test --workspace.

Implemented and verified in commit 7c64be3. - Storage now classifies `autoType_enabled` and `icon` as ordinary presentation metadata, so the unlocked TUI renders their real lossless values while passwords, OTP data, notes, and unknown fields remain masked by storage policy. - Viewer/editor selection now overrides every nested span with bold black-on-white contrast and retains reverse-video monochrome fallback. - Added an encrypted OpenPGP regression that drives sidebar activation, authentication grant, document load, render, reveal, focus-change hiding, and authentication-expiry cleanup. Verification passed: `cargo fmt --all -- --check`; `RUSTFLAGS="-D warnings" cargo check --workspace --all-targets`; `cargo clippy --workspace --all-targets -- -D warnings`; `cargo test --workspace`.
hugo closed this issue 2026-08-10 15:52:15 +00:00
Sign in to join this conversation.