From a69985fe60c10cbc4320d6c4109f706c81c9105f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 11 Nov 2026 04:57:10 -0800 Subject: [PATCH] Tests: a recent file outside the read root is not listed even as a disabled row The test of #6580 compared only the enabled File > Open Recent Files rows, so it also passed when ui.menu.list kept a file outside the read root as a disabled row with its name. The test now compares every row, marking disabled ones. --- crates/ui-egui/src/tests/automation.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/tests/automation.rs b/crates/ui-egui/src/tests/automation.rs index 5eff145b1..50c57db65 100644 --- a/crates/ui-egui/src/tests/automation.rs +++ b/crates/ui-egui/src/tests/automation.rs @@ -304,12 +304,17 @@ fn frames_with_injected_input_are_confined() { let _ = std::fs::remove_dir_all(base); } -/// The enabled File › Open Recent Files rows `ui.menu.list` returns: (id, label). +/// Every File › Open Recent Files row `ui.menu.list` returns, disabled ones included: (id, label), +/// the label of a disabled row starting "(disabled) ". fn recent_rows(entries: &Value) -> Vec<(String, String)> { let rows = entries.as_array().map(Vec::as_slice).unwrap_or_default(); rows.iter() - .filter(|e| e["command"].as_str().is_some_and(|c| c.starts_with("file.openRecent")) && e["enabled"] == true) - .map(|e| (e["command"].as_str().unwrap_or_default().to_string(), e["label"].as_str().unwrap_or_default().to_string())) + .filter(|e| e["command"].as_str().is_some_and(|c| c.starts_with("file.openRecent"))) + .map(|e| { + let label = e["label"].as_str().unwrap_or_default(); + let label = if e["enabled"] == true { label.to_string() } else { format!("(disabled) {label}") }; + (e["command"].as_str().unwrap_or_default().to_string(), label) + }) .collect() }