Skip to content

feat(accounts): inner hash for encrypted accounts, bigger back button hitbox - #627

Merged
n13 merged 2 commits into
mainfrom
n13/encrypted-account-inner-hash
Sep 3, 2026
Merged

feat(accounts): inner hash for encrypted accounts, bigger back button hitbox#627
n13 merged 2 commits into
mainfrom
n13/encrypted-account-inner-hash

Conversation

@n13

@n13 n13 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Encrypted account inner hash

  • Encrypted account rows in the accounts list get the same menu control as regular accounts.
  • The account menu for an encrypted account shows the lock badge, keeps Account Name read-only (no chevron, no tap), and replaces Address Details with Inner Hash.
  • New InnerHashScreen: same layout as address details with a single card holding the inner hash, a copy button and Share. The value is WormholeKeyPair.rewardsPreimageHex of the current receive key pair, i.e. the first Poseidon2 hash of the secret that miners pass as --rewards-inner-hash (see quantus-cli examples/wormhole_sdk_usage.rs). Using the receive index keeps it consistent with the Receive screen.
  • Strings added to app_en.arb and app_id.arb, generated files updated.

DRY refactor

  • CopyableDataItem extracted from AddressDetailsCard (label, value, copy button with 2s check mark) and reused by both cards. Copy indicators on the address card are now independent per item instead of mutually exclusive.
  • SplitCard.single for a one-section card; MenuRow.onTap nullable, hiding the chevron when static.

Bigger back button hitbox (quantus_sdk)

  • AppBackButton lays out as a 48×48pt opaque tap target with the unchanged 28pt circle at its left edge, so the extra area extends right, above and below (Flutter hit testing can't spill outside the widget's bounds into the screen-edge margin).
  • V2AppBar uses equal 48pt side slots, so the title is exactly centred whatever sits in them, and default vertical padding is 6/22 so the bar keeps its 76pt height.

Verification

  • melos run format and melos run analyze clean across all packages.
  • Verified on the iOS simulator: list row menu, encrypted account menu, inner hash page (clipboard held the hex value), the regular account's address details after the refactor, and a tap outside the circle but inside the 48pt area pops the screen.
  • Checked other V2AppBar callers: the cold wallet home bar icons stay at the edges, the QR scanner bar keeps its height.

… hitbox

Encrypted account rows get the same menu control as regular accounts. Their
menu keeps the name read-only and replaces Address Details with an Inner Hash
page showing the receive key pair's rewards preimage (the value miners pass as
--rewards-inner-hash), with copy and share.

Extract CopyableDataItem from AddressDetailsCard, add SplitCard.single and a
nullable MenuRow.onTap so nothing is duplicated.

AppBackButton now has a 48pt tap target around the unchanged 28pt visual, and
V2AppBar uses equal 48pt side slots so the title stays centred at the same bar
height.
@n13 n13 added the bot-review Request automated review from review-bot label Sep 2, 2026

@n13 n13 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer model: GPT Sol

Verdict (advisory): Approve

No blocking findings.

The encrypted-account path derives the displayed inner hash from the same current receive key pair used by Receive, and the resulting rewardsPreimageHex matches the miner/node --rewards-inner-hash contract. The menu correctly keeps encrypted account names static, the shared copy component preserves independent feedback state, and the app-bar change uses symmetric 48 pt slots while preserving the existing 76 pt bar height.

Validation:

  • git diff --check passed for the PR diff and GitHub's synthetic merge commit.
  • Workspace formatting covered 710 Dart files with 0 changes.
  • The focused V2AppBar test passed, along with 463 non-native SDK tests, 424 mobile tests, and 270 cold-wallet tests.
  • The 10-second local analyzer cap completed cold-wallet, miner, and SDK with no issues before reaching mobile; GitHub's full Analyze check passed.
  • Localization generation during bootstrap left the checked-in generated files unchanged.

Non-blocking: dedicated widget coverage for the new encrypted-menu/inner-hash states and the 48 pt hitbox geometry would strengthen regression protection.

@n13 n13 removed the bot-review Request automated review from review-bot label Sep 2, 2026

void _share() {
final innerHash = _innerHash;
if (innerHash == null) return;

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.

Why bother saving to temporary variable if we can check directly?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Dart won't promote a mutable field, so without the local this would need _innerHash!. Kept it to avoid the bang.

@override
Widget build(BuildContext context) {
final l10n = ref.watch(l10nProvider);
final innerHash = _innerHash;

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.

why bother do this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fair, nothing here needs promotion. Removed in 11b12fc.

@dewabisma dewabisma 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.

LGTM! Just few nits

@n13
n13 merged commit a174b68 into main Sep 3, 2026
2 checks passed
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