Skip to content

Android route hook up, sidebar and misc fixes#452

Merged
praveenperera merged 9 commits intomasterfrom
android-initial-testing
Nov 12, 2025
Merged

Android route hook up, sidebar and misc fixes#452
praveenperera merged 9 commits intomasterfrom
android-initial-testing

Conversation

@praveenperera
Copy link
Copy Markdown
Contributor

@praveenperera praveenperera commented Nov 12, 2025

Summary by CodeRabbit

  • New Features

    • Added hardware wallet import functionality with multiple options: QR Code, File, NFC, and Paste.
    • Introduced slide-out sidebar navigation for easy wallet selection and app settings access.
    • Added back navigation support in wallet transaction screens for improved navigation flow.
  • Chores

    • Updated Android Gradle plugin to version 8.13.1.
    • Added encrypted storage dependency for enhanced security.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 12, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR introduces a comprehensive sidebar UI with wallet management, implements secure encrypted storage via Keychain, adds a hardware wallet import workflow with a bottom sheet interface, and refactors app initialization and routing state management to support enhanced navigation and AppManager visibility.

Changes

Cohort / File(s) Summary
Build & Dependency Updates
android/build.gradle.kts, android/app/build.gradle.kts
Updated Android Gradle plugin from 8.11.1 to 8.13.1; added androidx.security:security-crypto:1.1.0-alpha06 dependency
Security Infrastructure
android/app/src/main/java/org/bitcoinppl/cove/Security.kt
New file implementing KeychainAccessor (encrypted SharedPreferences with AES256 encryption) and DeviceAccessor (timezone retrieval) for secure storage and device access
App Initialization & State
android/app/src/main/java/org/bitcoinppl/cove/CoveApplication.kt, android/app/src/main/java/org/bitcoinppl/cove/AppManager.kt
Added Keychain and Device initialization during app startup; changed isSidebarVisible setter visibility to internal; added router.updateRoutes(...) calls in route mutation methods
Navigation & Routing
android/app/src/main/java/org/bitcoinppl/cove/MainActivity.kt, android/app/src/main/java/org/bitcoinppl/cove/SelectedWalletContainer.kt
Wrapped RouteView in SidebarContainer; added canGoBack flag with conditional back/menu navigation logic in WalletTransactionsScreen
Wallet Selection & Containers
android/app/src/main/java/org/bitcoinppl/cove/NewWalletContainer.kt, android/app/src/main/java/org/bitcoinppl/cove/flow/new_wallet/NewWalletSelectScreen.kt
Added app parameter to NewWalletSelectScreen; implemented hardware wallet import workflow with bottom sheet supporting QR, File, NFC, and Paste import methods
Sidebar UI Components
android/app/src/main/java/org/bitcoinppl/cove/sidebar/SidebarContainer.kt, android/app/src/main/java/org/bitcoinppl/cove/sidebar/SidebarView.kt
New SidebarContainer with animated drag gestures and backdrop; new SidebarView displaying wallet list, add wallet, and settings navigation
Transaction Screen Update
android/app/src/main/java/org/bitcoinppl/cove/wallet_transactions/WalletTransactionsScreen.kt
Added canGoBack parameter with conditional navigationIcon rendering (Back vs. Menu)

Sequence Diagram(s)

sequenceDiagram
    participant App as CoveApplication<br/>(onCreate)
    participant KA as KeychainAccessor
    participant Device as DeviceAccessor
    participant AM as AppManager<br/>getInstance()
    participant MainAct as MainActivity

    App->>KA: initialize Keychain
    activate KA
    KA-->>App: success / KeychainException
    deactivate KA
    
    alt Keychain Success
        App->>Device: initialize Device/timezone
        activate Device
        Device-->>App: ready
        deactivate Device
        App->>AM: getInstance() to prepare updater
        activate AM
        AM-->>App: instance ready
        deactivate AM
        App->>MainAct: start lifecycle
    else Keychain Failed
        App->>App: throw RuntimeException
    end
