fix: treat numpad Enter (Char \r / \n) as submit in password prompt (…#121
Merged
fix: treat numpad Enter (Char \r / \n) as submit in password prompt (…#121
Conversation
…Issue #119) - fix: password prompt accepts KeyCode::Enter | KeyCode::Char('\n' | '\r') for submit - change: extend numpad Enter handling to search (normal_mode, insert_mode), modals (handlers, common, optional_deps, import, system_update), recent, install - change: PostSummary excluded-keys array includes Char('\n'), Char('\r') for restore logic - test: add password handler unit tests (numpad Enter, regression, edge cases) - test: add modal numpad Enter tests (Alert, Help, Confirm, PostSummary, GnomeTerminalPrompt, ImportHelp, VirusTotalSetup, News) - docs: add dev/IMPROVEMENTS/ISSUE_119_NUMPAD_ENTER_PASSWORD_PROMPT.md
- fix: treat KeyCode::Char('\n'|\r') as submit in password prompt and modals.
- fix: treat numpad Enter as submit in search, recent panel, install flow.
- fix: queue AUR update after pacman succeeds in system update flow.
- test: add numpad Enter tests for modals (alert, confirm, help, news, etc.).
- test: add handle_tick test for AUR queue after system update success.
- chore: add PR description for fix/numpad-enter (dev/PR/).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem: Numpad Enter did not submit the password prompt; it could insert a character or do nothing. On some terminals (e.g. Wayland/Alacritty), numpad Enter is reported as
KeyCode::Char('\r')orKeyCode::Char('\n')instead ofKeyCode::Enter, and only main Enter was handled as submit.Fix: Treat
KeyCode::Char('\n')andKeyCode::Char('\r')as submit alongsideKeyCode::Enterin the password prompt and extend the same behaviour for consistency across search, modals (Alert, Help, Confirm, optional deps, import, system update, etc.), recent panel, and install flow.Implementation: In
src/events/modals/password.rs, submit arm isKeyCode::Enter | KeyCode::Char('\n' | '\r'). Same “Enter = submit” semantics applied in search (normal/insert), modal handlers, recent, and install. PostSummary excluded-keys includesChar('\n')andChar('\r')for restore logic.Tests: Unit tests for password handler (numpad Enter as
\r/\n, main Enter, regression, edge cases) and modal numpad Enter tests (Alert, Help, Confirm, PostSummary, GnomeTerminalPrompt, ImportHelp, VirusTotalSetup, News, Scan).Problem (Update system): When using all selections in the "Update system" modal (mirrors + pacman + AUR + cache), AUR packages were not updated. The AUR command was stored separately and only run when pacman failed (ConfirmAurUpdate); it was never run when pacman succeeded.
Fix (Update system): Store password and header_chips when submitting the Update password so they are available after the first batch. In the tick handler, when
PreflightExecshows success with empty items (system update) andpending_aur_update_commandis set, queue the AUR command; AUR then runs automatically after pacman succeeds.Implementation (Update system): Handlers: set
pending_executor_passwordandpending_exec_header_chipson Update submit. Tick handler: newmaybe_queue_aur_after_system_update_success(); call it fromhandle_tick. Executor: uses pending password and header_chips when running the queued AUR command after pacman succeeds.Tests (Update system):
handle_tick_queues_aur_after_system_update_successverifies AUR is queued after system update success when pacman + AUR were selected.Type of change
Related issues
Closes #119
How to test
cargo fmt --all cargo clippy --all-targets --all-features -- -D warnings cargo check cargo test -- --test-threads=1Manual: trigger a password prompt (e.g. install a package that prompts for sudo password), type password, press numpad Enter — password should submit and flow continue (same as main Enter).
Manual: in search, modals (confirm, alert, help, etc.), recent panel, and install flow, verify numpad Enter acts as submit/confirm where main Enter does.
Screenshots / recordings (if UI changes)
N/A — key handling only; no visual change.
Checklist
Code Quality:
cargo check)cargo fmt --allran without changescargo clippy --all-targets --all-features -- -D warningsis cleancargo test -- --test-threads=1passescargo test complexity -- --nocapture)unwrap()orexpect()in non-test codeTesting:
Documentation:
config/directory if config keys changedImages/if applicableCompatibility:
--dry-runflagpacman/paru/yayare unavailableOther:
pacsea-binorpacsea-gitrepos)Notes for reviewers
Char('\n'),Char('\r')) are treated as submit; main Enter and existing behaviour unchanged.\nand\rare control characters, so they were already not inserted into the password buffer; this change only makes them trigger submit.dev/IMPROVEMENTS/ISSUE_119_NUMPAD_ENTER_PASSWORD_PROMPT.md.Breaking changes
None.
Additional context
NumpadEnter; numpad Enter is reported asKeyCode::EnterorKeyCode::Char('\r')/KeyCode::Char('\n')depending on terminal/OS.