You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: numpad Enter submit and AUR after system update
- 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/).
- [Development Wiki](https://github.com/Firstp1ck/Pacsea/wiki/Development) — Development tools and debugging
7
+
8
+
Please ensure you've reviewed these before submitting your PR.
9
+
-->
10
+
11
+
## Summary
12
+
13
+
-**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')` or `KeyCode::Char('\n')` instead of `KeyCode::Enter`, and only main Enter was handled as submit.
14
+
-**Fix:** Treat `KeyCode::Char('\n')` and `KeyCode::Char('\r')` as submit alongside `KeyCode::Enter` in 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.
15
+
-**Implementation:** In `src/events/modals/password.rs`, submit arm is `KeyCode::Enter | KeyCode::Char('\n' | '\r')`. Same “Enter = submit” semantics applied in search (normal/insert), modal handlers, recent, and install. PostSummary excluded-keys includes `Char('\n')` and `Char('\r')` for restore logic.
16
+
-**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).
17
+
18
+
-**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.
19
+
-**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 `PreflightExec` shows success with empty items (system update) and `pending_aur_update_command` is set, queue the AUR command; AUR then runs automatically after pacman succeeds.
20
+
-**Implementation (Update system):** Handlers: set `pending_executor_password` and `pending_exec_header_chips` on Update submit. Tick handler: new `maybe_queue_aur_after_system_update_success()`; call it from `handle_tick`.
21
+
-**Tests (Update system):**`handle_tick_queues_aur_after_system_update_success` verifies AUR is queued after system update success when pacman + AUR were selected.
2. Manual: 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).
50
+
51
+
3. Manual: in search, modals (confirm, alert, help, etc.), recent panel, and install flow, verify numpad Enter acts as submit/confirm where main Enter does.
52
+
53
+
## Screenshots / recordings (if UI changes)
54
+
55
+
N/A — key handling only; no visual change.
56
+
57
+
## Checklist
58
+
59
+
**Code Quality:**
60
+
-[ ] Code compiles locally (`cargo check`)
61
+
-[ ]`cargo fmt --all` ran without changes
62
+
-[ ]`cargo clippy --all-targets --all-features -- -D warnings` is clean
63
+
-[ ]`cargo test -- --test-threads=1` passes
64
+
-[ ] Complexity checks pass for new code (`cargo test complexity -- --nocapture`)
65
+
-[ ] All new functions/methods have rustdoc comments (What, Inputs, Output, Details)
66
+
-[ ] No `unwrap()` or `expect()` in non-test code
67
+
68
+
**Testing:**
69
+
-[ ] Added or updated tests where it makes sense
70
+
-[ ] For bug fixes: created failing tests first, then fixed the issue
71
+
-[ ] Tests are meaningful and cover the functionality
72
+
73
+
**Documentation:**
74
+
-[ ] Updated README if behavior, options, or keybinds changed (keep high-level, reference wiki)
75
+
-[ ] Updated relevant wiki pages if needed
76
+
-[ ] Updated config examples in `config/` directory if config keys changed
77
+
-[ ] For UI changes: included screenshots and updated `Images/` if applicable
78
+
79
+
**Compatibility:**
80
+
-[ ] Changes respect `--dry-run` flag
81
+
-[ ] Code degrades gracefully if `pacman`/`paru`/`yay` are unavailable
82
+
-[ ] No breaking changes (or clearly documented if intentional)
83
+
84
+
**Other:**
85
+
-[ ] Not a packaging change for AUR (otherwise propose in `pacsea-bin` or `pacsea-git` repos)
86
+
87
+
## Notes for reviewers
88
+
89
+
- Minimal behavioural change: only additional key codes (`Char('\n')`, `Char('\r')`) are treated as submit; main Enter and existing behaviour unchanged.
90
+
-`\n` and `\r` are control characters, so they were already not inserted into the password buffer; this change only makes them trigger submit.
91
+
- Consistency pass: same Enter semantics applied in search, modals, recent, and install so numpad Enter behaves uniformly.
92
+
- Design/analysis is documented in `dev/IMPROVEMENTS/ISSUE_119_NUMPAD_ENTER_PASSWORD_PROMPT.md`.
- Crossterm has no `NumpadEnter`; numpad Enter is reported as `KeyCode::Enter` or `KeyCode::Char('\r')` / `KeyCode::Char('\n')` depending on terminal/OS.
0 commit comments