Skip to content

feat(housewallet): port the cu-04b house wallet screen#37

Merged
netqo merged 3 commits into
devfrom
feat/house-wallet-screen
Jun 13, 2026
Merged

feat(housewallet): port the cu-04b house wallet screen#37
netqo merged 3 commits into
devfrom
feat/house-wallet-screen

Conversation

@netqo

@netqo netqo commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

Ports the cu-04b operator house wallet screen (mockup/js/screens/house-wallet.js) and wires it into the nav graph in place of the placeholder. All five mockup states are covered: Generate / Import setup, the active wallet (balance, public address, Android-Keystore-backed private key), the key-revealed view with an auto-hide countdown, the biometric prompt overlay, and the no-biometric error (preview-only).

This branch also lands two pieces the screen depends on, each in its own commit:

  • refactor(util): truncateMiddle (the middle-ellipsis shortener) moves from feature/rounddetail to util/ so the provably-fair seeds and the house wallet address share it.
  • feat(ui): an in-app toast host styled like mockup/js/toast.js (success / error / info / warn), hoisted in StackApp and reachable from any screen via LocalToastController.

Rationale

  • No ViewModel (KISS): wallet existence, key-revealed and prompt visibility are screen-local state; Generate / Import create the wallet, "Reveal with Biometric" raises the prompt, authenticating reveals the key (auto-hiding after a countdown), Hide Now re-masks it.
  • The public address renders on a single line, middle-truncated (first 10 + last 8), with spacing between the field and the copy / Polygonscan chips so they no longer collide (addresses earlier review feedback).
  • The chip actions are functional with the standard ripple: refresh and copy confirm via the in-app toast (copy also writes the full address to the clipboard); Polygonscan opens the explorer, toasting on failure.
  • Real key generation / import, the Android Keystore and the on-chain balance arrive with the wallet repository; the review-less states are preview-only.

Verification

  • ./gradlew ktlintCheck detekt testDebugUnitTest -> BUILD SUCCESSFUL
  • ./gradlew assembleDebug -> BUILD SUCCESSFUL
  • ./gradlew compileDebugAndroidTestKotlin -> BUILD SUCCESSFUL
  • On device: Profile -> House Wallet runs the full flow (setup, reveal with the biometric overlay + countdown, hide), the address is single-line, and the three chips fire their toasts.

Test plan

  • ktlint + detekt clean
  • HouseWalletFormatTest and TruncateMiddleTest green
  • HouseWalletScreenTest compiles (instrumented; not run in the CI matrix)
  • Debug APK assembles
  • Manual device walkthrough

Checklist

  • Commit messages follow Conventional Commits (see CONTRIBUTING.md).
  • Branch name follows the naming convention (feat/).
  • The change is scoped: house wallet plus the two helpers it needs (each its own commit).
  • If user-visible behavior changed, CHANGELOG.md has been updated under [Unreleased].
  • If a new dependency was added, it is justified in the PR description. (No new dependency.)

netqo added 3 commits June 12, 2026 21:05
The middle-ellipsis string shortener lived in feature/rounddetail but is
also needed by the house wallet address, so promote it to `util/` and
route the provably-fair seeds through it. Its test moves alongside.

No behavior change.
Adds a top-anchored, slide-in toast with success / error / info / warn
styling that mirrors mockup/js/toast.js (colored border + tint, glyph,
title + optional body, auto-dismiss). The ToastHostState is hoisted once
in StackApp and reachable from any screen through LocalToastController,
replacing the generic system Toast for in-app feedback.
The operator-only wallet management view reached from Profile, with all
five mockup states: Generate / Import setup, the active wallet (balance,
public address, Android-Keystore private key), the key-revealed view with
an auto-hide countdown, the biometric prompt overlay, and the
no-biometric error (preview-only). The public address is middle-truncated
to a single line via truncateMiddle, and the refresh / copy / Polygonscan
chips give feedback through the in-app toast.

Replaces the house wallet placeholder in StackNavHost. Tests:
HouseWalletFormatTest (the countdown formatter) and HouseWalletScreenTest
(the unset / active / revealed states and the back callback).
@netqo netqo merged commit 84d94a8 into dev Jun 13, 2026
3 checks passed
@netqo netqo deleted the feat/house-wallet-screen branch June 13, 2026 00:12
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