Skip to content

Warn before truncated value displays#2007

Open
benma-agent wants to merge 1 commit into
BitBoxSwiss:masterfrom
benma-agent:warn-truncated-values
Open

Warn before truncated value displays#2007
benma-agent wants to merge 1 commit into
BitBoxSwiss:masterfrom
benma-agent:warn-truncated-values

Conversation

@benma-agent

Copy link
Copy Markdown

Summary

  • add a shared value confirmation helper that warns before UI label truncation
  • route shared message verification, Ethereum tx/typed-data values, and BTC policy name/policy screens through it
  • add boundary and ETH/BTC sign-message tests

Verification

  • cargo fmt --manifest-path src/rust/Cargo.toml --all
  • env PATH="$PWD/tools/prost-build-proto/target/debug:$PATH" cargo test --manifest-path src/rust/Cargo.toml -p bitbox02-rust --all-features -- --test-threads 1
  • git diff --check

@benma-agent benma-agent force-pushed the warn-truncated-values branch 2 times, most recently from 2f9d028 to b395cb2 Compare July 9, 2026 00:22
@benma benma requested a review from cedwies July 9, 2026 00:24
Show the existing large-value warning before value confirmation bodies that exceed the UI label limit.

Apply it to shared message verification, Ethereum transaction and typed-data values, and BTC policy name/policy displays.
@benma-agent benma-agent force-pushed the warn-truncated-values branch from b395cb2 to 69a1dd7 Compare July 9, 2026 08:37

@cedwies cedwies left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utACK.

Nit: bitbox02-firmware/src/ui/components/label.h still has the stale comment // Keep this in sync with src/rust/bitbox02-rust/src/hww/api/ethereum.rs:MAX_CONFIRM_BODY_SIZE

Nit: BTC policy display now uses confirm_value() but there is no direct policy-specific long-policy test. But I leave that up to you if you want to add another test for this.

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.

2 participants