PhotoCraft: An open-source, photo editor written by scratch in pure Rust
Menus: Reveal in Finder names the platform file manager off macOS (#217) (#2586)
Simonf5de46e60a38
diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rsindex 52ea8a335..86e01ecfa 100644--- a/crates/ui-egui/src/canvas.rs+++ b/crates/ui-egui/src/canvas.rs@@ -1701,7 +1701,7 @@ fn tab_context_items(index: usize, count: usize, has_path: bool) -> [(&'static s("Close", "file.close", json!({"document": index}), true),("Close Others", "file.closeOthers", json!({"document": index}), count > 1),("Close All", "file.closeAll", json!({}), true),- ("Reveal in Finder", "file.revealInFinder", json!({"document": index}), has_path),+ (crate::menus::reveal_label(), "file.revealInFinder", json!({"document": index}), has_path),]}@@ -4682,6 +4682,12 @@ mod tests {assert!(items.iter().all(|(_, id, _, _)| photocraft_engine::commands::find(id).is_some()));}+ #[test]+ fn tab_context_reveal_names_the_platform_file_manager() {+ let (label, id, _, _) = &tab_context_items(0, 1, true)[3];+ assert_eq!((*label, *id), (crate::menus::reveal_label(), "file.revealInFinder"));+ }+/// Photoshop's document tab × is after the title on Windows and Linux, before it on macOS (#619).#[test]fn document_tab_close_button_sits_on_the_platform_side() {diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsvindex a817b882c..f8420af05 100644--- a/crates/ui-egui/src/i18n/cs.tsv+++ b/crates/ui-egui/src/i18n/cs.tsv@@ -89,6 +89,8 @@Import ImportBrowse… Procházet…Reveal in Finder Zobrazit ve Finderu+ Show in Explorer Zobrazit v Průzkumníkovi+ Show in Folder Zobrazit ve složceFile Info… Informace o souboru…Print… Tisk…Print One Copy Vytisknout jednu kopiidiff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsvindex ba45beec0..28c2209f4 100644--- a/crates/ui-egui/src/i18n/de.tsv+++ b/crates/ui-egui/src/i18n/de.tsv@@ -85,6 +85,8 @@Import ImportierenBrowse… Durchsuchen…Reveal in Finder Im Finder anzeigen+ Show in Explorer Im Explorer anzeigen+ Show in Folder Im Ordner anzeigenFile Info… Dateiinformationen…Print… Drucken…Print One Copy Eine Kopie druckendiff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsvindex 5f44d5a74..40b5a282e 100644--- a/crates/ui-egui/src/i18n/el.tsv+++ b/crates/ui-egui/src/i18n/el.tsv@@ -67,6 +67,8 @@Import ΕισαγωγήBrowse… Περιήγηση…Reveal in Finder Εμφάνιση στο Finder+ Show in Explorer Εμφάνιση στην Εξερεύνηση αρχείων+ Show in Folder Εμφάνιση στον φάκελοFile Info… Πληροφορίες αρχείου…Print… Εκτύπωση…Print One Copy Εκτύπωση ενός αντιγράφουdiff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsvindex 9704365e8..921b63cf4 100644--- a/crates/ui-egui/src/i18n/es.tsv+++ b/crates/ui-egui/src/i18n/es.tsv@@ -81,6 +81,8 @@Import ImportarBrowse… Examinar…Reveal in Finder Mostrar en Finder+ Show in Explorer Mostrar en el Explorador+ Show in Folder Mostrar en la carpetaFile Info… Información del archivo…Print… Imprimir…Print One Copy Imprimir un ejemplardiff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsvindex 5a681a758..1270bbe74 100644--- a/crates/ui-egui/src/i18n/fr.tsv+++ b/crates/ui-egui/src/i18n/fr.tsv@@ -87,6 +87,8 @@Import ImporterBrowse… Parcourir…Reveal in Finder Afficher dans le Finder+ Show in Explorer Afficher dans l'Explorateur+ Show in Folder Afficher dans le dossierFile Info… Informations sur le fichier…Print… Imprimer…Print One Copy Imprimer un exemplairediff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsvindex 49aeb2c2f..7dfbc1bb7 100644--- a/crates/ui-egui/src/i18n/id.tsv+++ b/crates/ui-egui/src/i18n/id.tsv@@ -80,6 +80,8 @@Import ImporBrowse… Telusuri…Reveal in Finder Tampilkan di Finder+ Show in Explorer Tampilkan di Explorer+ Show in Folder Tampilkan di FolderFile Info… Info Berkas…Print… Cetak…Print One Copy Cetak Satu Salinandiff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsvindex 4428f0d43..fc805b687 100644--- a/crates/ui-egui/src/i18n/it.tsv+++ b/crates/ui-egui/src/i18n/it.tsv@@ -81,6 +81,8 @@Import ImportaBrowse… Sfoglia…Reveal in Finder Mostra nel Finder+ Show in Explorer Mostra in Esplora file+ Show in Folder Mostra nella cartellaFile Info… Info file…Print… Stampa…Print One Copy Stampa una copiadiff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsvindex 8d67715f5..a4ed47458 100644--- a/crates/ui-egui/src/i18n/ja.tsv+++ b/crates/ui-egui/src/i18n/ja.tsv@@ -85,6 +85,8 @@Import 読み込みBrowse… 参照…Reveal in Finder Finder で表示+ Show in Explorer エクスプローラーで表示+ Show in Folder フォルダーで表示File Info… ファイル情報…Print… プリント…Print One Copy 1 部プリントdiff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsvindex c70a3c734..06ae1973b 100644--- a/crates/ui-egui/src/i18n/ko.tsv+++ b/crates/ui-egui/src/i18n/ko.tsv@@ -73,6 +73,8 @@Import 가져오기Browse… 찾아보기…Reveal in Finder Finder에서 보기+ Show in Explorer 파일 탐색기에서 보기+ Show in Folder 폴더에서 보기File Info… 파일 정보…Print… 인쇄…Print One Copy 한 부 인쇄diff --git a/crates/ui-egui/src/i18n/mod.rs b/crates/ui-egui/src/i18n/mod.rsindex 2b89f59e7..6766688de 100644--- a/crates/ui-egui/src/i18n/mod.rs+++ b/crates/ui-egui/src/i18n/mod.rs@@ -785,6 +785,22 @@ mod tests {}}+ /// `menus::reveal_label` picks one name per platform, so every name needs a translation+ /// whichever OS runs the tests (UI-217-19).+ #[test]+ fn reveal_labels_are_translated() {+ for lang in Lang::all().filter(|l| l.complete_menus()) {+ let cat = lang.0.catalog();+ for label in ["Reveal in Finder", "Show in Explorer", "Show in Folder"] {+ let tr = cat.plain(label);+ assert!(tr.is_some(), "{} missing {label}", lang.code());+ if label != "Reveal in Finder" {+ assert!(!tr.unwrap_or_default().contains("Finder"), "{}: {label} names the Finder", lang.code());+ }+ }+ }+ }+#[test]fn layer_color_names_are_translated() {for lang in Lang::all().filter(|l| l.complete_menus()) {diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsvindex 950c90975..849131ae6 100644--- a/crates/ui-egui/src/i18n/nl.tsv+++ b/crates/ui-egui/src/i18n/nl.tsv@@ -77,6 +77,8 @@Import ImporterenBrowse… Bladeren…Reveal in Finder Weergeven in Finder+ Show in Explorer Weergeven in Verkenner+ Show in Folder Weergeven in mapFile Info… Bestandsinformatie…Print… Afdrukken…Print One Copy Eén exemplaar afdrukkendiff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsvindex 0edea672c..c8e750904 100644--- a/crates/ui-egui/src/i18n/pl.tsv+++ b/crates/ui-egui/src/i18n/pl.tsv@@ -84,6 +84,8 @@Import ImportujBrowse… Przeglądaj…Reveal in Finder Pokaż w Finderze+ Show in Explorer Pokaż w Eksploratorze+ Show in Folder Pokaż w folderzeFile Info… Informacje o pliku…Print… Drukuj…Print One Copy Drukuj jedną kopiędiff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsvindex cc2a876c4..a177562c3 100644--- a/crates/ui-egui/src/i18n/pt-br.tsv+++ b/crates/ui-egui/src/i18n/pt-br.tsv@@ -84,6 +84,8 @@Import ImportarBrowse… Procurar…Reveal in Finder Mostrar no Finder+ Show in Explorer Mostrar no Explorador+ Show in Folder Mostrar na pastaFile Info… Informações do arquivo…Print… Imprimir…Print One Copy Imprimir uma cópiadiff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsvindex a3fcff562..8a6e681d3 100644--- a/crates/ui-egui/src/i18n/ru.tsv+++ b/crates/ui-egui/src/i18n/ru.tsv@@ -1613,6 +1613,8 @@Open a document to select a colour range. Откройте документ, чтобы выбрать цветовой диапазон.Saved СохраненоReveal in Finder Показать в Finder+ Show in Explorer Показать в Проводнике+ Show in Folder Показать в папкеBefore (Y) До (Y)After (X) После (X)Original Оригиналdiff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsvindex 5607a6ccd..3fa95a151 100644--- a/crates/ui-egui/src/i18n/uk.tsv+++ b/crates/ui-egui/src/i18n/uk.tsv@@ -1596,6 +1596,8 @@Open a document to select a colour range. Відкрийте документ, щоб виділити колірний діапазон.Saved ЗбереженоReveal in Finder Показати у Finder+ Show in Explorer Показати у Провіднику+ Show in Folder Показати в теціBefore (Y) До (Y)After (X) Після (X)Original Оригіналdiff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsvindex 7dd0b0dfb..d73aad7dd 100644--- a/crates/ui-egui/src/i18n/zh-hans.tsv+++ b/crates/ui-egui/src/i18n/zh-hans.tsv@@ -81,6 +81,8 @@Import 导入Browse… 浏览…Reveal in Finder 在 Finder 中显示+ Show in Explorer 在文件资源管理器中显示+ Show in Folder 在文件夹中显示File Info… 文件信息…Print… 打印…Print One Copy 打印一份diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsvindex 81ce171b7..f3d5bbdec 100644--- a/crates/ui-egui/src/i18n/zh-hant.tsv+++ b/crates/ui-egui/src/i18n/zh-hant.tsv@@ -89,6 +89,8 @@Import 匯入Browse… 瀏覽…Reveal in Finder 在 Finder 中顯示+ Show in Explorer 在檔案總管中顯示+ Show in Folder 在資料夾中顯示File Info… 檔案資訊…Print… 列印…Print One Copy 列印一份拷貝diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rsindex 54c30ab4f..3e3b22301 100644--- a/crates/ui-egui/src/menus.rs+++ b/crates/ui-egui/src/menus.rs@@ -714,6 +714,19 @@ fn checked(app: &PhotocraftApp, id: &str) -> Option<bool> {})}+/// "Reveal in Finder" named after the file manager the engine opens on this platform (UI-217-19):+/// Explorer on Windows, a plain folder elsewhere (xdg-open, the web). English action key; each+/// display translates it.+pub(crate) fn reveal_label() -> &'static str {+ if cfg!(target_os = "macos") {+ "Reveal in Finder"+ } else if cfg!(windows) {+ "Show in Explorer"+ } else {+ "Show in Folder"+ }+}+/// Translate the fixed command label and substitute the currently configured export format./// Reuse the existing translated PNG sentence, so dynamic formats work in every UI language.fn translated_menu_label(lang: crate::i18n::Lang, item: &MenuItem) -> String {@@ -845,6 +858,10 @@ pub fn menu_items(app: &PhotocraftApp) -> Vec<MenuItem> {};item.label = format!("Quick Export as {format}");}+ // Smart Objects › Reveal in Finder names this platform's file manager (UI-217-19).+ if let Some(item) = items.iter_mut().find(|i| i.id == "layer.smartObjects.revealInFinder") {+ item.label = reveal_label().into();+ }// File › Open Recent: a dynamic submenu of recently opened files (inserted after "Open As…").if let Some(after) = items.iter().position(|i| i.id == "file.openAs") {let rp: Vec<String> = vec!["File".into(), "Open Recent".into()];@@ -1854,3 +1871,45 @@ mod quick_export_label_tests {}}}++#[cfg(test)]+mod reveal_label_tests {+ use super::*;++ #[test]+ fn reveal_label_names_the_platform_file_manager() {+ let expected = if cfg!(target_os = "macos") {+ "Reveal in Finder"+ } else if cfg!(windows) {+ "Show in Explorer"+ } else {+ "Show in Folder"+ };+ assert_eq!(reveal_label(), expected);+ }++ #[test]+ fn smart_objects_reveal_item_names_the_platform_file_manager() {+ let app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default());+ let id = "layer.smartObjects.revealInFinder";+ let items = menu_items(&app);+ let reveal: Vec<_> = items.iter().filter(|i| i.id == id).collect();+ assert_eq!(reveal.len(), 1);+ assert_eq!(reveal[0].path, ["Layer", "Smart Objects"]);+ assert_eq!(reveal[0].label, reveal_label());+ if !cfg!(target_os = "macos") {+ assert!(!reveal[0].label.contains("Finder"), "{}", reveal[0].label);+ }+ let shortcuts = crate::prefs_ui::shortcut_items(&app);+ assert!(shortcuts.iter().any(|(i, label, _, _)| i == id && label == reveal_label()), "the shortcut list shows the menu label");+ let de = crate::i18n::Lang::from_code("de").unwrap();+ let expected = match reveal_label() {+ "Reveal in Finder" => "Im Finder anzeigen",+ "Show in Explorer" => "Im Explorer anzeigen",+ _ => "Im Ordner anzeigen",+ };+ assert_eq!(translated_menu_label(de, reveal[0]), expected);+ // The menu catalogue (and docs/parity.md) keeps Photoshop's macOS name.+ assert!(crate::menu_catalog::CATALOG.iter().any(|(_, label, _, i)| *i == id && *label == "Reveal in Finder"));+ }+}diff --git a/docs/scorecard.md b/docs/scorecard.mdindex 4861aa629..8e0c423e1 100644--- a/docs/scorecard.md+++ b/docs/scorecard.md@@ -9,7 +9,7 @@ Generated by `cargo xtask scorecard` from `perf/budgets.toml`, `perf/baseline.js| [Performance](#performance) | 3 | 22 | 22 | 56 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 15 not run, 7 not measurable yet (baseline 2026-10-05) || [File compatibility](#file-compatibility) | 5 | 11 | 11 | io corpus: oracle ≥ 146/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 236/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 133/256, round trip ≥ 258/256 || [Tools](#tools) | 20 | 15 | 6 | |-| [Workspace and UI](#workspace-and-ui) | 5 | 7 | 11 | settings that do nothing: 46 of 149 (target 0) |+| [Workspace and UI](#workspace-and-ui) | 6 | 7 | 10 | settings that do nothing: 46 of 149 (target 0) || [Type](#type) | 0 | 3 | 6 | || [Automation](#automation) | 3 | 2 | 6 | 627 of 627 menu items live (100.0%) || [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 28 of 28 crates; panic_hunt present |@@ -198,7 +198,7 @@ Unread: `general.color_picker`, `general.beep_when_done`, `general.resize_image_| UI-217-16 | Hue/Saturation: Saturation and Lightness sliders get hue-following colour tracks | done | [#217](https://github.com/storytold/photocraft/issues/217) | saturation_track/lightness_track (adjust_editors.rs): grey -> the hue and black -> the hue -> white, recolouring as the Hue slider moves; saturation_and_lightness_tracks_follow_the_hue || UI-217-17 | Color panel: wheel plus RGB/HSB/CMYK/Lab/Gray/Web slider modes; resizes with its group | missing | [#217](https://github.com/storytold/photocraft/issues/217) | panels.rs:1837 single field + hex/RGB readout || UI-217-18 | Alt+wheel zooms in gentle ~5 % steps; zoom controls uncramped | missing | [#217](https://github.com/storytold/photocraft/issues/217) | canvas.rs:1107-1125 no Alt handling |-| UI-217-19 | Shortcut hints rendered per platform; Reveal label per OS | missing | [#217](https://github.com/storytold/photocraft/issues/217) | ~33 hard-coded modifier glyph strings in ui-egui; menu_catalog.rs:341 one label |+| UI-217-19 | Shortcut hints rendered per platform; Reveal label per OS | done | [#217](https://github.com/storytold/photocraft/issues/217) | hints and tooltips go through shortcuts::pretty (6266b7a9, #262; pretty_uses_the_platform_notation); menus::reveal_label names Reveal in Finder per OS (Show in Explorer / Show in Folder) in the Smart Objects menu and the tab menu; reveal_label_names_the_platform_file_manager + smart_objects_reveal_item_names_the_platform_file_manager || UI-217-20 | 'Show rulers in new documents' preference; guides stored as f64 | missing | [#217](https://github.com/storytold/photocraft/issues/217) | No rulers pref; doc lib.rs:523 guides are Vec<f32> || UI-217-21 | One Preset Manager for every preset kind with folders, search, reorder, load/save sets | partial | [#217](https://github.com/storytold/photocraft/issues/217) | edit_menu_cmds.rs:714 covers brushes, custom shapes, patterns with reorder || UI-217-22 | Stamp Visible into a new layer keeping originals; Alt+Merge keeps originals | missing | [#217](https://github.com/storytold/photocraft/issues/217) | Only layer.mergeVisible (edit_cmds.rs:416) |diff --git a/scorecard/ui.toml b/scorecard/ui.tomlindex eca4a7d48..e05a6a7a0 100644--- a/scorecard/ui.toml+++ b/scorecard/ui.toml@@ -134,9 +134,9 @@ note = "canvas.rs:1107-1125 no Alt handling"[[item]]id = "UI-217-19"target = "Shortcut hints rendered per platform; Reveal label per OS"-status = "missing"+status = "done"issue = 217-note = "~33 hard-coded modifier glyph strings in ui-egui; menu_catalog.rs:341 one label"+note = "hints and tooltips go through shortcuts::pretty (6266b7a9, #262; pretty_uses_the_platform_notation); menus::reveal_label names Reveal in Finder per OS (Show in Explorer / Show in Folder) in the Smart Objects menu and the tab menu; reveal_label_names_the_platform_file_manager + smart_objects_reveal_item_names_the_platform_file_manager"[[item]]id = "UI-217-20"