mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-24 10:08:00 -06:00
Conflicts: - ROADMAP.md: the PR's progress-log entry added on top
This commit is contained in:
@@ -174,6 +174,7 @@ Ranked; detail and the full milestone table in [docs/roadmap.md](docs/roadmap.md
|
||||
|
||||
## Progress log
|
||||
|
||||
- **2026-10-20 (M3, #3535):** Escape with a menu open closes the menu and keeps the text selection; the next Escape clears it, as before. One keypress used to do both. A synthetic UI regression checks it. Estimates unchanged.
|
||||
- **2026-10-16 (M3, close prompt keyboard):** The "Save changes?" prompt opens with Save chosen (Enter saves, as before) and the arrow keys and Tab / Shift+Tab move the choice to Cancel or Don't save, shown with a focus ring; Enter or Space press the chosen button and Escape still cancels. Before, Enter always saved whatever was Tab-focused. Estimates unchanged.
|
||||
- **2026-10-21 (M3, #3808):** Page thumbnails in the Inspector can be resized independently from the document and Organize, with a slider, buttons and `thumbnail-zoom` control option. Selection, page following and reload are covered by regressions. Estimates unchanged.
|
||||
- **2026-10-20 (M6, calculation order page):** Prepare a form ▸ Calculation order, a page of its own, lists the calculated fields in the order they calculate with their formulas and values, moved with Up/Down arrows (as Acrobat's Set Field Calculation Order), Alt+↑/↓ or by dragging. A card says what is wrong with the order and holds Fix order; a loop has a card of its own that opens one of its formulas. On the page, each calculated field shows its step, and arrows show what the field in focus reads and what reads it. Estimates unchanged.
|
||||
|
||||
@@ -2378,7 +2378,8 @@ pub fn shortcuts(view: &mut DocView, ctx: &egui::Context, speed: crate::scroll_s
|
||||
view.view_history(true);
|
||||
}
|
||||
let key = |k| ctx.input(|i| i.key_pressed(k));
|
||||
if key(Key::Escape) {
|
||||
// An open menu takes Escape first and closes; the selection stays for the next one (#3535).
|
||||
if key(Key::Escape) && !egui::Popup::is_any_open(ctx) {
|
||||
if view.camera.is_some() || view.camera_done.is_some() {
|
||||
view.pending_action = Some(ViewAction::CancelCamera);
|
||||
} else if view.selection.is_some() {
|
||||
|
||||
@@ -226,6 +226,27 @@ fn selected_text_copy_edit_and_context_menus() {
|
||||
assert_eq!(h.state().views[0].selected_text().as_deref(), Some("quick"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn escape_closes_an_open_menu_before_it_clears_the_selection() {
|
||||
// #3535: one Escape closed the main menu and dropped the selection with it.
|
||||
use egui_kittest::kittest::Queryable;
|
||||
let (mut h, at) = harness(|_| {});
|
||||
click(&mut h, at);
|
||||
click(&mut h, at);
|
||||
h.run_steps(2);
|
||||
assert_eq!(h.state().views[0].selected_text().as_deref(), Some("quick"));
|
||||
h.get_by_label("Menu").click();
|
||||
h.run_steps(2);
|
||||
assert!(egui::Popup::is_any_open(&h.ctx), "the menu is open");
|
||||
h.key_press(egui::Key::Escape);
|
||||
h.run_steps(2);
|
||||
assert!(!egui::Popup::is_any_open(&h.ctx), "Escape closes the menu");
|
||||
assert_eq!(h.state().views[0].selected_text().as_deref(), Some("quick"), "and keeps the selection");
|
||||
h.key_press(egui::Key::Escape);
|
||||
h.run_steps(2);
|
||||
assert_eq!(h.state().views[0].selected_text(), None, "a second Escape clears it");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn selected_text_copy_command_requires_selection() {
|
||||
let (mut h, at) = harness(|_| {});
|
||||
|
||||
Reference in New Issue
Block a user