mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 12:38:18 +00:00
Merge pull request #8656 from storytold/train/carry6295
Edit Original: choose a raster editor through the native picker (#6295)
This commit is contained in:
@@ -459,6 +459,8 @@ pub(crate) fn services(parent: Parent, ui: egui::Context) -> Services {
|
||||
open_file: Some(Box::new(open_file)),
|
||||
// Edit Original of a raster image with Use System Defaults for Edit Original off (#5236).
|
||||
open_in_photocraft: Some(Box::new(open_in_photocraft)),
|
||||
check_application: Some(Box::new(|p| check_app(std::path::Path::new(p)))),
|
||||
open_in_application: Some(Box::new(open_in_application)),
|
||||
pick_folder: Some(Box::new(move || pick_now(PickRequest::Folder, &p4).into_iter().next())),
|
||||
pick_folder_at: Some(Box::new(move |start: &str| pick_now(PickRequest::FolderAt(start.to_string()), &p7).into_iter().next())),
|
||||
// Sample Color from Screen: the system's color sampler.
|
||||
@@ -507,15 +509,32 @@ fn open_in_photocraft(path: &str) -> Result<bool, String> {
|
||||
explorer_safe(path)?;
|
||||
let home = std::env::var_os(if cfg!(windows) { "USERPROFILE" } else { "HOME" }).map(std::path::PathBuf::from);
|
||||
let Some(app) = find_photocraft(home.as_deref(), std::env::var_os("PATH").as_deref()) else { return Ok(false) };
|
||||
launch_application(&app, path)
|
||||
}
|
||||
|
||||
/// A missing chosen editor falls back; invalid applications and failed launches remain errors.
|
||||
fn open_in_application(app: &str, path: &str) -> Result<bool, String> {
|
||||
explorer_safe(path)?;
|
||||
let app = std::path::Path::new(app);
|
||||
match std::fs::metadata(app) {
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => return Ok(false),
|
||||
Err(e) => return Err(format!("cannot inspect {}: {e}", app.display())),
|
||||
Ok(_) => {}
|
||||
}
|
||||
check_app(app)?;
|
||||
launch_application(app, path)
|
||||
}
|
||||
|
||||
fn launch_application(app: &std::path::Path, path: &str) -> Result<bool, String> {
|
||||
#[cfg(target_os = "macos")]
|
||||
let mut c = {
|
||||
let mut c = std::process::Command::new("open");
|
||||
c.arg("-a").arg(&app).arg(path);
|
||||
c.arg("-a").arg(app).arg(path);
|
||||
c
|
||||
};
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
let mut c = {
|
||||
let mut c = std::process::Command::new(&app);
|
||||
let mut c = std::process::Command::new(app);
|
||||
c.arg(path);
|
||||
c
|
||||
};
|
||||
@@ -688,6 +707,17 @@ mod open_with_tests {
|
||||
tempfile::Builder::new().prefix(&format!("vc-open-with-{name}-")).tempdir().unwrap()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn chosen_editor_only_falls_back_when_missing() {
|
||||
let dir = scratch("chosen");
|
||||
let missing = dir.path().join("Missing.exe");
|
||||
assert!(!super::open_in_application(&missing.to_string_lossy(), "image with spaces.png").unwrap());
|
||||
let doc = dir.path().join("notes.txt");
|
||||
std::fs::write(&doc, "not an application").unwrap();
|
||||
assert!(super::open_in_application(&doc.to_string_lossy(), "image.png").is_err());
|
||||
assert!(super::open_in_application(&dir.path().to_string_lossy(), "image.png").is_err());
|
||||
}
|
||||
|
||||
/// #5236: only an application counts as PhotoCraft, never a document, a folder or a missing
|
||||
/// path.
|
||||
#[test]
|
||||
|
||||
@@ -152,6 +152,7 @@ impl VectorcraftApp {
|
||||
system_paste_at: f64::NEG_INFINITY,
|
||||
clipboard_probe: None,
|
||||
picks: picks::Picks::default(),
|
||||
original_editor: Default::default(),
|
||||
screen_sampler: None,
|
||||
font_check: None,
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
|
||||
@@ -739,6 +739,9 @@ pub fn cancel(app: &mut VectorcraftApp) {
|
||||
return;
|
||||
}
|
||||
if let Some(d) = app.ui.dialog.take() {
|
||||
if d.kind == "preferences" {
|
||||
crate::original_editor::cancel(app);
|
||||
}
|
||||
if d.kind == swatch_conflict::KIND {
|
||||
crate::placing::cancel_swatch_paste(app);
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ pub(crate) fn ask_reset_prefs(app: &mut VectorcraftApp) {
|
||||
fn reset_prefs(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> {
|
||||
let mut prefs = super::parent(d).filter(|p| p.kind == "preferences").ok_or("the dialog it was opened over is no longer open")?;
|
||||
crate::prefs_dialog::reset_fields(&mut prefs);
|
||||
crate::original_editor::reset(app);
|
||||
app.ui.dialog = Some(prefs);
|
||||
Ok(Value::Null)
|
||||
}
|
||||
|
||||
@@ -7727,3 +7727,7 @@ breakText Glyphs Глифи
|
||||
Pulse Stroke Пулсиращ щрих
|
||||
Round Flow Кръгъл поток
|
||||
Chisel Flow Скосен поток
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Редактиране на оригинала с:
|
||||
file-filter Applications Приложения
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7782,3 +7782,7 @@ shape Open Otvoren
|
||||
Pulse Stroke Pulsirajući potez
|
||||
Round Flow Okrugli tok
|
||||
Chisel Flow Kosi tok
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Uredi original pomoću:
|
||||
file-filter Applications Aplikacije
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -8684,3 +8684,7 @@ breakText Glyphs Glifs
|
||||
Round Flow Flux rodó
|
||||
Chisel Flow Flux bisellat
|
||||
@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: utilitzeu "{_1}" o "{_2}"
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Edita l’original amb:
|
||||
file-filter Applications Aplicacions
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10477,3 +10477,7 @@ breakText Glyphs Glyfy
|
||||
@msg Other blanks not shown: {count} Další přířezy nejsou zobrazeny: {count}
|
||||
@msg A joint does not close by {gap} pt. Spoj se nezavírá o {gap} pt.
|
||||
@msg Two panels pass through each other. Dva panely procházejí jeden druhým.
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Upravit originál v:
|
||||
file-filter Applications Aplikace
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10573,3 +10573,7 @@ breakText Glyphs Glyffer
|
||||
Pulse Stroke Pulserende strøg
|
||||
Round Flow Rundt strøg
|
||||
Chisel Flow Skråt strøg
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Redigér original med:
|
||||
file-filter Applications Programmer
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10090,3 +10090,7 @@ breakText Glyphs Glyphen
|
||||
@msg Other blanks not shown: {count} Weitere Zuschnitte nicht angezeigt: {count}
|
||||
@msg A joint does not close by {gap} pt. Eine Verbindung schließt um {gap} pt nicht.
|
||||
@msg Two panels pass through each other. Zwei Felder durchdringen einander.
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Original bearbeiten mit:
|
||||
file-filter Applications Anwendungen
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8658,3 +8658,7 @@ breakText Glyphs Γλύφοι
|
||||
Round Flow Στρογγυλή ροή
|
||||
Chisel Flow Λοξή ροή
|
||||
@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: χρησιμοποιήστε "{_1}" ή "{_2}"
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Επεξεργασία πρωτοτύπου με:
|
||||
file-filter Applications Εφαρμογές
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10404,3 +10404,7 @@ breakText Glyphs Glifos
|
||||
Round Flow Flujo redondo
|
||||
Chisel Flow Flujo biselado
|
||||
@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: use "{_1}" o "{_2}"
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Editar original con:
|
||||
file-filter Applications Aplicaciones
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8741,3 +8741,7 @@ breakText Glyphs Merkit
|
||||
Round Flow Pyöreä veto
|
||||
Chisel Flow Viisto veto
|
||||
@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: käytä arvoa "{_1}" tai "{_2}"
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Muokkaa alkuperäistä sovelluksella:
|
||||
file-filter Applications Sovellukset
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10463,3 +10463,7 @@ breakText Glyphs Glyphes
|
||||
Pulse Stroke Trait pulsé
|
||||
Round Flow Flux rond
|
||||
Chisel Flow Flux biseauté
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Modifier l’original avec :
|
||||
file-filter Applications Applications
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10083,3 +10083,7 @@ theme Appearance अपीयरेंस
|
||||
@msg Other blanks not shown: {count} दूसरे ब्लैंक नहीं दिखाए गए: {count}
|
||||
@msg A joint does not close by {gap} pt. एक जोड़ {gap} pt से बंद नहीं होता।
|
||||
@msg Two panels pass through each other. दो पैनल एक-दूसरे के आर-पार जाते हैं।
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: मूल फ़ाइल इसमें एडिट करें:
|
||||
file-filter Applications ऐप्स
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10465,3 +10465,7 @@ breakText Glyphs Glifák
|
||||
@msg Other blanks not shown: {count} További kiterítékek nincsenek megjelenítve: {count}
|
||||
@msg A joint does not close by {gap} pt. Egy illesztés {gap} pt-tal nem záródik.
|
||||
@msg Two panels pass through each other. Két panel áthatol egymáson.
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Eredeti szerkesztése ezzel:
|
||||
file-filter Applications Alkalmazások
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -7742,3 +7742,7 @@ breakText Glyphs Glif
|
||||
Pulse Stroke Goresan Berdenyut
|
||||
Round Flow Aliran Bulat
|
||||
Chisel Flow Aliran Serong
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Edit asli dengan:
|
||||
file-filter Applications Aplikasi
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2586 and column 5.
|
@@ -10123,3 +10123,7 @@ breakText Glyphs Glifi
|
||||
@msg Other blanks not shown: {count} Altri fustellati non mostrati: {count}
|
||||
@msg A joint does not close by {gap} pt. Una giunzione non si chiude di {gap} pt.
|
||||
@msg Two panels pass through each other. Due pannelli si attraversano.
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Modifica originale con:
|
||||
file-filter Applications Applicazioni
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10187,3 +10187,7 @@ breakText Glyphs 字形
|
||||
@msg Other blanks not shown: {count} 表示されていない他の展開図: {count}
|
||||
@msg A joint does not close by {gap} pt. 継ぎ目が {gap} pt 閉じていません。
|
||||
@msg Two panels pass through each other. 2 つのパネルが互いを貫通しています。
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: 元のファイルを編集するアプリ:
|
||||
file-filter Applications アプリケーション
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10818,3 +10818,7 @@ font-script Japanese იაპონური
|
||||
Pulse Stroke პულსირებადი მონასმი
|
||||
Round Flow მრგვალი ნაკადი
|
||||
Chisel Flow დახრილი ნაკადი
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: ორიგინალის რედაქტირება პროგრამით:
|
||||
file-filter Applications აპლიკაციები
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10086,3 +10086,7 @@ breakText Glyphs 글리프
|
||||
@msg Other blanks not shown: {count} 표시되지 않은 다른 전개도: {count}
|
||||
@msg A joint does not close by {gap} pt. 이음매가 {gap} pt만큼 닫히지 않습니다.
|
||||
@msg Two panels pass through each other. 두 패널이 서로 관통합니다.
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: 원본 편집 앱:
|
||||
file-filter Applications 응용 프로그램
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10516,3 +10516,7 @@ breakText Glyphs Glyphs
|
||||
@msg Other blanks not shown: {count} Andere uitslagen niet getoond: {count}
|
||||
@msg A joint does not close by {gap} pt. Een naad sluit {gap} pt niet.
|
||||
@msg Two panels pass through each other. Twee panelen gaan door elkaar heen.
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Origineel bewerken met:
|
||||
file-filter Applications Programma’s
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10340,3 +10340,7 @@ breakText Glyphs Glify
|
||||
@msg Other blanks not shown: {count} Inne wykroje nie są pokazane: {count}
|
||||
@msg A joint does not close by {gap} pt. Połączenie nie domyka się o {gap} pt.
|
||||
@msg Two panels pass through each other. Dwa panele przechodzą przez siebie.
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Edytuj oryginał w:
|
||||
file-filter Applications Aplikacje
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10549,3 +10549,7 @@ swatch Yellow Green Verde-amarelado
|
||||
@msg Other blanks not shown: {count} Outras planificações não exibidas: {count}
|
||||
@msg A joint does not close by {gap} pt. Uma junção não fecha por {gap} pt.
|
||||
@msg Two panels pass through each other. Dois painéis se atravessam.
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Editar original com:
|
||||
file-filter Applications Aplicativos
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10565,3 +10565,7 @@ shape Open Открытый
|
||||
Pulse Stroke Пульсирующий штрих
|
||||
Round Flow Круглый поток
|
||||
Chisel Flow Косой поток
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Редактировать оригинал в:
|
||||
file-filter Applications Приложения
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10168,3 +10168,7 @@ digits Hindi Hindi
|
||||
Pulse Stroke Pulserande drag
|
||||
Round Flow Runt flöde
|
||||
Chisel Flow Snedflöde
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Redigera original med:
|
||||
file-filter Applications Program
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10435,3 +10435,7 @@ breakText Glyphs Glifler
|
||||
@msg Other blanks not shown: {count} Gösterilmeyen diğer açınımlar: {count}
|
||||
@msg A joint does not close by {gap} pt. Bir birleşim {gap} pt kadar kapanmıyor.
|
||||
@msg Two panels pass through each other. İki panel birbirinin içinden geçiyor.
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Orijinali şununla düzenle:
|
||||
file-filter Applications Uygulamalar
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10099,3 +10099,7 @@ breakText Glyphs Гліфи
|
||||
@msg Other blanks not shown: {count} Інші розгортки не показано: {count}
|
||||
@msg A joint does not close by {gap} pt. Стик не змикається на {gap} pt.
|
||||
@msg Two panels pass through each other. Дві панелі проходять одна крізь одну.
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Редагувати оригінал у:
|
||||
file-filter Applications Програми
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8329,3 +8329,7 @@ breakText Glyphs Glyph
|
||||
Round Flow Nét tròn
|
||||
Chisel Flow Nét vát
|
||||
@msg text.{key} `{v}`: use "{_1}" or "{_2}" text.{key} `{v}`: hãy dùng "{_1}" hoặc "{_2}"
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: Chỉnh sửa bản gốc bằng:
|
||||
file-filter Applications Ứng dụng
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10325,3 +10325,7 @@ breakText Glyphs 字形
|
||||
Pulse Stroke 脉动笔触
|
||||
Round Flow 圆头流线
|
||||
Chisel Flow 斜头流线
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: 编辑原稿所用应用:
|
||||
file-filter Applications 应用程序
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -10140,3 +10140,7 @@ breakText Glyphs 字符
|
||||
Pulse Stroke 脈動筆觸
|
||||
Round Flow 圓頭流線
|
||||
Chisel Flow 斜頭流線
|
||||
|
||||
# #5804 native-picked raster editor (draft translations; native review welcome).
|
||||
Edit Original with: 編輯原稿所用應用程式:
|
||||
file-filter Applications 應用程式
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -341,11 +341,14 @@ pub(crate) fn open_in_app(app: &mut VectorcraftApp, path: &str) -> Result<(), St
|
||||
}
|
||||
|
||||
/// Edit Original: open `path` in the system's default app for it, or with Preferences › File
|
||||
/// Handling › Use System Defaults for Edit Original off, in the app that made it (#5236): PhotoCraft
|
||||
/// for a raster image where it is installed. Any other file, or no PhotoCraft, uses the system's app.
|
||||
/// Handling › Use System Defaults for Edit Original off, in a native-picked raster editor (#5804),
|
||||
/// then PhotoCraft where installed (#5236). Other files, or no installed editor, use the system's app.
|
||||
pub(crate) fn open_original(app: &mut VectorcraftApp, path: &str) -> Result<(), String> {
|
||||
let ext = std::path::Path::new(path).extension().map(|e| e.to_string_lossy().into_owned()).unwrap_or_default();
|
||||
let raster = vectorcraft_engine::cmd::fileio::readable_format(&ext).is_some_and(|f| f.raster);
|
||||
if !app.session.prefs.edit_original_system_defaults && raster && crate::original_editor::try_open(app, path)? {
|
||||
return Ok(());
|
||||
}
|
||||
if !app.session.prefs.edit_original_system_defaults
|
||||
&& raster
|
||||
&& let Some(open) = app.services.open_in_photocraft.as_mut()
|
||||
|
||||
@@ -55,6 +55,9 @@ pub mod layout_migration;
|
||||
pub mod menus;
|
||||
pub mod native_menu;
|
||||
pub mod opening;
|
||||
mod original_editor;
|
||||
#[doc(hidden)]
|
||||
pub use original_editor::Choice as OriginalEditorChoice;
|
||||
pub mod palette;
|
||||
mod panel_docking;
|
||||
pub mod panels;
|
||||
@@ -270,6 +273,7 @@ pub struct VectorcraftApp {
|
||||
system_paste_at: f64,
|
||||
/// File dialogs shown off the UI thread and what runs again with their answers.
|
||||
pub(crate) picks: picks::Picks,
|
||||
pub(crate) original_editor: original_editor::Draft,
|
||||
/// The screen color sampler shown and not answered yet, and where its color goes.
|
||||
pub(crate) screen_sampler: Option<screen_color::Waiting>,
|
||||
/// The look for fonts installed or removed meanwhile, running
|
||||
|
||||
@@ -0,0 +1,296 @@
|
||||
//! The raster editor is selected by a person in a native picker, never by a preference command
|
||||
//! or a generic dialog field. Keep both the saved choice and the dialog's draft opaque.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{FilePick, VectorcraftApp, state::Dialog};
|
||||
|
||||
/// Opaque saved choice. Public so hosts can construct `UiState` with a struct update; its path
|
||||
/// has no public setter and is never read from the generic preference or dialog-field maps.
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||
pub struct Choice {
|
||||
path: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub(crate) struct Draft {
|
||||
choice: Choice,
|
||||
generation: u64,
|
||||
}
|
||||
|
||||
pub(crate) fn open(app: &mut VectorcraftApp) {
|
||||
app.original_editor.generation = app.original_editor.generation.wrapping_add(1);
|
||||
app.original_editor.choice = app.ui.original_editor.clone();
|
||||
}
|
||||
|
||||
pub(crate) fn commit(app: &mut VectorcraftApp) {
|
||||
app.ui.original_editor = app.original_editor.choice.clone();
|
||||
}
|
||||
|
||||
pub(crate) fn reset(app: &mut VectorcraftApp) {
|
||||
app.original_editor.choice = Choice::default();
|
||||
// Discard an outstanding pick when Reset was pressed while its dialog was open.
|
||||
app.original_editor.generation = app.original_editor.generation.wrapping_add(1);
|
||||
}
|
||||
|
||||
pub(crate) fn cancel(app: &mut VectorcraftApp) {
|
||||
open(app);
|
||||
}
|
||||
|
||||
/// A chosen app may have been removed since Preferences saved it. Only absence falls through;
|
||||
/// validation and launch failures are errors, as they are for PhotoCraft.
|
||||
pub(crate) fn try_open(app: &mut VectorcraftApp, path: &str) -> Result<bool, String> {
|
||||
let Some(editor) = app.ui.original_editor.path.as_deref() else { return Ok(false) };
|
||||
let Some(open) = app.services.open_in_application.as_mut() else { return Ok(false) };
|
||||
open(editor, path)
|
||||
}
|
||||
|
||||
fn pick(app: &mut VectorcraftApp, d: &mut Dialog) -> Result<(), String> {
|
||||
app.refuse_automation("preferences.chooseOriginalEditor")?;
|
||||
let generation = app.original_editor.generation;
|
||||
crate::picks::in_app_dialog(app, d, move |app, _| {
|
||||
if generation != app.original_editor.generation {
|
||||
return Ok(());
|
||||
}
|
||||
let filters = if cfg!(target_os = "macos") {
|
||||
vec![FilePick::filter("Applications", &["app"])]
|
||||
} else if cfg!(windows) {
|
||||
vec![FilePick::filter("Applications", &["exe"])]
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
let Some(path) = crate::picks::open(app, &FilePick { filters, ..Default::default() }) else { return Ok(()) };
|
||||
app.services.check_application.as_ref().ok_or("no application chooser here")?(&path)?;
|
||||
app.original_editor.choice.path = Some(path);
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn show(ui: &mut egui::Ui, app: &mut VectorcraftApp, d: &mut Dialog) {
|
||||
if app.services.check_application.is_none() || app.services.open_in_application.is_none() {
|
||||
return;
|
||||
}
|
||||
ui.add_enabled_ui(!d.bool("editOriginalSystemDefaults"), |ui| {
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.label(tl!("Edit Original with:"));
|
||||
let name = app.original_editor.choice.path.as_deref().and_then(|p| std::path::Path::new(p).file_name());
|
||||
ui.label(name.map(|n| n.to_string_lossy().into_owned()).unwrap_or_else(|| "PhotoCraft".into()));
|
||||
if ui.button(tl!("Choose…")).clicked()
|
||||
&& let Err(e) = pick(app, d)
|
||||
{
|
||||
app.status(e);
|
||||
}
|
||||
if app.original_editor.choice.path.is_some() && ui.button("PhotoCraft").clicked() {
|
||||
reset(app);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{
|
||||
Services,
|
||||
control::{ControlRequest, Outcome},
|
||||
prefs_dialog,
|
||||
};
|
||||
use serde_json::{Value, json};
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
|
||||
fn app() -> VectorcraftApp {
|
||||
let services = Services {
|
||||
check_application: Some(Box::new(|p| if p == "/Apps/Bad" { Err("not an application".into()) } else { Ok(()) })),
|
||||
open_in_application: Some(Box::new(|_, _| Ok(true))),
|
||||
..Default::default()
|
||||
};
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), services);
|
||||
prefs_dialog::open(&mut app, Some("File Handling"));
|
||||
app
|
||||
}
|
||||
|
||||
fn choose(app: &mut VectorcraftApp, path: Option<&str>) -> Result<(), String> {
|
||||
let path = path.map(str::to_owned);
|
||||
app.services.pick_open = Some(Box::new(move |_| path.clone()));
|
||||
let mut d = app.ui.dialog.take().unwrap();
|
||||
let r = pick(app, &mut d);
|
||||
app.ui.dialog = Some(d);
|
||||
r
|
||||
}
|
||||
|
||||
fn request(app: &mut VectorcraftApp, method: &str, params: Value) -> Value {
|
||||
let (req, _) = ControlRequest::new(method, params);
|
||||
let Outcome::Done(r) = crate::control::handle(app, &egui::Context::default(), &req) else { panic!("deferred") };
|
||||
r
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn native_choice_commits_persists_cancels_and_resets() {
|
||||
let mut app = app();
|
||||
choose(&mut app, Some("/Apps/My Editor.app")).unwrap();
|
||||
assert!(app.ui.original_editor.path.is_none(), "a draft until OK");
|
||||
prefs_dialog::confirm(&mut app).unwrap();
|
||||
let saved = serde_json::to_vec(&app.ui).unwrap();
|
||||
let restored: crate::UiState = serde_json::from_slice(&saved).unwrap();
|
||||
assert_eq!(restored.original_editor.path.as_deref(), Some("/Apps/My Editor.app"));
|
||||
assert!(app.session.prefs.to_json().get("original_editor").is_none());
|
||||
assert!(app.take_prefs_changed(), "OK asks the host to persist the choice");
|
||||
prefs_dialog::open(&mut app, Some("File Handling"));
|
||||
choose(&mut app, None).unwrap();
|
||||
assert_eq!(app.original_editor.choice.path, restored.original_editor.path);
|
||||
choose(&mut app, Some("/Apps/Other Editor.app")).unwrap();
|
||||
crate::dialogs::cancel(&mut app);
|
||||
prefs_dialog::open(&mut app, Some("File Handling"));
|
||||
assert_eq!(app.original_editor.choice.path, restored.original_editor.path);
|
||||
assert!(choose(&mut app, Some("/Apps/Bad")).is_err());
|
||||
assert_eq!(app.original_editor.choice.path, restored.original_editor.path);
|
||||
reset(&mut app);
|
||||
prefs_dialog::confirm(&mut app).unwrap();
|
||||
assert!(app.ui.original_editor.path.is_none());
|
||||
let legacy: crate::UiState = serde_json::from_str("{}").unwrap();
|
||||
assert!(legacy.original_editor.path.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn original_editor_reset_confirmation_preserves_cancel_and_defers_persistence() {
|
||||
let mut app = app();
|
||||
choose(&mut app, Some("/Apps/My Editor.app")).unwrap();
|
||||
prefs_dialog::confirm(&mut app).unwrap();
|
||||
prefs_dialog::open(&mut app, Some("File Handling"));
|
||||
crate::dialogs::confirm::ask_reset_prefs(&mut app);
|
||||
crate::dialogs::cancel(&mut app);
|
||||
assert_eq!(app.original_editor.choice.path.as_deref(), Some("/Apps/My Editor.app"));
|
||||
crate::dialogs::confirm::ask_reset_prefs(&mut app);
|
||||
crate::dialogs::confirm(&mut app).unwrap();
|
||||
assert!(app.original_editor.choice.path.is_none());
|
||||
assert_eq!(app.ui.original_editor.path.as_deref(), Some("/Apps/My Editor.app"));
|
||||
crate::dialogs::cancel(&mut app);
|
||||
prefs_dialog::open(&mut app, Some("File Handling"));
|
||||
assert_eq!(app.original_editor.choice.path.as_deref(), Some("/Apps/My Editor.app"));
|
||||
crate::dialogs::confirm::ask_reset_prefs(&mut app);
|
||||
crate::dialogs::confirm(&mut app).unwrap();
|
||||
prefs_dialog::confirm(&mut app).unwrap();
|
||||
assert!(app.ui.original_editor.path.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn original_editor_routing_and_errors() {
|
||||
let mut app = app();
|
||||
choose(&mut app, Some("/Apps/My Editor.app")).unwrap();
|
||||
prefs_dialog::confirm(&mut app).unwrap();
|
||||
let calls = Rc::new(RefCell::new(Vec::new()));
|
||||
let c = calls.clone();
|
||||
app.services.open_file = Some(Box::new(move |_| {
|
||||
c.borrow_mut().push("system");
|
||||
Ok(())
|
||||
}));
|
||||
let c = calls.clone();
|
||||
app.services.open_in_photocraft = Some(Box::new(move |_| {
|
||||
c.borrow_mut().push("photocraft");
|
||||
Ok(true)
|
||||
}));
|
||||
let c = calls.clone();
|
||||
app.services.open_in_application = Some(Box::new(move |editor, path| {
|
||||
assert_eq!(editor, "/Apps/My Editor.app");
|
||||
assert_eq!(path, "/Art/a b.png");
|
||||
c.borrow_mut().push("chosen");
|
||||
Ok(true)
|
||||
}));
|
||||
crate::io::open_original(&mut app, "/Art/a b.png").unwrap();
|
||||
app.session.prefs.edit_original_system_defaults = false;
|
||||
crate::io::open_original(&mut app, "/Art/a b.png").unwrap();
|
||||
crate::io::open_original(&mut app, "/Art/plan.emf").unwrap();
|
||||
app.services.open_in_application = Some(Box::new(|_, _| Ok(false)));
|
||||
crate::io::open_original(&mut app, "/Art/a b.png").unwrap();
|
||||
app.services.open_in_photocraft = Some(Box::new(|_| Ok(false)));
|
||||
crate::io::open_original(&mut app, "/Art/a b.png").unwrap();
|
||||
app.services.open_in_application = Some(Box::new(|_, _| Err("launch failed".into())));
|
||||
assert_eq!(crate::io::open_original(&mut app, "/Art/a b.png").unwrap_err(), "launch failed");
|
||||
assert_eq!(*calls.borrow(), ["system", "chosen", "system", "photocraft", "system"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn automation_cannot_inject_an_original_editor() {
|
||||
let mut app = app();
|
||||
for key in ["editOriginalApp", "original_editor", "__originalEditor", "__chosenApp"] {
|
||||
let r = request(&mut app, "engine.execute", json!({"command": "prefs.set", "params": {"key": key, "value": "/Apps/Bad"}}));
|
||||
assert_eq!(r["ok"], false, "{r}");
|
||||
let r = request(&mut app, "engine.execute", json!({"command": "prefs.set", "params": {"values": {key: "/Apps/Bad"}}}));
|
||||
assert_eq!(r["ok"], false, "{r}");
|
||||
// __ fields are accepted by generic dialogs, but they cannot become a trusted choice.
|
||||
let _ = request(&mut app, "ui.dialog.set", json!({"field": key, "value": "/Apps/Bad"}));
|
||||
}
|
||||
let r = request(&mut app, "engine.execute", json!({"command": "prefs.setValues", "params": {"values": {"editOriginalApp": "/Apps/Bad"}}}));
|
||||
assert_eq!(r["ok"], false, "{r}");
|
||||
let _ = request(&mut app, "ui.set", json!({"original_editor": {"path": "/Apps/Bad"}}));
|
||||
let r = request(&mut app, "ui.dialog.confirm", json!({}));
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
assert!(app.ui.original_editor.path.is_none());
|
||||
prefs_dialog::open(&mut app, Some("File Handling"));
|
||||
app.ui.answering_control = true;
|
||||
assert!(choose(&mut app, Some("/Apps/Bad")).is_err());
|
||||
app.ui.answering_control = false;
|
||||
app.synthetic_frame = true;
|
||||
assert!(choose(&mut app, Some("/Apps/Bad")).is_err());
|
||||
assert!(app.original_editor.choice.path.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn original_editor_async_picker_validates_and_commits_only_on_ok() {
|
||||
let mut app = app();
|
||||
let (tx, rx) = std::sync::mpsc::channel();
|
||||
let mut rx = Some(rx);
|
||||
app.services.start_pick = Some(Box::new(move |_| rx.take()));
|
||||
choose(&mut app, None).unwrap();
|
||||
tx.send(vec!["/Apps/Async Editor.app".into()]).unwrap();
|
||||
crate::picks::poll(&mut app, &egui::Context::default());
|
||||
assert_eq!(app.original_editor.choice.path.as_deref(), Some("/Apps/Async Editor.app"));
|
||||
assert!(app.ui.original_editor.path.is_none());
|
||||
prefs_dialog::confirm(&mut app).unwrap();
|
||||
assert_eq!(app.ui.original_editor.path.as_deref(), Some("/Apps/Async Editor.app"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn original_editor_picker_answer_does_not_survive_reopening_preferences() {
|
||||
let mut app = app();
|
||||
let (tx, rx) = std::sync::mpsc::channel();
|
||||
let mut rx = Some(rx);
|
||||
app.services.start_pick = Some(Box::new(move |_| rx.take()));
|
||||
choose(&mut app, None).unwrap();
|
||||
crate::dialogs::cancel(&mut app);
|
||||
prefs_dialog::open(&mut app, Some("File Handling"));
|
||||
tx.send(vec!["/Apps/Stale.app".into()]).unwrap();
|
||||
crate::picks::poll(&mut app, &egui::Context::default());
|
||||
assert!(app.original_editor.choice.path.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn original_editor_controls_are_desktop_only_and_draw_the_choice() {
|
||||
let mut app = app();
|
||||
let paint = |app: &mut VectorcraftApp| {
|
||||
let d = app.ui.dialog.as_mut().unwrap();
|
||||
d.fields.insert("__found".into(), json!("editOriginalSystemDefaults"));
|
||||
d.fields.insert("__scrollTo".into(), json!(true));
|
||||
let ctx = egui::Context::default();
|
||||
crate::theme::install_fonts(&ctx);
|
||||
let mut text = String::new();
|
||||
// The fixed-height Preferences list scrolls after its sizing pass.
|
||||
for frame in 0..4 {
|
||||
let input = egui::RawInput {
|
||||
time: Some(f64::from(frame)),
|
||||
screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1200.0, 1000.0))),
|
||||
..Default::default()
|
||||
};
|
||||
let mut out = ctx.run_ui(input, |ui| prefs_dialog::show(app, ui.ctx()));
|
||||
out.textures_delta.clear();
|
||||
text = crate::tests_labels::shapes_text(&out);
|
||||
}
|
||||
text
|
||||
};
|
||||
let text = paint(&mut app);
|
||||
assert!(text.contains("Edit Original with:") && text.contains("PhotoCraft"), "{text}");
|
||||
app.services.check_application = None;
|
||||
let text = paint(&mut app);
|
||||
assert!(!text.contains("Edit Original with:"), "{text}");
|
||||
}
|
||||
}
|
||||
@@ -437,6 +437,20 @@ fn edit_original_opens_raster_images_in_photocraft_without_system_defaults() {
|
||||
assert_eq!(opened.borrow().len(), 4);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn edit_original_with_chosen_editor_still_refuses_automation() {
|
||||
let dir = Folder::new("chosen-automation");
|
||||
let (mut app, linked, _) = app(&dir);
|
||||
app.ui.original_editor = serde_json::from_value(json!({"path": "/Apps/Editor.exe"})).unwrap();
|
||||
app.session.prefs.edit_original_system_defaults = false;
|
||||
app.services.open_in_application = Some(Box::new(|_, _| panic!("automation must not launch an editor")));
|
||||
app.ui.answering_control = true;
|
||||
assert!(app.run("links.editOriginal", json!({"id": linked})).unwrap_err().contains("only the person"));
|
||||
app.ui.answering_control = false;
|
||||
app.synthetic_frame = true;
|
||||
assert!(app.run("links.editOriginal", json!({"id": linked})).unwrap_err().contains("only the person"));
|
||||
}
|
||||
|
||||
/// Edit Original hands only regular image and document files to the system's default app.
|
||||
#[test]
|
||||
fn edit_original_opens_image_and_document_files_only() {
|
||||
|
||||
@@ -29,6 +29,7 @@ const RESET_UNITS: &str = "__resetUnits";
|
||||
const APP_TITLE_BAR_SHOWN: bool = cfg!(not(any(target_arch = "wasm32", target_os = "macos", target_os = "windows")));
|
||||
|
||||
pub fn open(app: &mut VectorcraftApp, category: Option<&str>) {
|
||||
crate::original_editor::open(app);
|
||||
// One field per preference key or group (the flattener presets have commands of their own).
|
||||
let mut fields: Map<String, Value> = app.session.prefs.to_json().as_object().cloned().unwrap_or_default();
|
||||
fields.retain(|k, _| vectorcraft_engine::cmd::prefscmds::spec(k).is_some() || PREF_GROUPS.contains(&k.as_str()));
|
||||
@@ -230,6 +231,7 @@ pub fn confirm(app: &mut VectorcraftApp) -> Result<Value, String> {
|
||||
app.ui.view.smart_guides = d.fields.get("__smartGuides").and_then(Value::as_bool).unwrap_or(app.ui.view.smart_guides);
|
||||
app.ui.view.snap_to_grid = d.fields.get("__snapToGrid").and_then(Value::as_bool).unwrap_or(app.ui.view.snap_to_grid);
|
||||
app.ui.task_bar = d.fields.get("__taskBar").and_then(Value::as_bool).unwrap_or(app.ui.task_bar);
|
||||
crate::original_editor::commit(app);
|
||||
app.ui.dialog = None;
|
||||
app.ui.engine_prefs = app.session.prefs.to_json();
|
||||
app.prefs_changed = true;
|
||||
@@ -468,6 +470,7 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
}
|
||||
app.ui.dialog = Some(d);
|
||||
if cancel {
|
||||
crate::original_editor::cancel(app);
|
||||
app.ui.dialog = None;
|
||||
} else if ok && let Err(e) = confirm(app) {
|
||||
app.status(e);
|
||||
@@ -657,15 +660,13 @@ fn category_fields(ui: &mut egui::Ui, app: &mut VectorcraftApp, d: &mut Dialog,
|
||||
ui.label(egui::RichText::new(note).color(t.text_dim).size(11.0));
|
||||
}
|
||||
}
|
||||
PrefKind::Bool if sp.key == "editOriginalSystemDefaults" => {
|
||||
bool_row(ui, d, sp.key, sp.label);
|
||||
crate::original_editor::show(ui, app, d);
|
||||
}
|
||||
// The desktop app only: the web build has no display profile to read. A note says
|
||||
// which profile the canvas is drawn through, or why none.
|
||||
PrefKind::Bool if sp.key == "monitorProfileDisplay" => {
|
||||
if !cfg!(target_arch = "wasm32") {
|
||||
bool_row(ui, d, sp.key, sp.label);
|
||||
let note = app.display_profile.note(d.bool(sp.key));
|
||||
ui.label(egui::RichText::new(note).color(t.text_dim).size(11.0));
|
||||
}
|
||||
}
|
||||
PrefKind::Bool if sp.key == "monitorProfileDisplay" => monitor_profile_row(ui, app, d, sp.key, sp.label, &t),
|
||||
// The desktop app only: it sets the window's present mode when it starts, so a note
|
||||
// says the change applies at the next start.
|
||||
PrefKind::Bool if sp.key == "lowLatencyDrawing" => desktop_startup_bool_row(ui, d, sp.key, sp.label, &t),
|
||||
@@ -869,6 +870,14 @@ fn choice_row(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str, opts: &
|
||||
});
|
||||
}
|
||||
|
||||
fn monitor_profile_row(ui: &mut egui::Ui, app: &VectorcraftApp, d: &mut Dialog, key: &str, label: &str, t: &theme::Tokens) {
|
||||
if !cfg!(target_arch = "wasm32") {
|
||||
bool_row(ui, d, key, label);
|
||||
let note = app.display_profile.note(d.bool(key));
|
||||
ui.label(egui::RichText::new(note).color(t.text_dim).size(11.0));
|
||||
}
|
||||
}
|
||||
|
||||
/// The row of the number preference `key` within `range`: a slider for Interface Scaling, a field
|
||||
/// shown with `unit` otherwise.
|
||||
fn num_row(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str, range: std::ops::RangeInclusive<f64>, unit: &str, v: &Value) {
|
||||
|
||||
@@ -31,6 +31,9 @@ impl FilePick {
|
||||
}
|
||||
}
|
||||
|
||||
pub type CheckApplicationFn = Box<dyn Fn(&str) -> Result<(), String>>;
|
||||
pub type OpenApplicationFn = Box<dyn FnMut(&str, &str) -> Result<bool, String>>;
|
||||
|
||||
pub type PickOpen = Box<dyn FnMut(&FilePick) -> Option<String>>;
|
||||
|
||||
pub type PickSave = Box<dyn FnMut(&FilePick) -> Option<String>>;
|
||||
@@ -166,6 +169,10 @@ pub struct Services {
|
||||
/// with Preferences › File Handling › Use System Defaults for Edit Original off); `Ok(false)`
|
||||
/// when it isn't. Without it Edit Original uses `open_file`.
|
||||
pub open_in_photocraft: Option<OpenInFn>,
|
||||
/// Validate a native-picked application before keeping it as the raster editor.
|
||||
pub check_application: Option<CheckApplicationFn>,
|
||||
/// Launch a native-picked application with one file argument; false only when absent.
|
||||
pub open_in_application: Option<OpenApplicationFn>,
|
||||
/// Show a folder picker; returns its path (desktop: Relink to Folder, Package).
|
||||
pub pick_folder: Option<Box<dyn FnMut() -> Option<String>>>,
|
||||
/// Show a folder picker that starts in a folder (a script's `selectDlg`); returns its path.
|
||||
|
||||
@@ -733,6 +733,9 @@ pub struct UiState {
|
||||
/// Engine preferences (Edit → Preferences), persisted alongside the UI state.
|
||||
#[serde(default)]
|
||||
pub engine_prefs: Value,
|
||||
/// Native-picker-only raster editor; never exposed as an engine preference or dialog field.
|
||||
#[serde(default)]
|
||||
pub original_editor: crate::OriginalEditorChoice,
|
||||
/// Color Guide panel: variation kind, steps and amount (Color Guide Options).
|
||||
#[serde(default)]
|
||||
pub color_guide: vectorcraft_color::harmony::GuideOptions,
|
||||
@@ -1296,6 +1299,7 @@ impl Default for UiState {
|
||||
recent_commands: vec![],
|
||||
favorite_fonts: vec![],
|
||||
engine_prefs: Value::Null,
|
||||
original_editor: Default::default(),
|
||||
color_guide: Default::default(),
|
||||
library_panels: vec![],
|
||||
flattener_preview: Default::default(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Control protocol
|
||||
|
||||
> **Last updated:** 2026-11-15 · **Change:** completed the `ui.resize` and `ui.focus` entries and removed a duplicate `ui.render` row; previously: text style commands take a feature with a value (`"features": ["salt=2"]`), the font's alternate number, and shape runs that differ only in features as one piece of text; previously: Confining file access refuses a `:` in a name after the drive on Windows, an NTFS alternate data stream such as `x.svg:evil` (#3604); previously: Object → Expand… dimmed while the selection has an appearance Expand Appearance expands (`object.expand.info`'s `appearance`, #3089); previously: brush library panels (`window.brushLibrary`, `window.brushLibrary.other`, `ui.saveBrushLibrary`); previously: Transform Each opens on the values it was last confirmed with; its Copy button confirms with `copy: true` (#1732); previously: panel docking on craft-ui's layout: `ui.docking`, the parameters of `window.panel.float` and `window.panel.dock`; previously: `ui.screenshot`'s 64 MiB inline-PNG cap and its path-plus-data downgrade; symbol library panels (`window.symbolLibrary`, `window.symbolLibrary.other`, `ui.saveSymbolLibrary`); synthetic input budgets (#1709); bounded transport waits (#1726).
|
||||
> **Last updated:** 2026-11-19 · **Change:** #5804 native-picked raster editor merged with main; scores and estimates unchanged; previously: completed the `ui.resize` and `ui.focus` entries and removed a duplicate `ui.render` row; previously: text style commands take a feature with a value (`"features": ["salt=2"]`), the font's alternate number, and shape runs that differ only in features as one piece of text; previously: Confining file access refuses a `:` in a name after the drive on Windows, an NTFS alternate data stream such as `x.svg:evil` (#3604); previously: Object → Expand… dimmed while the selection has an appearance Expand Appearance expands (`object.expand.info`'s `appearance`, #3089); previously: brush library panels (`window.brushLibrary`, `window.brushLibrary.other`, `ui.saveBrushLibrary`); previously: Transform Each opens on the values it was last confirmed with; its Copy button confirms with `copy: true` (#1732); previously: panel docking on craft-ui's layout: `ui.docking`, the parameters of `window.panel.float` and `window.panel.dock`; previously: `ui.screenshot`'s 64 MiB inline-PNG cap and its path-plus-data downgrade; symbol library panels (`window.symbolLibrary`, `window.symbolLibrary.other`, `ui.saveSymbolLibrary`); synthetic input budgets (#1709); bounded transport waits (#1726).
|
||||
|
||||
`vectorcraft --control <port>` listens on `127.0.0.1:<port>` (loopback only). The port must be a number
|
||||
from 1 to 65535 (`--control=<port>` works too), given once; otherwise the app prints an error and exits
|
||||
@@ -813,6 +813,8 @@ PhotoCraft, looked for only where it installs (the Applications folders on macOS
|
||||
registers under App Paths, then `ArtCraft\PhotoCraft` in the per-user and per-machine program folders, then the `PATH`;
|
||||
the `PATH` elsewhere), and any other file, or a raster image without PhotoCraft installed, in the system's default app.
|
||||
|
||||
Draft #5804 adds a local, native-picker-only raster editor override when Use System Defaults is off. Its saved choice and Preferences draft are outside engine preferences and `Dialog::fields`: `prefs.set` (including bulk values), `ui.dialog.set` and `ui.set` cannot assign it. The chooser refuses control requests and synthetic input. If the chosen application is missing, Edit Original tries PhotoCraft and then the system default; validation or launch errors are reported. The existing refusal of automated external Edit Original remains. No executable arguments or shell command are accepted.
|
||||
|
||||
Package: File → Package… (`ui.packageDialog`) opens the `package` dialog for a saved document (a document never saved
|
||||
gets a `confirm` dialog whose OK runs `file.saveAs`). Fields: `folder` (the location), `name` (the package folder),
|
||||
`copyLinks`, `linksFolder`, `relink`, `copyFonts`, `report`. `ui.dialog.confirm` saves unsaved changes (when that save
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
|
||||
## Feature submission evidence
|
||||
|
||||
Draft enhancement #5804: Preferences › File Handling can select a raster editor through the native picker, with a private draft outside engine preferences and generic dialog fields. OK saves it, Cancel discards it, and Reset restores PhotoCraft. With Use System Defaults off, a missing chosen editor falls back to PhotoCraft, then the system default; validation and launch failures are reported. Control/MCP and synthetic input cannot choose an application or run external Edit Original. Web behavior, parity scores and estimates are unchanged; macOS/Linux smoke tests remain pending.
|
||||
|
||||
**2026-11-19 revision:** merged main while preserving the private raster-editor choice; no parity rescore.
|
||||
|
||||
> **Eraser fill update (2026-11-11):** filled open paths without a visible painted stroke retain fill outside the sweep or Alt-drag marquee (#6582); stroked paths retain main behavior; scores and estimates unchanged.
|
||||
|
||||
**Feature evidence last updated:** 2026-11-15.
|
||||
|
||||
@@ -9240,6 +9240,8 @@ the panel, in the order `links.list` gives them; the panel menu passes the selec
|
||||
them. An embedded image gives the name its row shows. An id that is not an image or a placed document, a
|
||||
malformed `ids`, or nothing to copy is an error, and the clipboard is left as it was.
|
||||
|
||||
Draft #5804 adds a local, native-picker-only raster editor override when Use System Defaults is off. Its saved choice and Preferences draft are outside engine preferences and `Dialog::fields`: `prefs.set` (including bulk values), `ui.dialog.set` and `ui.set` cannot assign it. The chooser refuses control requests and synthetic input. If the chosen application is missing, Edit Original tries PhotoCraft and then the system default; validation or launch errors are reported. The existing refusal of automated external Edit Original remains. No executable arguments or shell command are accepted.
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"links.list","params":{"show":"missing"}}}
|
||||
{"name":"run_command","arguments":{"command":"links.placementOptions","params":{"ids":[12],"preserve":"fit","align":"top"}}}
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
|
||||
## Feature submission evidence
|
||||
|
||||
Draft enhancement #5804: Preferences › File Handling can select a raster editor through the native picker, with a private draft outside engine preferences and generic dialog fields. OK saves it, Cancel discards it, and Reset restores PhotoCraft. With Use System Defaults off, a missing chosen editor falls back to PhotoCraft, then the system default; validation and launch failures are reported. Control/MCP and synthetic input cannot choose an application or run external Edit Original. Web behavior, parity scores and estimates are unchanged; macOS/Linux smoke tests remain pending.
|
||||
|
||||
**2026-11-19 revision:** merged main while preserving the private raster-editor choice; no parity rescore.
|
||||
|
||||
M4: Explicitly requested editing data keeps a single artboard larger than its 14,400 pt capped PDF page (#6865). Scores and estimates unchanged.
|
||||
|
||||
Numeric fields step on wheel hover without taking keyboard focus (#5949). Arrow keys still require focus; modifiers, units, limits, mixed values and existing rounding stay in the shared stepping path. Headless regressions in `tests/numfields.rs` cover hovered unfocused fields, focused fields, trackpad accumulation and panel scroll exclusion. Scores and estimates unchanged.
|
||||
|
||||
@@ -305,7 +305,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de
|
||||
| Print, colour management, separations, flattener | 3 | 80% | Production Preflight available; print preview fidelity remains | 2–4 | estimated |
|
||||
| Automation (Actions, Variables, scripting, batch) | 3 | 60% | a scripting surface (Illustrator: JavaScript/ExtendScript), Batch, image and graph variables, dataset import/export | 8–14 | estimated; MCP `add_text` exposes existing vertical type; score and hours unchanged |
|
||||
| UI chrome (panels, Properties, workspaces, preferences) | 6 | 80% | Properties per context, 2 Preferences options stored but unused (#394, audited 2026-10-30: Scratch Disks, legacy vector clipboard), context menus in the panels that have none, accessibility | 13–20 | estimated; floating panels in OS windows of their own on the desktop (#4135), score and hours unchanged; macOS save Format menu implemented (#866), score and hours unchanged; Eyedropper cursor and precise setting checked (#1269), OS visual QA unverified; the line under the Preferences fields describes each General, Selection & Anchor Display, Guides & Grid, Smart Guides and Slices setting on hover and keyboard focus (#8199, #8223, #8248, #8264, #8360), score and hours unchanged; numeric-field focus and normal text drags regression-tested (#1326); a focus click released more than 1 pt from its press keeps the caret and a tap within 1 pt selects all (#6659); artboard navigation synchronizes the tool selection before destructive actions; status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates (sample widths cached by language/unit/DPI; regression and contributor original-file evidence below; scores/hours unchanged); effect dialogs' colour fields show a swatch that opens the Color Picker (#5365), score and hours unchanged; icon-strip flyouts retain user sizes (#5713); floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), scores and hours unchanged ; interim macOS cursor delivery (#2292), headless coverage only; native validation pending, score and hours unchanged; Swatches item context menus have focused regressions and rendered-layout evidence below; scores and estimates unchanged |
|
||||
| Libraries, Links, Package | 2 | 82% | shared libraries, linked graphics, gradients and patterns as library items (no cloud by design) | 2–3 | estimated |
|
||||
| Libraries, Links, Package | 2 | 82% | shared libraries, linked graphics, gradients and patterns as library items (no cloud by design) | 2–3 | estimated; #5804: private native-picked raster editor (scores unchanged) |
|
||||
| Generative AI (Text to Vector, Generative Recolor, Shape Fill, Concept to Vector, Prompt to Edit, Rewrite Text) | 2 | 0% | a pluggable provider and the panels; needs an owner decision on models | 30–60 | measured (absent) |
|
||||
| **Feature depth** | **105** | **~75%** | | **~250–420** | |
|
||||
| Interaction-fidelity pass (every tool's modifiers, cursors, Properties per context) | | | [ui-parity.md](ui-parity.md) | 60–90 | estimated |
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
|
||||
## Feature submission evidence
|
||||
|
||||
Draft enhancement #5804: Preferences › File Handling can select a raster editor through the native picker, with a private draft outside engine preferences and generic dialog fields. OK saves it, Cancel discards it, and Reset restores PhotoCraft. With Use System Defaults off, a missing chosen editor falls back to PhotoCraft, then the system default; validation and launch failures are reported. Control/MCP and synthetic input cannot choose an application or run external Edit Original. Web behavior, parity scores and estimates are unchanged; macOS/Linux smoke tests remain pending.
|
||||
|
||||
**2026-11-09 revision:** draft implementation and regression coverage for #5804; no parity rescore.
|
||||
|
||||
Numeric fields step on wheel hover without taking keyboard focus (#5949). Arrow keys still require focus; modifiers, units, limits, mixed values and existing rounding stay in the shared stepping path. Headless regressions in `tests/numfields.rs` cover hovered unfocused fields, focused fields, trackpad accumulation and panel scroll exclusion. Scores and estimates unchanged.
|
||||
|
||||
A flare keeps its settings through transforms and saves. With a flare selected, double-clicking the Flare tool opens Flare Tool Options filled from it, and OK draws it again in its place as one undo step (`shape.editFlare`; none when nothing changed); the Flare tool shows the selected flare's center and end handles, and dragging either changes its length or direction; Object › Expand turns it into plain objects ([Draw and edit flares](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/draw-and-edit-flares.html)). Regressions: `edit_flare_draws_a_transformed_flare_again_in_its_place_in_one_undo_step`, `dragging_a_selected_flares_handles_changes_its_length_and_direction` and `with_a_flare_selected_the_options_show_its_settings_and_ok_draws_it_again`. Scores and estimates unchanged.
|
||||
|
||||
Reference in New Issue
Block a user