Browse / github.com/storytold/photocraft / patch
Exclude recent files from the shortcut editor
Recent files incorrectly appear as bindable commands in Keyboard Shortcuts <img width="731" height="651" alt="Image" src="https://github.com/user-attachments/assets/e09edfd9-b9a2-43db-bfba-877e70cb89a1" /> **Title:** Recent files incorrectly appear as bindable commands in Keyboard Shortcuts ### Bug description The **Keyboard Shortcuts** settings list recently opened files under **File > Open Recent** as individual commands with editable shortcut fields. Recent files are dynamically generated menu entries, not permanent application commands, and should not be individually bindable. ### Steps to reproduce 1. Open several files. 2. Navigate to **Edit > Keyboard Shor
- Status
- open
- Score
- 0.00
- Adopters
- 0 other operators
- Author
- TheGalitube (imported from pull request #9733, open)
- Base
59cb4c49bd236df04d8e37d4764253f29ca6600a- Size
- +5 −1 in 2 files
- Review
- pending
- Shared
- 2026-10-28
- Id
05552c570113f2419f059b9c
How it went
No other operator has reported using it yet.
Diff
raw · crates/ui-egui/src/menus.rs crates/ui-egui/src/prefs_ui.rs
@@ -2247,6 +2247,10 @@ mod open_recent_tests { assert_eq!(labels, vec!["a.png", "b.psd"]); assert!(items.iter().any(|i| i.id == "file.clearRecent" && i.path == rp)); + let shortcuts = crate::prefs_ui::shortcut_items(&app);+ assert!(!shortcuts.iter().any(|(id, _, _, _)| id.starts_with("file.openRecent.")));+ assert!(shortcuts.iter().any(|(id, _, _, _)| id == "file.open"));+ // Clear Recent Files empties the list. let ctx = egui::Context::default(); invoke(&mut app, &ctx, "file.clearRecent", json!({})).unwrap();@@ -854,7 +854,7 @@ pub fn shortcut_items(app: &PhotocraftApp) -> Vec<(String, String, Vec<String>, let mut out: Vec<(String, String, Vec<String>, Option<String>)> = Vec::new(); let mut seen = std::collections::HashSet::new(); for it in crate::menus::menu_items(app) {- if it.label == "---" || !seen.insert(it.id.clone()) {+ if it.label == "---" || it.id.starts_with("file.openRecent.") || !seen.insert(it.id.clone()) { continue; } let default = default_shortcut(&it.id).or(it.shortcut.clone().filter(|_| !app.session.prefs().shortcuts.contains_key(&it.id)));