Loading
sequenceDiagram
    participant User as User
    participant NWS as NewWalletSelectScreen
    participant BMS as ModalBottomSheet
    participant IW as importWallet()
    participant Rust as app.rust
    participant Nav as app.popRoute()
    participant Alert as app.alerts

    User->>NWS: tap "Hardware Wallet"
    NWS->>BMS: show bottom sheet (QR/File/NFC/Paste)
    activate BMS
    User->>BMS: select import method (e.g., QR)
    BMS->>IW: pass content (Xpub)
    deactivate BMS
    
    activate IW
    alt Wallet Creation Succeeds
        IW->>Rust: create & select wallet
        Rust-->>IW: wallet ID
        IW->>Alert: show success
        IW->>Nav: popRoute()
    else Wallet Already Exists
        IW->>Rust: select existing wallet
        IW->>Alert: show success
    else Error
        IW->>Alert: show error
    end
    deactivate IW
Loading
sequenceDiagram
    participant User as User
    participant SC as SidebarContainer
    participant Drag as Drag Gesture
    participant SV as SidebarView
    participant AM as AppManager
    participant Router as app.router

    User->>SC: drag from edge (when routes.isEmpty)
    activate SC
    SC->>Drag: track drag offset
    Drag-->>SC: current offset
    
    alt Drag passes 50% threshold
        SC->>AM: isSidebarVisible = true
        AM-->>SC: state updated
    else Drag below threshold
        SC->>AM: isSidebarVisible = false
    end
    deactivate SC
    
    SC->>SV: render at currentOffset
    activate SV
    SV->>Router: load wallets from database
    Router-->>SV: wallet list
    User->>SV: tap wallet
    SV->>AM: toggleSidebar()
    SV->>Router: navigate to wallet
    deactivate SV
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Security implementation (Security.kt): Review encryption setup, Master­Key initialization, and error handling for encrypted SharedPreferences usage
  • Sidebar component logic (SidebarContainer.kt): Verify drag gesture calculation, dampening application, offset clamping, and animation state management
  • Hardware wallet import workflow (NewWalletSelectScreen.kt): Validate content picker integration, clipboard access, wallet creation/selection logic, and error handling paths
  • App initialization sequence (CoveApplication.kt): Ensure Keychain/Device initialization occurs before FFI usage and exception handling is sound
  • Router state synchronization (AppManager.kt): Confirm router.updateRoutes() calls are consistent across all route mutation methods

Possibly related PRs

Suggested labels

android

Poem

🐰 A sidebar hops into view, wallets in row,
Secure keys encrypted below,
Drag gestures dance, hardware imports flow,
State synchronized, AppManager's glow! 🔐✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch android-initial-testing

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a434a8 and 79d0c11.

⛔ Files ignored due to path filters (1)
  • android/app/src/main/res/drawable/cove_logo.jpg is excluded by !**/*.jpg
📒 Files selected for processing (12)
  • android/app/build.gradle.kts (1 hunks)
  • android/app/src/main/java/org/bitcoinppl/cove/AppManager.kt (5 hunks)
  • android/app/src/main/java/org/bitcoinppl/cove/CoveApplication.kt (2 hunks)
  • android/app/src/main/java/org/bitcoinppl/cove/MainActivity.kt (2 hunks)
  • android/app/src/main/java/org/bitcoinppl/cove/NewWalletContainer.kt (1 hunks)
  • android/app/src/main/java/org/bitcoinppl/cove/Security.kt (1 hunks)
  • android/app/src/main/java/org/bitcoinppl/cove/SelectedWalletContainer.kt (1 hunks)
  • android/app/src/main/java/org/bitcoinppl/cove/flow/new_wallet/NewWalletSelectScreen.kt (4 hunks)
  • android/app/src/main/java/org/bitcoinppl/cove/sidebar/SidebarContainer.kt (1 hunks)
  • android/app/src/main/java/org/bitcoinppl/cove/sidebar/SidebarView.kt (1 hunks)
  • android/app/src/main/java/org/bitcoinppl/cove/wallet_transactions/WalletTransactionsScreen.kt (3 hunks)
  • android/build.gradle.kts (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@praveenperera praveenperera merged commit c9edb89 into master Nov 12, 2025
7 of 9 checks passed
@praveenperera praveenperera deleted the android-initial-testing branch November 12, 2025 21:19
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