Command Palette: an empty search lists eight recent picks, and a refused pick is not recorded

An empty search lists up to eight recent picks under a Recent heading.
With no picks yet it shows a dimmed line, "Type to search commands,
tools, panels and effects", with a row in every catalog. The Recent
Commands button's list also shows up to eight picks, and the saved
list holds at most 20 ids.

A pick now reports whether it ran, opened a dialog or was refused.
Only a pick that ran or opened a dialog is recorded in Recent
Commands, so a canceled dialog's command stays there. A pick that is
refused because its menu item is dimmed, or because its panel can't be
shown in Presentation Mode, is no longer recorded; a refused recent
pick keeps its place.
This commit is contained in:
dotCooCoo committed 2026-11-16 12:39:30 -08:00
1 parent a83cb1fadb
commit c834fa0daf
30 files changed
+169 -36

No files matched your search

+1
View File
@@ -3196,6 +3196,7 @@ digits Malayalam Малаялам
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} от {n} резултат. Продължете да пишете, за да ги стесните.|{shown} от {n} резултата. Продължете да пишете, за да ги стесните.
Recent Commands Последни команди
No recent commands Няма последни команди
Type to search commands, tools, panels and effects Въведете текст, за да търсите команди, инструменти, панели и ефекти
Search Commands… Търсене на команди…
Secondary Вторичен
Section Symbol Символ за раздел
Can't render this file because it is too large.
+1
View File
@@ -4395,6 +4395,7 @@ font-technology Variable Varijabilni
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} od {n} rezultata. Nastavite kucati da ih suzite.|{shown} od {n} rezultata. Nastavite kucati da ih suzite.|{shown} od {n} rezultata. Nastavite kucati da ih suzite.
Recent Commands Nedavne naredbe
No recent commands Nema nedavnih naredbi
Type to search commands, tools, panels and effects Upišite za pretragu naredbi, alata, panela i efekata
Dashed Line Isprekidana linija
Panel menu Meni panela
Unembed… Poništi ugrađivanje…
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -4125,6 +4125,7 @@ digits Malayalam Malaiàlam
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultat. Continueu escrivint per reduir-los.|{shown} de {n} resultats. Continueu escrivint per reduir-los.
Recent Commands Ordres recents
No recent commands No hi ha ordres recents
Type to search commands, tools, panels and effects Escriviu per cercar ordres, eines, panells i efectes
Search Commands… Cerca ordres…
Search Fonts Folder Cerca a la carpeta de tipus de lletra
Searching… Cercant…
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -4500,6 +4500,7 @@ font-technology Variable Variabilní
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} z {n} výsledku. Pište dál a výsledky se zúží.|{shown} z {n} výsledků. Pište dál a výsledky se zúží.|{shown} z {n} výsledků. Pište dál a výsledky se zúží.
Recent Commands Nedávné příkazy
No recent commands Žádné nedávné příkazy
Type to search commands, tools, panels and effects Pište pro hledání příkazů, nástrojů, panelů a efektů
Dashed Line Čárkovaná čára
Panel menu Nabídka panelu
Unembed… Zrušit vložení…
Can't render this file because it is too large.
+1
View File
@@ -6874,6 +6874,7 @@ font-technology Variable Variable
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} af {n} resultat. Skriv videre for at indsnævre dem.|{shown} af {n} resultater. Skriv videre for at indsnævre dem.
Recent Commands Seneste kommandoer
No recent commands Ingen seneste kommandoer
Type to search commands, tools, panels and effects Skriv for at søge i kommandoer, værktøjer, paneler og effekter
Dashed Line Stiplet linje
Panel menu Panelmenu
Unembed… Ophæv integrering…
Can't render this file because it is too large.
+1
View File
@@ -3260,6 +3260,7 @@ digits Malayalam Malayalam
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} von {n} Ergebnis. Tippen Sie weiter, um sie einzugrenzen.|{shown} von {n} Ergebnissen. Tippen Sie weiter, um sie einzugrenzen.
Recent Commands Zuletzt verwendete Befehle
No recent commands Keine zuletzt verwendeten Befehle
Type to search commands, tools, panels and effects Tippen, um Befehle, Werkzeuge, Bedienfelder und Effekte zu suchen
Search Commands… Befehle suchen…
Secondary Sekundär
Section Symbol Paragrafenzeichen
Can't render this file because it is too large.
+1
View File
@@ -3962,6 +3962,7 @@ digits Malayalam Μαλαγιάλαμ
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} από {n} αποτέλεσμα. Συνεχίστε να πληκτρολογείτε για να τα περιορίσετε.|{shown} από {n} αποτελέσματα. Συνεχίστε να πληκτρολογείτε για να τα περιορίσετε.
Recent Commands Πρόσφατες εντολές
No recent commands Δεν υπάρχουν πρόσφατες εντολές
Type to search commands, tools, panels and effects Πληκτρολογήστε για αναζήτηση εντολών, εργαλείων, πλαισίων και εφέ
Search Commands… Αναζήτηση εντολών…
Secondary Δευτερεύον
Section Symbol Σύμβολο ενότητας
Can't render this file because it is too large.
+1
View File
@@ -3298,6 +3298,7 @@ digits Malayalam Malayálam
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultado. Sigue escribiendo para acotarlos.|{shown} de {n} resultados. Sigue escribiendo para acotarlos.
Recent Commands Comandos recientes
No recent commands No hay comandos recientes
Type to search commands, tools, panels and effects Escriba para buscar comandos, herramientas, paneles y efectos
Search Commands… Buscar comandos…
Secondary Secundario
Section Symbol Símbolo de sección
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -4419,6 +4419,7 @@ font-technology Variable Muuttuvat
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown}/{n} tulosta. Kirjoita lisää rajataksesi tuloksia.|{shown}/{n} tulosta. Kirjoita lisää rajataksesi tuloksia.
Recent Commands Viimeisimmät komennot
No recent commands Ei viimeisimpiä komentoja
Type to search commands, tools, panels and effects Kirjoita hakeaksesi komentoja, työkaluja, paneeleita ja tehosteita
Dashed Line Katkoviiva
Panel menu Paneelivalikko
Unembed… Poista upotus…
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -3286,6 +3286,7 @@ digits Malayalam Malayalam
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} sur {n} résultat. Continuez à taper pour les affiner.|{shown} sur {n} résultats. Continuez à taper pour les affiner.
Recent Commands Commandes récentes
No recent commands Aucune commande récente
Type to search commands, tools, panels and effects Tapez pour chercher commandes, outils, panneaux et effets
Search Commands… Rechercher des commandes…
Secondary Secondaire
Section Symbol Symbole de section
Can't render this file because it is too large.
+2
View File
@@ -3401,6 +3401,8 @@
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} માંથી {shown} પરિણામ. તેમને સંકુચિત કરવા લખતા રહો.|{n} માંથી {shown} પરિણામો. તેમને સંકુચિત કરવા લખતા રહો.
Recent Commands તાજેતરના આદેશો
No recent commands કોઈ તાજેતરના આદેશો નથી
Type to search commands, tools, panels and effects આદેશો, ટૂલ્સ, પેનલ્સ અને ઇફેક્ટ્સ શોધવા માટે લખો
Recent તાજેતરના
Search images છબીઓ શોધો
Searching… શોધી રહ્યા છીએ…
Secondary ગૌણ
Can't render this file because it contains an unexpected character in line 72 and column 5.
+1
View File
@@ -4475,6 +4475,7 @@ antiAlias Sharp शार्प
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} में से {shown} परिणाम। इन्हें सीमित करने के लिए लिखते रहें।|{n} में से {shown} परिणाम। इन्हें सीमित करने के लिए लिखते रहें।
Recent Commands हाल के आदेश
No recent commands कोई हाल का आदेश नहीं
Type to search commands, tools, panels and effects आदेश, टूल, पैनल्स और इफ़ेक्ट्स खोजने के लिए टाइप करें
Search Commands… कमांड खोजें…
Search Fonts Folder खोज फ़ॉन्ट फ़ोल्डर
Search images इमेज खोजना
Can't render this file because it is too large.
+1
View File
@@ -3919,6 +3919,7 @@ mark-style Japanese Japán
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} találatból {shown} látható. Gépeljen tovább a szűkítéshez.
Recent Commands Legutóbbi parancsok
No recent commands Nincsenek legutóbbi parancsok
Type to search commands, tools, panels and effects Gépeljen parancsok, eszközök, panelek és effektusok kereséséhez
Search Commands… Parancsok keresése…
Search Fonts Folder Keresés betűtípusmappában
Searching… Keresés…
Can't render this file because it is too large.
+1
View File
@@ -4151,6 +4151,7 @@ font-technology Variable Variabel
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} dari {n} hasil. Terus ketik untuk mempersempitnya.
Recent Commands Perintah terbaru
No recent commands Tidak ada perintah terbaru
Type to search commands, tools, panels and effects Ketik untuk mencari perintah, alat, panel, dan efek
Dashed Line Garis putus-putus
Panel menu Menu panel
Unembed… Lepaskan sematan…
Can't render this file because it contains an unexpected character in line 2495 and column 5.
+1
View File
@@ -3341,6 +3341,7 @@ digits Malayalam Malayalam
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} di {n} risultato. Continua a digitare per restringerli.|{shown} di {n} risultati. Continua a digitare per restringerli.
Recent Commands Comandi recenti
No recent commands Nessun comando recente
Type to search commands, tools, panels and effects Digita per cercare comandi, strumenti, pannelli ed effetti
Search Commands… Cerca comandi…
Secondary Secondario
Section Symbol Simbolo di sezione
Can't render this file because it is too large.
+1
View File
@@ -3219,6 +3219,7 @@ mark-style Japanese 日本式
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} 件中 {shown} 件。続けて入力すると絞り込めます。
Recent Commands 最近使ったコマンド
No recent commands 最近使ったコマンドはありません
Type to search commands, tools, panels and effects 入力してコマンド、ツール、パネル、効果を検索
Secondary セカンダリ
Select All Art on Layer レイヤー上のすべてのアートを選択
Select All Assets すべてのアセットを選択
Can't render this file because it is too large.
+1
View File
@@ -6103,6 +6103,7 @@ font-technology Variable ცვლადი
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} შედეგიდან {shown}. გააგრძელეთ აკრეფა მათ შესამცირებლად.
Recent Commands ბოლო ბრძანებები
No recent commands ბოლო ბრძანებები არ არის
Type to search commands, tools, panels and effects აკრიფეთ ბრძანებების, ხელსაწყოების, პანელებისა და ეფექტების მოსაძებნად
Dashed Line ტირეებიანი ხაზი
Panel menu პანელის მენიუ
Unembed… ჩაშენების მოხსნა…
Can't render this file because it is too large.
+1
View File
@@ -3208,6 +3208,7 @@ mark-style Japanese 일본식
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. 결과 {n}개 중 {shown}개. 계속 입력하여 범위를 좁히세요.
Recent Commands 최근 명령
No recent commands 최근 명령 없음
Type to search commands, tools, panels and effects 입력하여 명령, 도구, 패널 및 효과 검색
Secondary 보조
Select All Art on Layer 레이어의 모든 아트웍 선택
Select All Assets 모든 에셋 선택
Can't render this file because it is too large.
+1
View File
@@ -4768,6 +4768,7 @@ font-technology Variable Variabel
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} van {n} resultaat. Typ verder om ze te beperken.|{shown} van {n} resultaten. Typ verder om ze te beperken.
Recent Commands Recente opdrachten
No recent commands Geen recente opdrachten
Type to search commands, tools, panels and effects Typ om opdrachten, gereedschappen, panelen en effecten te zoeken
Dashed Line Streepjeslijn
Panel menu Paneelmenu
Unembed… Insluiten ongedaan maken…
Can't render this file because it is too large.
+1
View File
@@ -4341,6 +4341,7 @@ font-technology Variable Zmienne
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} z {n} wyniku. Pisz dalej, aby je zawęzić.|{shown} z {n} wyników. Pisz dalej, aby je zawęzić.|{shown} z {n} wyników. Pisz dalej, aby je zawęzić.
Recent Commands Ostatnie polecenia
No recent commands Brak ostatnich poleceń
Type to search commands, tools, panels and effects Pisz, aby szukać poleceń, narzędzi, paneli i efektów
Dashed Line Linia przerywana
Panel menu Menu panelu
Unembed… Wyodrębnij…
Can't render this file because it is too large.
+1
View File
@@ -2757,6 +2757,7 @@ digits Malayalam Malaiala
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultado. Continue digitando para filtrá-los.|{shown} de {n} resultados. Continue digitando para filtrá-los.
Recent Commands Comandos recentes
No recent commands Nenhum comando recente
Type to search commands, tools, panels and effects Digite para pesquisar comandos, ferramentas, painéis e efeitos
Secondary Secundária
Section Symbol Símbolo de Seção
Select Selecionar
Can't render this file because it is too large.
+1
View File
@@ -3330,6 +3330,7 @@ digits Malayalam Малаялам
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} из {n} результата. Продолжайте вводить, чтобы сузить их.|{shown} из {n} результатов. Продолжайте вводить, чтобы сузить их.|{shown} из {n} результатов. Продолжайте вводить, чтобы сузить их.
Recent Commands Недавние команды
No recent commands Нет недавних команд
Type to search commands, tools, panels and effects Начните вводить для поиска команд, инструментов, панелей и эффектов
Search Commands… Поиск команд…
Secondary Вторичный
Section Symbol Символ параграфа
Can't render this file because it is too large.
+1
View File
@@ -3216,6 +3216,7 @@ digits Malayalam Malayalam
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} av {n} resultat. Fortsätt skriva för att begränsa dem.|{shown} av {n} resultat. Fortsätt skriva för att begränsa dem.
Recent Commands Senaste kommandon
No recent commands Inga senaste kommandon
Type to search commands, tools, panels and effects Skriv för att söka efter kommandon, verktyg, paneler och effekter
Search Commands… Sök kommandon…
Secondary Sekundär
Section Symbol Paragraftecken
Can't render this file because it is too large.
+1
View File
@@ -3088,6 +3088,7 @@ digits Malayalam Malayalam
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} sonuçtan {shown} tanesi. Daraltmak için yazmaya devam edin.
Recent Commands Son komutlar
No recent commands Son komut yok
Type to search commands, tools, panels and effects Komutları, araçları, panelleri ve efektleri aramak için yazın
Search Commands… Arama Komutları…
Secondary İkincil
Section Symbol Bölüm Sembolü
Can't render this file because it is too large.
+1
View File
@@ -3333,6 +3333,7 @@ digits Malayalam Малаялам
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} з {n} результату. Продовжуйте вводити, щоб звузити їх.|{shown} з {n} результатів. Продовжуйте вводити, щоб звузити їх.|{shown} з {n} результатів. Продовжуйте вводити, щоб звузити їх.
Recent Commands Нещодавні команди
No recent commands Немає нещодавніх команд
Type to search commands, tools, panels and effects Почніть вводити для пошуку команд, інструментів, панелей та ефектів
Search Commands… Пошук команд…
Secondary Вторинний
Section Symbol Символ параграфа
Can't render this file because it is too large.
+1
View File
@@ -3676,6 +3676,7 @@ mark-style Japanese Kiểu Nhật
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} trên {n} kết quả. Tiếp tục gõ để thu hẹp.
Recent Commands Lệnh gần đây
No recent commands Không có lệnh gần đây
Type to search commands, tools, panels and effects Nhập để tìm kiếm lệnh, công cụ, bảng và hiệu ứng
Search Commands… Tìm kiếm lệnh…
Search Fonts Folder Tìm kiếm thư mục phông chữ
Searching… Đang tìm kiếm…
Can't render this file because it contains an unexpected character in line 205 and column 5.
+1
View File
@@ -3160,6 +3160,7 @@ digits Malayalam 马拉雅拉姆数字
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. 共 {n} 个结果,显示 {shown} 个。继续输入以缩小范围。
Recent Commands 最近使用的命令
No recent commands 没有最近使用的命令
Type to search commands, tools, panels and effects 输入以搜索命令、工具、面板和效果
Search Commands… 搜索命令…
Secondary 次要
Section Symbol 章节符号
Can't render this file because it is too large.
+1
View File
@@ -4466,6 +4466,7 @@ digits Malayalam 馬來亞拉姆數字
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. 共 {n} 個結果,顯示 {shown} 個。繼續輸入以縮小範圍。
Recent Commands 最近使用的指令
No recent commands 沒有最近使用的指令
Type to search commands, tools, panels and effects 輸入以搜尋指令、工具、面板與效果
Search Commands… 搜尋指令…
Secondary 次要
Section Symbol 章節符號
Can't render this file because it is too large.
+138 -34
View File
@@ -401,8 +401,9 @@ fn build_in(lang: crate::i18n::Lang, native: bool) -> Vec<Entry> {
/// ([`crate::shortcut_editor::menu_target_now`]), so Clean Up… and Find and Replace… open their
/// dialogs. While that item is dimmed, no dialog opens and the status line says why the command
/// can't run. A panel's result shows the panel, and an effect's result runs what its Effect menu
/// item runs ([`crate::keymap::command_of`]).
pub(crate) fn run_pick(app: &mut VectorcraftApp, id: &str) {
/// item runs ([`crate::keymap::command_of`]). Returns what the pick did.
pub(crate) fn run_pick(app: &mut VectorcraftApp, id: &str) -> Picked {
let had_dialog = app.ui.dialog.is_some();
if let Some(tool) = id.strip_prefix("tool:") {
app.select_tool(tool);
} else if let Some(panel) = id.strip_prefix("panel:") {
@@ -411,27 +412,57 @@ pub(crate) fn run_pick(app: &mut VectorcraftApp, id: &str) {
// `window.panel` does.
if app.ui.screen_mode >= 3 {
app.status("panels can't be shown in Presentation Mode");
} else if let Err(e) = crate::panel_docking::reveal_panel(app, panel) {
return Picked::Refused;
}
if let Err(e) = crate::panel_docking::reveal_panel(app, panel) {
app.status(e);
return Picked::Refused;
}
} else if id.starts_with("plugin:") || id.starts_with("effect:") {
let command = crate::keymap::command_of(id);
let on = menus::enabled(app, &command.id);
// While the Effect menu dims the item (nothing selected), no dialog opens and the status
// line says why.
if id.starts_with("effect:") && !menus::enabled(app, &command.id) {
if id.starts_with("effect:") && !on {
if let Err(why) = crate::shortcut_editor::dimmed(app, &command.id) {
app.status(why);
}
} else {
menus::invoke(app, &command.id, command.params);
return Picked::Refused;
}
menus::invoke(app, &command.id, command.params);
if !on {
return Picked::Refused;
}
} else {
match crate::shortcut_editor::menu_target_now(app, id) {
Some(Ok((id, p))) => menus::invoke(app, &id, p),
Some(Err(why)) => app.status(why),
None => menus::invoke(app, id, json!({})),
Some(Err(why)) => {
app.status(why);
return Picked::Refused;
}
None => {
// The command is invoked while its menu item is dimmed too, and its own check
// reports why it can't run; the pick counts as refused.
let on = menus::enabled(app, id);
menus::invoke(app, id, json!({}));
if !on {
return Picked::Refused;
}
}
}
}
if !had_dialog && app.ui.dialog.is_some() { Picked::OpenedDialog } else { Picked::Ran }
}
/// What a pick of a palette result did ([`run_pick`]).
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) enum Picked {
/// The command ran, the tool was chosen or the panel was shown.
Ran,
/// The pick opened a dialog, which may still be canceled.
OpenedDialog,
/// The pick's menu item is dimmed now, or its panel can't be shown: the status line says why.
Refused,
}
/// The entries the query `q` matches, best first ([`search::rank`]). The ranking of the last query
@@ -539,11 +570,11 @@ fn nearest_in_view(sel: usize, offset: f32, view: f32, n: usize) -> usize {
/// and the highlighted result's id.
type Highlight = (usize, String, f32, f32, String);
/// How many picks the Recent Commands list beside the search field holds.
pub(crate) const MAX_RECENT_COMMANDS: usize = 5;
/// How many picks the Recent Commands list beside the search field, and an empty search, show.
pub(crate) const MAX_RECENT_COMMANDS: usize = 8;
/// How many ids the saved Recent Commands list holds at most, unavailable ones included.
const MAX_SAVED_RECENT_COMMANDS: usize = 4 * MAX_RECENT_COMMANDS;
const MAX_SAVED_RECENT_COMMANDS: usize = 20;
/// Puts `id` first in the Recent Commands ids `list`, removing its earlier place, and keeps the
/// newest [`MAX_RECENT_COMMANDS`] ids that are `known`. An id that is not `known` now (a plug-in
@@ -751,7 +782,7 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
ui.ctx().data_mut(|d| d.insert_temp(field_id, r.id));
ui.add_space(6.0);
if empty && n > 0 {
ui.label(egui::RichText::new(tl!("Recent Commands")).color(t.text_dim));
ui.label(egui::RichText::new(tl!("Recent")).color(t.text_dim));
}
// The list shows as many rows as fit above the footer in the window, up to
// VISIBLE_ROWS; a page is that many rows.
@@ -823,13 +854,14 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
}
});
}
// Under the recent picks no count is shown; with none, one dimmed line says so.
// Under the recent picks no count is shown; with none, one dimmed line says what a search
// finds.
if !empty {
ui.add_space(6.0);
ui.label(egui::RichText::new(footer(n, total)).color(t.text_dim));
} else if n == 0 {
ui.add_space(6.0);
ui.label(egui::RichText::new(tl!("No recent commands")).color(t.text_dim));
ui.label(egui::RichText::new(tl!("Type to search commands, tools, panels and effects")).color(t.text_dim));
}
if !list_open
&& !history_focused
@@ -867,10 +899,11 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
});
if let Some(id) = run {
app.ui.palette_open = false;
if id != PALETTE_TOGGLE {
// A pick that ran or opened a dialog goes first in Recent Commands, even when the dialog
// is then canceled. A refused pick is not recorded.
if run_pick(app, &id) != Picked::Refused && id != PALETTE_TOGGLE {
remember(&mut app.ui.recent_commands, &id, |c| entries.list.iter().any(|e| e.id == c));
}
run_pick(app, &id);
} else if outside {
app.ui.palette_open = false;
}
@@ -1194,7 +1227,7 @@ mod tests {
}
assert_eq!(list, ["object.group", "paint.swap"]);
// A pick with Enter in the open palette is remembered.
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default());
let mut app = VectorcraftApp::new(vectorcraft_testkit::fixtures::Fixture::Multi.session(), crate::Services::default());
app.ui.recent_commands = list;
app.ui.palette_open = true;
app.ui.palette_query = "paint.swap".into();
@@ -1209,15 +1242,15 @@ mod tests {
assert_eq!(restored.recent_commands, app.ui.recent_commands);
}
/// #6376: Recent Commands keeps the last five picks.
/// Recent Commands keeps the last eight picks.
#[test]
fn recent_commands_keep_the_last_five_picks() {
fn recent_commands_keep_the_last_eight_picks() {
let mut list = vec![];
let ids = ["a", "b", "c", "d", "e", "f", "g"];
let ids = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"];
for id in ids {
remember(&mut list, id, |_| true);
}
assert_eq!(list, ["g", "f", "e", "d", "c"]);
assert_eq!(list, ["j", "i", "h", "g", "f", "e", "d", "c"]);
let entries = build(Lang::EN);
let many: Vec<String> = entries.iter().take(MAX_RECENT_COMMANDS + 2).map(|e| e.id.clone()).collect();
assert_eq!(recent(&entries, &many).len(), MAX_RECENT_COMMANDS);
@@ -1225,7 +1258,7 @@ mod tests {
/// #6376: a command that does not exist now, such as a plug-in's filter while the plug-in is
/// not loaded, is left out of Recent Commands. A pick keeps it in the saved list, so it shows
/// again when the command comes back; five other commands picked after it push it out.
/// again when the command comes back; eight other commands picked after it push it out.
#[test]
fn recent_commands_skip_ids_that_no_longer_exist() {
let entries = build(Lang::EN);
@@ -1236,13 +1269,14 @@ mod tests {
let mut list = saved;
remember(&mut list, "paint.swap", known);
assert_eq!(list, ["paint.swap", "plugin:test.UI.palette_removed", "object.group", "tool:no-such-tool"]);
let four: Vec<String> = entries.iter().filter(|e| e.id != "paint.swap" && e.id != "object.group").take(4).map(|e| e.id.clone()).collect();
for id in &four {
let others: Vec<String> =
entries.iter().filter(|e| e.id != "paint.swap" && e.id != "object.group").take(MAX_RECENT_COMMANDS - 1).map(|e| e.id.clone()).collect();
for id in &others {
remember(&mut list, id, known);
}
let expected: Vec<String> =
four.iter().rev().cloned().chain(["paint.swap".to_string(), "plugin:test.UI.palette_removed".to_string()]).collect();
assert_eq!(list, expected, "object.group, the sixth known id, and the ids after it go");
others.iter().rev().cloned().chain(["paint.swap".to_string(), "plugin:test.UI.palette_removed".to_string()]).collect();
assert_eq!(list, expected, "object.group, the ninth known id, and the ids after it go");
// Unavailable ids are capped too.
let mut list: Vec<String> = (0..50).map(|i| format!("plugin:test.UI.gone{i}")).collect();
remember(&mut list, "paint.swap", known);
@@ -1362,7 +1396,7 @@ mod tests {
/// result. Only the Recent Commands list takes them.
#[test]
fn another_popup_leaves_enter_to_the_palette() {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default());
let mut app = VectorcraftApp::new(vectorcraft_testkit::fixtures::Fixture::Multi.session(), crate::Services::default());
app.ui.palette_open = true;
app.ui.palette_query = "paint.swap".into();
let first = build(crate::i18n::current()).into_iter().find(|e| e.haystack.contains("paint.swap")).unwrap().id;
@@ -1452,8 +1486,8 @@ mod tests {
ids.iter().map(|id| row_label(entries.iter().find(|e| e.id == *id).unwrap())).collect()
}
/// An empty search, or one of spaces only, lists the recent picks under a Recent Commands
/// heading, most recent first, with the first highlighted. A pick whose command is gone is left
/// An empty search, or one of spaces only, lists the recent picks under a Recent heading, most
/// recent first, with the first highlighted. A pick whose command is gone is left
/// out, and no count is shown.
#[test]
fn an_empty_search_lists_the_recent_picks_most_recent_first() {
@@ -1466,20 +1500,21 @@ mod tests {
let expected = row_labels(&open.ctx, &["paint.swap", "object.group"]);
assert_eq!(shown, [(expected[0].clone(), true), (expected[1].clone(), false)], "{query:?}");
let labels = labels(&nodes);
assert!(labels.iter().any(|l| l == tl!("Recent Commands")), "{query:?}: the heading: {labels:?}");
assert!(labels.iter().any(|l| l == tl!("Recent")), "{query:?}: the heading: {labels:?}");
assert!(!labels.iter().any(|l| l.contains("result")), "{query:?}: no count: {labels:?}");
}
}
/// An empty search with nothing picked yet lists no rows and says there are no recent commands.
/// An empty search with nothing picked yet lists no rows and says what a search finds.
#[test]
fn an_empty_search_without_picks_says_there_are_none() {
fn an_empty_search_without_picks_says_what_to_type() {
let mut open = Open::new("", WINDOW);
let nodes = open.frame(vec![]);
assert!(rows(&nodes).is_empty(), "{:?}", rows(&nodes));
let labels = labels(&nodes);
assert!(labels.iter().any(|l| l == tl!("No recent commands")), "{labels:?}");
assert!(!labels.iter().any(|l| l == tl!("No commands match") || l == tl!("Recent Commands")), "{labels:?}");
assert!(labels.iter().any(|l| l == tl!("Type to search commands, tools, panels and effects")), "{labels:?}");
let other = [tl!("No commands match"), tl!("Recent"), tl!("No recent commands")];
assert!(!labels.iter().any(|l| other.contains(&l.as_str())), "{labels:?}");
assert!(open.app.ui.palette_open);
}
@@ -1574,6 +1609,75 @@ mod tests {
assert_eq!(open.app.ui.recent_commands, ["paint.swap", "object.group"]);
}
/// A pick says what it did: it ran, it opened a dialog, or it was refused because its menu item
/// is dimmed or its panel can't be shown.
#[test]
fn a_pick_says_whether_it_ran_opened_a_dialog_or_was_refused() {
use vectorcraft_testkit::fixtures::Fixture;
let app = |session| VectorcraftApp::new(session, crate::Services::default());
assert_eq!(run_pick(&mut app(Fixture::Multi.session()), "object.group"), Picked::Ran);
assert_eq!(run_pick(&mut app(Fixture::Multi.session()), "tool:knife"), Picked::Ran);
assert_eq!(run_pick(&mut app(Fixture::Multi.session()), "panel:swatches"), Picked::Ran);
let mut dialog = app(Fixture::Single.session());
assert_eq!(run_pick(&mut dialog, "object.path.cleanUp"), Picked::OpenedDialog);
assert!(dialog.ui.dialog.is_some());
for id in ["edit.findReplace", "object.group"] {
assert_eq!(run_pick(&mut app(vectorcraft_engine::Session::new()), id), Picked::Refused, "{id}");
}
let mut presenting = app(Fixture::Multi.session());
presenting.ui.screen_mode = 3;
assert_eq!(run_pick(&mut presenting, "panel:swatches"), Picked::Refused);
}
/// A pick that is refused while its menu item is dimmed is not recorded in Recent Commands,
/// from a search or from the recent picks, which keep their order.
#[test]
fn a_refused_pick_is_not_recorded() {
for (query, id) in [("find and replace", "edit.findReplace"), ("group", "object.group")] {
let mut open = Open::new(query, WINDOW);
open.app.ui.recent_commands = vec!["paint.swap".into()];
let k = open.listed().iter().position(|c| c == id).unwrap_or_else(|| panic!("{query:?} finds {id}"));
open.frame(vec![]);
open.press(egui::Key::ArrowDown, k);
assert_eq!(open.highlighted(), k, "{id}");
open.app.ui.status.clear();
open.press(egui::Key::Enter, 1);
assert!(!open.app.ui.palette_open, "{id}: the palette closes");
assert!(open.app.ui.dialog.is_none(), "{id}");
assert_eq!(open.app.ui.recent_commands, ["paint.swap"], "{id}");
}
let mut open = Open::new("", WINDOW);
open.app.ui.recent_commands = vec!["paint.swap".into(), "object.group".into()];
open.frame(vec![]);
open.press(egui::Key::ArrowDown, 1);
assert_eq!(open.highlighted(), 1);
open.press(egui::Key::Enter, 1);
assert!(!open.app.ui.palette_open, "the palette closes");
assert_eq!(open.app.ui.recent_commands, ["paint.swap", "object.group"]);
}
/// A pick that opens a dialog is recorded in Recent Commands when the dialog opens, so it stays
/// there when the dialog is canceled.
#[test]
fn a_pick_that_opens_a_dialog_is_recorded_even_when_canceled() {
let id = "object.path.cleanUp";
let mut open = Open::new("clean up", WINDOW);
open.app = VectorcraftApp::new(vectorcraft_testkit::fixtures::Fixture::Single.session(), crate::Services::default());
open.app.ui.palette_open = true;
open.app.ui.palette_query = "clean up".into();
open.app.ui.recent_commands = vec!["paint.swap".into()];
let k = open.listed().iter().position(|c| c == id).expect("the search finds Clean Up…");
open.frame(vec![]);
open.press(egui::Key::ArrowDown, k);
open.press(egui::Key::Enter, 1);
assert!(open.app.ui.dialog.is_some(), "{}", open.app.ui.status);
assert_eq!(open.app.ui.recent_commands, [id, "paint.swap"]);
// Cancel closes the dialog without running the command.
open.app.ui.dialog = None;
open.frame(vec![]);
assert_eq!(open.app.ui.recent_commands, [id, "paint.swap"]);
}
/// #1757: Up and Down move the highlighted result, wrapping at the ends; a new query starts
/// from the first again.
#[test]
+2 -2
View File
@@ -1026,8 +1026,8 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- Perspective Distort and Free Distort (`object.distort`) turn each warped object's bounding box as the warp turns the object at its own center, the objects inside groups, compound paths and clip groups and the art of linked opacity masks included, so the next Selection or Free Transform drag uses the tilted box; Object › Transform › Reset Bounding Box squares it again, and corners left where they are add no undo step (VectorCraft's own rule; `bboxrotate::distort_turns_an_upright_box_with_the_warp_at_its_center`, `distort_turns_each_member_and_linked_mask_by_its_own_warp`, `mirrored_and_collapsing_distorts_keep_valid_angles`, `distort_angles_undo_redo_and_reopen_together`, `xform::unchanged_distort_records_no_history`).
- The Free Transform widget's Constrain works in Free Distort as well as in Free Transform ([the help page](https://helpx.adobe.com/illustrator/using/tool-techniques/free-transform-tool.html)). With Constrain on, or Shift held, a corner dragged in Free Distort moves only along the line through the opposite corner, in the box's own proportions, and the other three corners stay in place; on a turned box the line runs through the box's own corners. The line is VectorCraft's own rule. Cmd/Ctrl+Alt+Shift on a corner still drags in Perspective Distort, where Constrain stays unavailable (tools `xform::free::tests::free_distort_corner_keeps_to_its_diagonal_with_shift_or_constrain`, `shift_pressed_during_a_free_distort_drag_constrains_it`, `a_turned_box_is_constrained_along_its_own_diagonal`, `along_diagonal_of_a_degenerate_box`; engine `xform::free_transform_constrained_distort_keeps_the_corner_on_its_diagonal`; ui-egui `free_transform::tests::the_widget_sets_the_mode_and_a_corner_drag_then_distorts`).
- Native macOS menu bar, vector tool cursors, a command palette (Help › Search Commands…), 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).
- A Recent Commands button beside the Help › Search Commands field lists the last five commands and tools picked from the palette, most recent first, with a command picked again moved to the top. Choosing a row closes the palette and runs it as a pick of the same result does; with no picks yet the list shows a dimmed No recent commands row, and a command that is not available now, such as a filter of a plug-in that is not loaded, is left out until it comes back. The ids are saved with the UI state. While the list is open, Up and Down move through its rows, wrapping at the ends, and Escape closes the list before the palette. This is VectorCraft's own addition and does not raise a score (#6376; `palette` tests `recent_commands_*`, `a_recent_command_runs_what_its_pick_runs`, `the_keys_wrap_within_recent_commands`, `escape_closes_recent_commands_before_the_palette`).
- With an empty search, or one of spaces only, the Help › Search Commands field lists the picks of the Recent Commands list (at most five, leaving out a filter of a plug-in that is not loaded) under a Recent Commands heading, most recent first, with the first highlighted and no result count, so opening the palette and pressing Enter picks the last pick again; a pick that is dimmed now shows why in the status line, as from a search. With no picks yet it lists no results and shows a dimmed No recent commands line. A pick of Search Commands… itself is not recorded. The palette opens with its first result highlighted and its list scrolled to the top. This is VectorCraft's own behavior (`palette` tests `an_empty_search_lists_the_recent_picks_most_recent_first`, `an_empty_search_without_picks_says_there_are_none`, `enter_on_an_empty_search_runs_the_last_pick_again`, `the_palette_opens_again_with_its_first_row_highlighted`, `the_palette_toggle_is_not_a_recent_pick`, `a_click_on_a_recent_pick_runs_it_and_moves_it_first`).
- A Recent Commands button beside the Help › Search Commands field lists the last eight commands and tools picked from the palette, most recent first, with a command picked again moved to the top. A pick is recorded when it runs or opens a dialog, even if the dialog is then canceled; a pick that is refused because its menu item is dimmed, or because its panel can't be shown, is not recorded. Choosing a row closes the palette and runs it as a pick of the same result does; with no picks yet the list shows a dimmed No recent commands row, and a command that is not available now, such as a filter of a plug-in that is not loaded, is left out until it comes back. The ids are saved with the UI state. While the list is open, Up and Down move through its rows, wrapping at the ends, and Escape closes the list before the palette. This is VectorCraft's own addition and does not raise a score (#6376; `palette` tests `recent_commands_*`, `a_recent_command_runs_what_its_pick_runs`, `the_keys_wrap_within_recent_commands`, `escape_closes_recent_commands_before_the_palette`).
- With an empty search, or one of spaces only, the Help › Search Commands field lists the picks of the Recent Commands list (at most eight, leaving out a filter of a plug-in that is not loaded) under a Recent heading, most recent first, with the first highlighted and no result count, so opening the palette and pressing Enter picks the last pick again; a pick that is dimmed now shows why in the status line, as from a search, and keeps its place in the list. With no picks yet it lists no results and shows a dimmed line, "Type to search commands, tools, panels and effects". A pick of Search Commands… itself is not recorded. The palette opens with its first result highlighted and its list scrolled to the top. This is VectorCraft's own behavior (`palette` tests `an_empty_search_lists_the_recent_picks_most_recent_first`, `an_empty_search_without_picks_says_what_to_type`, `enter_on_an_empty_search_runs_the_last_pick_again`, `the_palette_opens_again_with_its_first_row_highlighted`, `the_palette_toggle_is_not_a_recent_pick`, `a_click_on_a_recent_pick_runs_it_and_moves_it_first`, `a_pick_says_whether_it_ran_opened_a_dialog_or_was_refused`, `a_refused_pick_is_not_recorded`, `a_pick_that_opens_a_dialog_is_recorded_even_when_canceled`).
- The Learn panel (Window › Learn, or Explore tutorials beside the search icon on the app bar) has a For you tab with a Get started section and a Quick skill guide card, and a Skills tab that lists VectorCraft's own skills with their progress rings and counts of tutorials finished; a skill lists its tutorials, a tutorial shows its numbered steps, and Back goes up a level; `learn.list`, `learn.tab {tab}`, `learn.skill {skill}`, `learn.show {tutorial}` and `learn.back` script it, and the tab buttons, the rows and Back run them ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html); `panels::learn::tests`).
- A tool's name in a Learn tutorial step is a blue link that shows where the tool is without choosing it (`learn.locateTool {tool}`): its toolbar button is marked, a collapsed group's flyout opens with the tool's row marked, a torn-off strip comes to the front, and a tool no shown toolbar holds is marked in the All Tools drawer. The mark, its 3 seconds and the hidden-toolbar cases are VectorCraft's own rules ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html); `panels::learn::tests`, the `a_learn_link_*` tests in `toolbar::tests`).
- Under a tutorial's steps, View more opens the tutorial's own practice sample as a new untitled document, and once the tutorial is finished, Next Up moves to the next tutorial in the same skill, as the help page describes ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html)). The samples are VectorCraft's own drawings. A Finish tutorial button that shows once the sample is open, the untitled copy, Back to skills in place of Next Up after a skill's last tutorial, and Next Up showing the next tutorial without opening its sample are VectorCraft's own rules. `learn.openSample`, `learn.finish`, `learn.next` and `learn.skills` (Back to skills) script them. Not done: the help page's short video. Regression tests: `view_more_opens_the_tutorial_s_sample_as_a_new_untitled_document`, `finishing_a_tutorial_offers_next_up_in_its_skill`, `the_practice_controls_work_from_the_keyboard`, `the_last_tutorial_of_a_skill_offers_back_to_skills`, `learn_finish_and_learn_next_follow_the_practice`, `learn_skills_shows_the_list_of_skills`, `the_practice_commands_reject_a_missing_or_unknown_tutorial`, `every_tutorial_has_its_own_readable_sample` and `the_next_tutorial_is_the_next_one_in_the_same_skill` in `crates/ui-egui/src/panels/learn/tests.rs`.