From 82a50dad1b2dca0a2fd64c4332c59a901af987e7 Mon Sep 17 00:00:00 2001 From: justinjohn0306 Date: Mon, 19 Oct 2026 17:53:24 +0530 Subject: [PATCH] M7: a preference to start on the Home screen (#857) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Launching opens a new empty file, which then has to be closed to get back to Home. Preferences ▸ "Start on the Home screen" (`pref.startOnHome {on?}`, off by default) starts the desktop app on Home instead. Files named on the command line and recovered files still open. Co-Authored-By: Claude Opus 5.5 --- apps/figcraft/src/main.rs | 4 ++-- crates/engine/src/cmd/view.rs | 1 + crates/engine/src/lib.rs | 3 +++ crates/ui-egui/locales/de.toml | 2 ++ crates/ui-egui/locales/en.toml | 1 + crates/ui-egui/locales/es.toml | 2 ++ crates/ui-egui/locales/fi.toml | 2 ++ crates/ui-egui/locales/fr.toml | 2 ++ crates/ui-egui/locales/ja.toml | 2 ++ crates/ui-egui/locales/ko.toml | 2 ++ crates/ui-egui/locales/nl.toml | 2 ++ crates/ui-egui/locales/pt-BR.toml | 2 ++ crates/ui-egui/locales/sv.toml | 2 ++ crates/ui-egui/locales/zh-Hans.toml | 2 ++ crates/ui-egui/src/dialogs.rs | 3 +++ docs/mcp.md | 2 ++ 16 files changed, 32 insertions(+), 2 deletions(-) diff --git a/apps/figcraft/src/main.rs b/apps/figcraft/src/main.rs index 1bba81e8..e98f9373 100644 --- a/apps/figcraft/src/main.rs +++ b/apps/figcraft/src/main.rs @@ -194,9 +194,9 @@ fn main() -> eframe::Result { session.live.links = figcraft_collab_net::links::system(); session.invite_links_startup(); // A first run (no settings kept yet, nothing to open) starts on the home screen, with its - // tips and templates; later runs start in a new file. + // tips and templates; later runs start in a new file unless the preference says Home. let first_run = svc.prefs.is_none() && args.join.is_none(); - if session.docs.is_empty() && !first_run { + if session.docs.is_empty() && !first_run && !session.prefs.start_on_home { let _ = session.execute("file.new", &json!({})); } // The interface language from the first frame on, and for the message when the window can't diff --git a/crates/engine/src/cmd/view.rs b/crates/engine/src/cmd/view.rs index 69b938e9..bdf67339 100644 --- a/crates/engine/src/cmd/view.rs +++ b/crates/engine/src/cmd/view.rs @@ -371,6 +371,7 @@ pub fn specs() -> Vec { spec!("pref.numberKeysOpacity", "Use number keys for opacity", "{on?}", false, |s, p| pref(s, p, |x| &mut x.number_keys_opacity)), spec!("pref.reduceMotion", "Reduce motion", "{on?}", false, |s, p| pref(s, p, |x| &mut x.reduce_motion)), spec!("pref.autoSave", "Save files automatically", "{on?}", false, |s, p| pref(s, p, |x| &mut x.auto_save)), + spec!("pref.startOnHome", "Start on the Home screen", "{on?}", false, |s, p| pref(s, p, |x| &mut x.start_on_home)), spec!("pref.nudge", "Nudge amount", "{small?, big?}", false, |s, p| { s.prefs.nudge_small = num(p, "small").unwrap_or(s.prefs.nudge_small).clamp(0.01, 1000.0); s.prefs.nudge_big = num(p, "big").unwrap_or(s.prefs.nudge_big).clamp(0.01, 10000.0); diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 312c2e87..4653253f 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -633,6 +633,8 @@ pub struct Prefs { /// Files that have a path are saved by themselves a few seconds after they change (the app's /// timer; off: only File ▸ Save writes them). pub auto_save: bool, + /// The desktop app starts on the Home screen instead of in a new file. + pub start_on_home: bool, /// `figcraft://` invite links open this app (`collab.registerLinks`); `None`: on for installed /// builds, off for development builds. pub invite_links: Option, @@ -699,6 +701,7 @@ impl Default for Prefs { user_name: cmd::comment::DEFAULT_AUTHOR.into(), reduce_motion: false, auto_save: false, + start_on_home: false, invite_links: None, plugins: Vec::new(), plugin_settings: BTreeMap::new(), diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 07669c1a..c5d7dc7e 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1102,6 +1102,7 @@ status = "draft — needs native review" "Save as" = "Speichern unter" "Save as preset…" = "Als Vorgabe speichern…" "Save files automatically" = "Dateien automatisch speichern" +"Start on the Home screen" = "Mit Start beginnen" "Save version {key}" = "Version speichern {key}" "Saved" = "Gespeichert" "Saved {name}" = "{name} gespeichert" @@ -1923,6 +1924,7 @@ status = "draft — needs native review" "plugins.manage" = "Plugins verwalten…" "plugins.runLast" = "Letztes Plugin ausführen" "pref.autoSave" = "Dateien automatisch speichern" +"pref.startOnHome" = "Mit Start beginnen" "pref.highlightHover" = "Ebenen beim Überfahren hervorheben" "pref.keepTool" = "Werkzeug nach Verwendung ausgewählt lassen" "pref.language" = "Sprache der Benutzeroberfläche" diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 17f6b4c5..26f10def 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1298,6 +1298,7 @@ name = "English" "Start from a blank canvas" = "Start from a blank canvas" "Start from a template" = "Start from a template" "Start on path" = "Start on path" +"Start on the Home screen" = "Start on the Home screen" "Start point" = "Start point" "Start sharing" = "Start sharing" "Start sharing with the Share button, then pass on the code it gives" = "Start sharing with the Share button, then pass on the code it gives" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index d054e222..1a73816e 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1155,6 +1155,7 @@ status = "draft — needs native review" "Run" = "Ejecutar" "Run {label}" = "Ejecutar {label}" "Save files automatically" = "Guardar archivos automáticamente" +"Start on the Home screen" = "Empezar en Inicio" "Search templates" = "Buscar plantillas" "See all templates" = "Ver todas las plantillas" "Select layers and they space themselves as their content changes" = "Selecciona capas y se espaciarán solas cuando cambie su contenido" @@ -2023,6 +2024,7 @@ status = "draft — needs native review" "plugins.manage" = "Gestionar plugins…" "plugins.runLast" = "Ejecutar el último plugin" "pref.autoSave" = "Guardar archivos automáticamente" +"pref.startOnHome" = "Empezar en Inicio" "pref.highlightHover" = "Resaltar capas al pasar el cursor" "pref.keepTool" = "Mantener la herramienta tras usarla" "pref.language" = "Idioma de la interfaz" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 602574d7..6a47a8f2 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -1162,6 +1162,7 @@ status = "draft — needs native review" "Save as" = "Tallenna nimellä" "Save as preset…" = "Tallenna esiasetuksena…" "Save files automatically" = "Tallenna tiedostot automaattisesti" +"Start on the Home screen" = "Aloita Aloitus-näkymästä" "Save version {key}" = "Tallenna versio {key}" "Saved" = "Tallennettu" "Saved {name}" = "Tallennettu: {name}" @@ -2024,6 +2025,7 @@ status = "draft — needs native review" "plugins.manage" = "Hallitse liitännäisiä…" "plugins.runLast" = "Suorita viimeisin liitännäinen" "pref.autoSave" = "Tallenna tiedostot automaattisesti" +"pref.startOnHome" = "Aloita Aloitus-näkymästä" "pref.highlightHover" = "Korosta tasot osoitettaessa" "pref.keepTool" = "Pidä työkalu valittuna käytön jälkeen" "pref.language" = "Käyttöliittymän kieli" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index 5edf1a62..947281a2 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1157,6 +1157,7 @@ status = "draft — needs native review" "Save as" = "Enregistrer sous" "Save as preset…" = "Enregistrer comme préréglage…" "Save files automatically" = "Enregistrer les fichiers automatiquement" +"Start on the Home screen" = "Démarrer sur l’Accueil" "Save version {key}" = "Enregistrer une version {key}" "Saved" = "Enregistré" "Saved {name}" = "{name} enregistré" @@ -2012,6 +2013,7 @@ status = "draft — needs native review" "plugins.manage" = "Gérer les plugins…" "plugins.runLast" = "Exécuter le dernier plugin" "pref.autoSave" = "Enregistrer les fichiers automatiquement" +"pref.startOnHome" = "Démarrer sur l’Accueil" "pref.highlightHover" = "Mettre en évidence les calques au survol" "pref.keepTool" = "Garder l’outil sélectionné après usage" "pref.language" = "Langue de l’interface" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index def8ebc4..ed71e671 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -1146,6 +1146,7 @@ status = "draft — needs native review" "Save as" = "名前を付けて保存" "Save as preset…" = "プリセットとして保存…" "Save files automatically" = "ファイルを自動保存" +"Start on the Home screen" = "起動時にホームを表示" "Save version {key}" = "バージョンを保存 {key}" "Saved" = "保存済み" "Saved {name}" = "{name} を保存済み" @@ -1996,6 +1997,7 @@ status = "draft — needs native review" "plugins.manage" = "プラグインを管理…" "plugins.runLast" = "最後のプラグインを実行" "pref.autoSave" = "ファイルを自動保存" +"pref.startOnHome" = "起動時にホームを表示" "pref.highlightHover" = "ホバー時にレイヤーをハイライト" "pref.keepTool" = "使用後もツールを選択したままにする" "pref.language" = "インターフェースの言語" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index 3e191623..43c9a22e 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1096,6 +1096,7 @@ status = "draft — needs native review" "Save as" = "다른 이름으로 저장" "Save as preset…" = "프리셋으로 저장…" "Save files automatically" = "파일 자동 저장" +"Start on the Home screen" = "홈에서 시작" "Save version {key}" = "버전 저장 {key}" "Saved" = "저장됨" "Saved {name}" = "{name} 저장됨" @@ -1914,6 +1915,7 @@ status = "draft — needs native review" "plugins.manage" = "플러그인 관리…" "plugins.runLast" = "마지막 플러그인 실행" "pref.autoSave" = "파일 자동 저장" +"pref.startOnHome" = "홈에서 시작" "pref.highlightHover" = "마우스를 올리면 레이어 강조" "pref.keepTool" = "사용 후에도 도구 선택 유지" "pref.language" = "인터페이스 언어" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index 8d8cac68..0e28ad9c 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -1162,6 +1162,7 @@ status = "draft — needs native review" "Save as" = "Opslaan als" "Save as preset…" = "Opslaan als preset…" "Save files automatically" = "Bestanden automatisch opslaan" +"Start on the Home screen" = "Starten op Home" "Save version {key}" = "Versie opslaan {key}" "Saved" = "Opgeslagen" "Saved {name}" = "{name} opgeslagen" @@ -2023,6 +2024,7 @@ status = "draft — needs native review" "plugins.manage" = "Plugins beheren…" "plugins.runLast" = "Laatste plugin uitvoeren" "pref.autoSave" = "Bestanden automatisch opslaan" +"pref.startOnHome" = "Starten op Home" "pref.highlightHover" = "Lagen markeren bij aanwijzen" "pref.keepTool" = "Gereedschap geselecteerd houden na gebruik" "pref.language" = "Interfacetaal" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index d970db14..625599f7 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1095,6 +1095,7 @@ status = "draft — needs native review" "Save as" = "Salvar como" "Save as preset…" = "Salvar como predefinição…" "Save files automatically" = "Salvar arquivos automaticamente" +"Start on the Home screen" = "Começar no Início" "Save version {key}" = "Salvar versão {key}" "Saved" = "Salvo" "Saved {name}" = "{name} salvo" @@ -1913,6 +1914,7 @@ status = "draft — needs native review" "plugins.manage" = "Gerenciar plugins…" "plugins.runLast" = "Executar o último plugin" "pref.autoSave" = "Salvar arquivos automaticamente" +"pref.startOnHome" = "Começar no Início" "pref.highlightHover" = "Destacar camadas ao passar o cursor" "pref.keepTool" = "Manter a ferramenta selecionada após o uso" "pref.language" = "Idioma da interface" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index d57bb25a..3593e2cd 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -1144,6 +1144,7 @@ name = "Svenska" "Run" = "Kör" "Run {label}" = "Kör {label}" "Save files automatically" = "Spara filer automatiskt" +"Start on the Home screen" = "Börja på Start" "Search templates" = "Sök mallar" "See all templates" = "Se alla mallar" "Select layers and they space themselves as their content changes" = "Markera lager så fördelar de avståndet själva när innehållet ändras" @@ -2004,6 +2005,7 @@ name = "Svenska" "plugins.manage" = "Hantera plugin-program…" "plugins.runLast" = "Kör senaste plugin" "pref.autoSave" = "Spara filer automatiskt" +"pref.startOnHome" = "Börja på Start" "pref.highlightHover" = "Framhäv lager vid hovring" "pref.keepTool" = "Behåll verktyget markerat efter användning" "pref.language" = "Gränssnittsspråk" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index a90c1c03..e4a52a68 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -1097,6 +1097,7 @@ status = "draft — needs native review" "Save as" = "另存为" "Save as preset…" = "存储为预设…" "Save files automatically" = "自动保存文件" +"Start on the Home screen" = "启动时显示主页" "Save version {key}" = "保存版本 {key}" "Saved" = "已保存" "Saved {name}" = "已保存 {name}" @@ -1915,6 +1916,7 @@ status = "draft — needs native review" "plugins.manage" = "管理插件…" "plugins.runLast" = "运行上一个插件" "pref.autoSave" = "自动保存文件" +"pref.startOnHome" = "启动时显示主页" "pref.highlightHover" = "悬停时高亮图层" "pref.keepTool" = "使用后保持工具选中" "pref.language" = "界面语言" diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 448501ab..5b1888a0 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -223,6 +223,9 @@ pub fn show(app: &mut FigApp, ctx: &Context) { if !cfg!(target_arch = "wasm32") && crate::widgets::checkbox(ui, prefs.auto_save, tr("Save files automatically")) { toggles.push("pref.autoSave"); } + if !cfg!(target_arch = "wasm32") && crate::widgets::checkbox(ui, prefs.start_on_home, tr("Start on the Home screen")) { + toggles.push("pref.startOnHome"); + } for c in toggles { app.run(c, json!({})); } diff --git a/docs/mcp.md b/docs/mcp.md index c5ffe99f..90cc75f5 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -419,6 +419,8 @@ on; `key` resolves keys the way the canvas does. Commands behind keys: accessibility setting turns it on too). Prototype transitions still play. - `pref.autoSave {on?}`: files that have a path save themselves a few seconds after they change (off by default; the desktop app's timer does it, so scripts still call `file.save`). +- `pref.startOnHome {on?}`: the desktop app starts on the Home screen instead of in a new file + (off by default; files named on the command line still open). - `pref.language {language: system|en|cs|ru|es|es-419|fr|de|pt-BR|ja|ko|zh-Hans|…}`: the app's interface language, applied live ("system": - `pref.language {language: system|en|es|es-419|fr|de|pt-BR|ja|ko|sv|zh-Hans|…}`: the app's interface language, applied live ("system": the OS or browser language; a language without a catalog shows English). Command ids, labels and