-
Notifications
You must be signed in to change notification settings - Fork 8
Fix paste words bugs #526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix paste words bugs #526
Conversation
Use HorizontalPager to enable swipe gestures between pages (1-12 and 13-24) for 24-word imports, matching the pattern used in HotWalletCreateScreen.
📝 WalkthroughWalkthroughThe 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
|
@greptile-apps review |
Greptile OverviewGreptile SummaryFixed validation display issues when pasting words during hot wallet import on both Android and iOS platforms. Android changes:
iOS changes:
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
Important Files Changed
Sequence DiagramsequenceDiagram
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
|
Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.