Skip to content

Conversation

@praveenperera
Copy link
Contributor

@praveenperera praveenperera commented Jan 23, 2026

Summary by CodeRabbit

  • New Features

    • Added multi-page word entry interface with page navigation and visual indicators for the hot wallet import flow.
  • Bug Fixes

    • Improved word validation accuracy and enhanced handling of programmatic text input during wallet import.

✏️ Tip: You can customize this high-level summary in your review settings.

Use HorizontalPager to enable swipe gestures between pages (1-12 and 13-24)
for 24-word imports, matching the pattern used in HotWalletCreateScreen.
@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

The changes enhance the hot wallet import flow with a multi-page word input interface on Android using HorizontalPager with synchronized paging state, while refactoring iOS validation logic to handle programmatic text changes and word validation against entered words.

Changes

Cohort / File(s) Summary
Android Hot Wallet Import UI
android/app/src/main/java/org/bitcoinppl/cove/flows/NewWalletFlow/hot_wallet/HotWalletImportCard.kt
Added optional modifier parameter to WordInputGrid, enabling callers to configure layout instead of using hardcoded fillMaxWidth().
Android Hot Wallet Import Paging
android/app/src/main/java/org/bitcoinppl/cove/flows/NewWalletFlow/hot_wallet/HotWalletImportScreen.kt
Introduced HorizontalPager for multi-page word entry with pager-state synchronization to tabIndex; replaced single WordInputGrid with paginated version; added page indicator dots with coroutine-scoped scroll animation; expanded paste handling and navigation logic.
iOS Hot Wallet Import Validation
ios/Cove/Flows/NewWalletFlow/HotWallet/HotWalletImportCard.swift
Reworked AutocompleteField validation to use isValidWord(word:allWords:) instead of isBip39Word(); enhanced onChange handling to detect programmatic text changes (e.g., paste) via text comparison and validate against allEnteredWords; adjusted initial trigger behavior.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Screen as HotWalletImportScreen
    participant Pager as HorizontalPager
    participant Grid as WordInputGrid
    participant Indicator as PageIndicator
    participant State as PagerState

    User->>Screen: Interact with word input
    Screen->>State: Check tabIndex change
    State->>Pager: Sync to current page
    Pager->>Grid: Render WordInputGrid for page
    Grid->>User: Display word input fields
    
    User->>Grid: Enter/paste word or click indicator
    Grid->>Screen: Update focusedField/trigger paste
    Screen->>State: Launch coroutine
    State->>Pager: animateScrollToPage(tabIndex)
    Pager->>Indicator: Update dot position
    Indicator->>User: Highlight active page
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A rabbit's delight in the code:
Pages turn smoothly, word by word,
Pager hops left, pager hops right,
iOS validates with all its might,
Paste and sync make import light!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix paste words bugs' directly addresses the main objective of the PR, which is to fix issues related to pasting words during wallet import.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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
Copy link
Contributor Author

@greptile-apps review

@greptile-apps
Copy link

greptile-apps bot commented Jan 23, 2026

Greptile Overview

Greptile Summary

Fixed validation display issues when pasting words during hot wallet import on both Android and iOS platforms.

Android changes:

  • Integrated HorizontalPager to enable swipeable page navigation for multi-page word entry
  • Implemented bidirectional synchronization between pager swipes and tab selection via page indicator dots
  • Refactored padding control by adding modifier parameter to WordInputGrid component

iOS changes:

  • Fixed word validation state not updating when text is set programmatically (e.g., via paste)
  • Changed onChange to run on initial render (initial: true) to ensure proper validation on mount
  • Added early return logic to handle programmatic text changes where oldText == newText

These changes improve the UX by ensuring pasted words immediately display correct validation colors (green for valid, red for invalid) and enabling intuitive page navigation through both swipes and dot indicators.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes are focused bug fixes with clear intent. The Android pager integration follows standard Compose patterns with proper state synchronization. The iOS validation fix correctly handles programmatic text changes. No logic errors, security issues, or breaking changes detected.
  • No files require special attention

Important Files Changed

Filename Overview
android/app/src/main/java/org/bitcoinppl/cove/flows/NewWalletFlow/hot_wallet/HotWalletImportCard.kt Added optional modifier parameter to WordInputGrid for flexible padding control from parent components
android/app/src/main/java/org/bitcoinppl/cove/flows/NewWalletFlow/hot_wallet/HotWalletImportScreen.kt Implemented HorizontalPager for swipeable word entry pages with bidirectional sync between pager state and tab index
ios/Cove/Flows/NewWalletFlow/HotWallet/HotWalletImportCard.swift Fixed word validation to run on initial render and programmatic text changes, ensuring pasted words show correct validation state

Sequence Diagram

sequenceDiagram
    participant User
    participant Screen as HotWalletImportScreen
    participant Pager as HorizontalPager
    participant Grid as WordInputGrid
    participant Field as WordInputField
    participant Validator as Bip39WordSpecificAutocomplete

    User->>Screen: Paste mnemonic words
    Screen->>Screen: handlePasteMnemonic()
    Screen->>Screen: Parse and validate words
    Screen->>Screen: Update enteredWords state
    Screen->>Pager: Navigate to last page
    Screen->>Field: Set focusedField to last word
    
    Field->>Field: onChange(text) triggered
    Field->>Field: Detect programmatic change (oldText == newText)
    Field->>Validator: isValidWord(word, allWords)
    Validator-->>Field: Returns validation result
    Field->>Field: Update state (valid/invalid)
    Field->>Field: Update text color (green/red)
    
    User->>Pager: Swipe to change page
    Pager->>Screen: Update pagerState.currentPage
    Screen->>Screen: LaunchedEffect syncs tabIndex
    Screen->>Grid: Re-render with new page
    
    User->>User: Click page indicator dot
    User->>Screen: Trigger animateScrollToPage(i)
    Screen->>Pager: Animate to selected page
    Pager->>Screen: Update currentPage
    Screen->>Screen: Sync tabIndex with page
Loading

@praveenperera praveenperera merged commit 5431771 into master Jan 23, 2026
10 checks passed
@praveenperera praveenperera deleted the fix-paste-words-bugs branch January 23, 2026 02:53
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