fix(ui): let the key-rotation confirmation be arrowed to NO - #144
Conversation
UiMode::ConfirmGenerateNewKeys was missing from both Left/Right groups in navigation.rs, so on the "Generate New Keys" confirmation the arrow keys did nothing: the popup opens on YES and Enter rotated the keys regardless of what the user tried to select. Only Esc cancelled. That is a destructive action — spawn_key_rotation_task replaces the user row and clears the orders table in the same transaction — and it is the one confirmation in the app where the arrows silently did not work, so the muscle memory built on every other confirm popup (Add Relay, Change Mostro Pubkey, Delete History, Exit...) leads straight to rotating keys. Adds it to both groups, with a regression test. Found while working on MostroP2P#114, where adding ConfirmRestoreSession next to it made the omission visible. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe generate-new-keys confirmation mode now handles Left and Right navigation. Left selects YES, Right selects NO, and a test verifies the toggle behavior. ChangesGenerate-new-keys navigation
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to This enables arrow-key selection of NO for the key-rotation confirmation and adds regression coverage; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Problem
UiMode::ConfirmGenerateNewKeysis missing from both Left/Right groups insrc/ui/key_handler/navigation.rs. On the Generate New Keys confirmation the arrow keys therefore do nothing: the popup opens on YES, and Enter rotates the keys regardless of what the user tried to select. Only Esc cancels.This is present on current
main(shipped in 0.2.8), and it is the one confirmation in the app where the arrows silently do not work — every other confirm popup (Add Relay, Change Mostro Pubkey, Add Currency Filter, Delete History, Clean Up History, Exit, …) is in those groups. The muscle memory built on all of them leads straight into rotating keys.And the action is destructive:
spawn_key_rotation_taskrunsUser::replace_all_in_tx(DELETE FROM users + insert) andOrder::delete_all_in_txin one transaction. A user who arrows to NO and presses Enter loses their identity and their whole local order history, having done what the UI told them was a cancel.Fix
Add
ConfirmGenerateNewKeysto both groups inhandle_left_key/handle_right_key, plus a regression test asserting Right selects NO and Left selects back to YES.Two lines of behaviour change; no other confirmation is touched.
cargo test --all-features→ 426 passed. Clippy-D warningsand fmt clean.Note
Found while working on #114 — adding
ConfirmRestoreSessionright next to it in those match groups is what made the omission visible. #114 currently carries the same fix in its own branch; whichever lands first, I will drop it from the other so there is no duplicate.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests