History: the panel menu has Step Backward, Step Forward and Set History Limit…

The History panel menu held only a disabled History Options… item. The
reference app's History panel menu has Step Backward and Step Forward,
which undo and redo a change, and Set History Limit, which sets the
number of History States.

The panel menu now has Step Backward and Step Forward. They run
edit.undo and edit.redo, and each is disabled when there is no step to
undo or redo, as Edit › Undo and Edit › Redo are. Set History Limit…
opens Preferences at Performance, where History States is set.

Docs: docs/target-app-parity.md.
This commit is contained in:
dotCooCoo
2026-10-18 01:24:34 +07:00
committed by bflatastic
parent 6a2bb03ebf
commit 85fce6852e
24 changed files with 162 additions and 1 deletions
+3
View File
@@ -1321,6 +1321,9 @@
Highlight Substituted Glyphs Маркиране на заменени глифи
History История
History Options… Опции за историята…
Step Backward Стъпка назад
Step Forward Стъпка напред
Set History Limit… Задаване на ограничение на историята…
History States Състояния на историята
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Прилагане на набор от данни
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1514,6 +1514,9 @@ lighting Light Světlo
Use Text for Previews Náhledy na textu
{percent}% opacity krytí {percent} %
History Options… Možnosti historie…
Step Backward Krok zpět
Step Forward Krok vpřed
Set History Limit… Nastavit limit historie…
Open a document to see its history. Otevřete dokument, abyste viděli jeho historii.
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Použít sadu dat
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1435,6 +1435,9 @@ lighting Light Lys
Use Text for Previews Brug tekst til forhåndsvisninger
{percent}% opacity {percent}% opacitet
History Options… Indstillinger for historik…
Step Backward Et trin tilbage
Step Forward Et trin frem
Set History Limit… Angiv historikgrænse…
Open a document to see its history. Åbn et dokument for at se dets historik.
Abutting Stødende
Black and White Sort-hvid
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1339,6 +1339,9 @@ file-filter Templates Vorlagen
Highlight Substituted Glyphs Ersetzte Glyphen hervorheben
History Protokoll
History Options… Protokolloptionen…
Step Backward Schritt zurück
Step Forward Schritt vorwärts
Set History Limit… Protokollgrenze festlegen…
History States Protokollschritte
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Datensatz anwenden
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1284,6 +1284,9 @@
Highlight Substituted Glyphs Επισήμανση υποκατεστημένων γλύφων
History Ιστορικό
History Options… Επιλογές ιστορικού…
Step Backward Ένα βήμα πίσω
Step Forward Ένα βήμα εμπρός
Set History Limit… Ορισμός ορίου ιστορικού…
History States Καταστάσεις ιστορικού
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Εφαρμογή συνόλου δεδομένων
1 # Ελληνικά (el) — VectorCraft
1284
1285
1286
1287
1288
1289
1290
1291 # History panel: the names of undo steps (`every_undo_label_is_translated`).
1292
+3
View File
@@ -1347,6 +1347,9 @@
Highlight Substituted Glyphs Resaltar glifos sustituidos
History Historial
History Options… Opciones de historial…
Step Backward Paso atrás
Step Forward Paso adelante
Set History Limit… Definir límite de historial…
History States Estados de historial
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Aplicar conjunto de datos
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1488,6 +1488,9 @@ lighting Light Valo
Use Text for Previews Käytä tekstiä esikatseluissa
{percent}% opacity {percent}% peittävyys
History Options… Historian asetukset…
Step Backward Askel taaksepäin
Step Forward Askel eteenpäin
Set History Limit… Aseta historian raja…
Open a document to see its history. Avaa asiakirja, niin näet sen historian.
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Käytä tietojoukkoa
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1346,6 +1346,9 @@
Highlight Substituted Glyphs Surligner les glyphes remplacés
History Historique
History Options… Options d’historique…
Step Backward Pas en arrière
Step Forward Pas en avant
Set History Limit… Définir la limite de l’historique…
History States États de l’historique
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Appliquer le jeu de données
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1720,6 +1720,9 @@ file-filter Templates Sablonok
Hindi Hindi
History Előzmények
History Options… Előzmények beállításai…
Step Backward Lépés vissza
Step Forward Lépés előre
Set History Limit… Előzménykorlát beállítása…
History States Előzmények lépésszáma
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Adatkészlet alkalmazása
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1435,6 +1435,9 @@ lighting Light Cahaya
Use Text for Previews Gunakan teks untuk pratinjau
{percent}% opacity Opasitas {percent}%
History Options… Opsi riwayat…
Step Backward Mundur satu langkah
Step Forward Maju satu langkah
Set History Limit… Atur batas riwayat…
Open a document to see its history. Buka dokumen untuk melihat riwayatnya.
Abutting Bersinggungan
Black and White Hitam dan putih
1 # Indonesian (id) catalog. Same format as zh-hant.tsv: context <TAB> source <TAB> translation
1435
1436
1437
1438
1439
1440
1441
1442
1443
+3
View File
@@ -1356,6 +1356,9 @@ file-filter Templates Modelli
Highlight Substituted Glyphs Evidenzia glifi sostituiti
History Cronologia
History Options… Opzioni cronologia…
Step Backward Passo indietro
Step Forward Passo avanti
Set History Limit… Imposta limite cronologia…
History States Stati cronologia
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Applica set di dati
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1601,6 +1601,9 @@
Highlight Substituted Glyphs 置換字形をハイライト
Highlight anchors on mouse over マウスオーバー時にアンカーをハイライト
History Options… ヒストリーオプション…
Step Backward 一段階戻る
Step Forward 一段階進む
Set History Limit… ヒストリーの上限を設定…
History States ヒストリー数
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set データセットを適用
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1596,6 +1596,9 @@
Highlight Substituted Glyphs 대체된 글리프 강조 표시
Highlight anchors on mouse over 마우스를 올리면 앵커 강조 표시
History Options… 히스토리 옵션…
Step Backward 한 단계 뒤로
Step Forward 한 단계 앞으로
Set History Limit… 히스토리 한도 설정…
History States 히스토리 상태
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set 데이터 세트 적용
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1449,6 +1449,9 @@ lighting Light Licht
Use Text for Previews Tekst gebruiken voor voorbeelden
{percent}% opacity {percent}% dekking
History Options… Historieopties…
Step Backward Stap terug
Step Forward Stap vooruit
Set History Limit… Historielimiet instellen…
Open a document to see its history. Open een document om de historie te zien.
Abutting Aaneengesloten
Black and White Zwart-wit
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1428,6 +1428,9 @@ lighting Light Światło
Use Text for Previews Użyj tekstu w podglądach
{percent}% opacity Krycie {percent}%
History Options… Opcje historii…
Step Backward Krok wstecz
Step Forward Krok naprzód
Set History Limit… Ustaw limit historii…
Open a document to see its history. Otwórz dokument, aby zobaczyć jego historię.
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Zastosuj zestaw danych
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1161,6 +1161,9 @@
Highlight anchors on mouse over Realçar pontos de ancoragem ao passar o mouse
History Histórico
History Options… Opções do Histórico…
Step Backward Voltar um Passo
Step Forward Avançar um Passo
Set History Limit… Definir Limite do Histórico…
History States Estados do Histórico
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Aplicar Conjunto de Dados
Can't render this file because it contains an unexpected character in line 6 and column 47.
+3
View File
@@ -1354,6 +1354,9 @@ file-filter Templates Шаблоны
Highlight Substituted Glyphs Выделять заменённые глифы
History История
History Options… Параметры истории…
Step Backward Шаг назад
Step Forward Шаг вперёд
Set History Limit… Задать предел истории…
History States Состояния истории
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Применить набор данных
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1323,6 +1323,9 @@
Highlight Substituted Glyphs Framhäv ersatta glyfer
History Historik
History Options… Historikalternativ…
Step Backward Stega bakåt
Step Forward Stega framåt
Set History Limit… Ange historikgräns…
History States Historiktillstånd
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Använd datauppsättning
Can't render this file because it contains an unexpected character in line 5 and column 25.
+3
View File
@@ -1350,6 +1350,9 @@ file-filter Templates Шаблони
Highlight Substituted Glyphs Виділяти замінені гліфи
History Історія
History Options… Параметри історії…
Step Backward Крок назад
Step Forward Крок вперед
Set History Limit… Задати межу історії…
History States Стан історії
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Застосувати набір даних
Can't render this file because it contains an unexpected character in line 725 and column 40.
+3
View File
@@ -1549,6 +1549,9 @@ file-filter Templates Mẫu
Hindi Hindi
History Lịch sử
History Options… Tùy chọn lịch sử…
Step Backward Lùi một bước
Step Forward Tiến một bước
Set History Limit… Đặt giới hạn lịch sử…
History States Trạng thái lịch sử
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set Áp dụng tập dữ liệu
1 # Vietnamese (vi) catalog. Same format as zh-hant.tsv: context <TAB> source <TAB> translation
1549
1550
1551
1552
1553
1554
1555
1556 # History panel: the names of undo steps (`every_undo_label_is_translated`).
1557
+3
View File
@@ -1298,6 +1298,9 @@ file-filter Templates 模板
Highlight Substituted Glyphs 突出显示替代字形
History 历史记录
History Options… 历史记录选项…
Step Backward 后退一步
Step Forward 前进一步
Set History Limit… 设置历史记录上限…
History States 历史记录步数
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set 应用数据集
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -1328,6 +1328,9 @@ file-filter Templates 範本
Highlight Substituted Glyphs 醒目提示被取代的字符
History 步驟記錄
History Options… 步驟記錄選項…
Step Backward 後退一步
Step Forward 前進一步
Set History Limit… 設定步驟記錄上限…
History States 步驟記錄狀態
# History panel: the names of undo steps (`every_undo_label_is_translated`).
Apply Data Set 套用資料集
Can't render this file because it contains an unexpected character in line 6 and column 47.
+95 -1
View File
@@ -75,7 +75,16 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
}
}
pub fn menu(_app: &mut VectorcraftApp, ui: &mut Ui) {
pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) {
for (label, cmd) in [(tl!("Step Backward"), "edit.undo"), (tl!("Step Forward"), "edit.redo")] {
if menu_item(ui, label, crate::menus::enabled(app, cmd), false) {
crate::menus::invoke(app, cmd, json!({}));
}
}
ui.separator();
if menu_item(ui, tl!("Set History Limit…"), true, false) {
crate::menus::invoke(app, "edit.preferences", json!({ "category": "Performance" }));
}
menu_item(ui, tl!("History Options…"), false, false);
}
@@ -99,4 +108,89 @@ mod tests {
assert_eq!(step_name(ja, "Feather").as_deref(), Some("ぼかし"));
assert_eq!(step_name(ja, "No Such Step"), None);
}
fn app_with_two_rectangles() -> VectorcraftApp {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.session.execute("file.new", &json!({"width": 200, "height": 150})).unwrap();
for x in [10, 60] {
app.session.execute("shape.rectangle", &json!({"x": x, "y": 10, "width": 20, "height": 20})).unwrap();
}
app
}
/// Returns the number of steps to undo and to redo.
fn depth(app: &VectorcraftApp) -> (usize, usize) {
let h = &app.session.active().unwrap().history;
(h.undo.len(), h.redo.len())
}
/// Clicks the panel menu's item labeled `label`.
fn click(app: &mut VectorcraftApp, label: &str) {
let ctx = egui::Context::default();
let screen = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, vec2(240.0, 400.0)));
let frame = |app: &mut VectorcraftApp, events: Vec<egui::Event>| {
let mut out = ctx.run_ui(egui::RawInput { events, screen_rect: screen, ..Default::default() }, |ui| menu(app, ui));
out.textures_delta.clear();
out.shapes
};
let item = frame(app, vec![])
.iter()
.find_map(|c| match &c.shape {
egui::Shape::Text(t) if t.galley.text().trim_start() == label => Some(t.visual_bounding_rect().center()),
_ => None,
})
.unwrap_or_else(|| panic!("no `{label}` in the panel menu"));
let button = |pressed| egui::Event::PointerButton { pos: item, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() };
frame(app, vec![egui::Event::PointerMoved(item), button(true), button(false)]);
}
/// The panel menu's Step Backward undoes one step and Step Forward redoes one, as Edit › Undo
/// and Edit › Redo do.
#[test]
fn the_panel_menu_steps_backward_and_forward() {
let mut app = app_with_two_rectangles();
let objects = |app: &VectorcraftApp| app.session.active().unwrap().doc.layers[0].children().unwrap().len();
assert_eq!((depth(&app), objects(&app)), ((2, 0), 2));
click(&mut app, "Step Backward");
assert_eq!((depth(&app), objects(&app)), ((1, 1), 1));
click(&mut app, "Step Backward");
assert_eq!((depth(&app), objects(&app)), ((0, 2), 0));
click(&mut app, "Step Forward");
assert_eq!((depth(&app), objects(&app)), ((1, 1), 1));
}
/// Step Backward is disabled when there is nothing to undo, and Step Forward is disabled when
/// there is nothing to redo. A click on a disabled item changes nothing.
#[test]
fn the_step_items_are_disabled_with_nothing_to_undo_or_redo() {
use crate::widgets::accessibility_tests::tree;
let disabled = |app: &mut VectorcraftApp| {
let tree = tree(|ui| menu(app, ui));
let off =
|label: &str| tree.iter().find(|n| n.label().map(str::trim) == Some(label)).unwrap_or_else(|| panic!("no `{label}`")).is_disabled();
(off("Step Backward"), off("Step Forward"))
};
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
assert_eq!(disabled(&mut app), (true, true), "no document");
app.session.execute("file.new", &json!({"width": 200, "height": 150})).unwrap();
assert_eq!(disabled(&mut app), (true, true), "a new document");
app.session.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 20, "height": 20})).unwrap();
assert_eq!(disabled(&mut app), (false, true), "one step to undo");
click(&mut app, "Step Forward");
assert_eq!(depth(&app), (1, 0));
click(&mut app, "Step Backward");
assert_eq!(disabled(&mut app), (true, false), "one step to redo");
click(&mut app, "Step Backward");
assert_eq!(depth(&app), (0, 1));
}
/// Set History Limit… opens Preferences at Performance, the page with History States.
#[test]
fn set_history_limit_opens_the_history_states_preference() {
let mut app = app_with_two_rectangles();
click(&mut app, "Set History Limit…");
let d = app.ui.dialog.take().expect("a dialog");
assert_eq!((d.kind.as_str(), d.str("__category")), ("preferences", "Performance".to_string()));
assert!(d.fields.contains_key("historyStates"), "{:?}", d.fields.keys());
}
}
+1
View File
@@ -457,6 +457,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- Czech render-site labels: desktop/web file filters, diagnostics, suggested preset names and contributor tooltips/plurals now use catalog lookups; gradients have Czech adjective agreement and printer marks have a separate context (PDF/Print and Summary). Search, Home, toolbar/panel tooltips and Preferences already look up their labels. Every complete catalog has rows for these labels and for the Roman and Japanese printer mark styles. Evidence: `i18n::tests::czech_render_site_follow_up`, `i18n::tests::complete_catalogs_translate_render_site_labels`, `dialogs::tests_modal::printer_mark_labels_are_distinct_from_language_names`; see [localization-parity.md](localization-parity.md).
- Localised UI: menus (in-window and native), panels, dialogs, toolbar and Preferences read from per-language catalogs (`crates/ui-egui/src/i18n`, see `docs/development.md`); Traditional Chinese (Taiwan), Simplified Chinese (mainland), Japanese, Korean, Vietnamese, German, Spanish, French, Italian, Polish, Brazilian Portuguese, Russian and Ukrainian ship complete, and Czech covers every menu label (and more), with system-locale detection on macOS, Windows, Linux and the web (the browser's languages, or `?lang=`), a Language preference and, on macOS, a VectorCraft ▸ Language menu. Names are never translated (fonts and their styles, layers, artboards, saved presets, user libraries, custom workspaces, recent files, plug-ins).
- The History panel translates the undo step names the engine, the tools and the shell write as literals: each has a row in every complete catalog (`every_undo_label_is_translated`), and a step whose catalog row exists only with an ellipsis (such as an effect's menu name) shows that row without the ellipsis.
- The History panel menu has Step Backward and Step Forward, which run Edit › Undo and Edit › Redo and are disabled when there is no step to undo or redo, and Set History Limit…, which opens Preferences at Performance, where History States is set. Not done: Clear History and a new document from the selected state.
- Native macOS menu bar, vector tool cursors, a ⌘K command palette, middle-button panning with any tool. Native menus explicitly end tracking on command selection, outside window presses and Escape; menu updates wait until tracking ends, and a dismissing press never starts a canvas gesture (M14.8).
- The errors of the blend spine commands (Move Spine Point, Reshape Spine Segment, Add Spine Point and Delete Spine Point) show in the status bar in the interface language: each has a row in every catalog that translates all status and error messages and in Bulgarian (`blend_spine_param_errors_are_translated`).
- The macOS menu bar is built from the in-window menus (one model, `native_menu`) and laid out as a Mac app's: the VectorCraft menu holds About, Settings ▸ (each Preferences page, General… ⌘K), Language ▸, Appearance ▸ (UI brightness), Services, Hide VectorCraft ⌃⌘H (⌘H stays Hide Edges), Hide Others, Show All and Quit; Window gains Minimize ⌃⌘M, Zoom and Bring All to Front, and Help the system's search field. Its key equivalents go back to egui as key presses, so user shortcuts, focused text fields and the Type tool's input method behave as in the window, and nothing fires twice; enabled, check marks and labels update in place. `--in-window-menus` or `VECTORCRAFT_IN_WINDOW_MENUS=1` keeps the menus in the window; `ui.inspect` reports `nativeMenuBar`.