M7: a preference to start on the Home screen (#857)

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 <noreply@anthropic.com>
This commit is contained in:
justinjohn0306
2026-10-19 17:53:24 +05:30
co-authored by Claude Opus 5.5
parent a0d1162976
commit 82a50dad1b
16 changed files with 32 additions and 2 deletions
+2 -2
View File
@@ -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
+1
View File
@@ -371,6 +371,7 @@ pub fn specs() -> Vec<CommandSpec> {
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);
+3
View File
@@ -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<bool>,
@@ -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(),
+2
View File
@@ -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"
+1
View File
@@ -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"
+2
View File
@@ -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"
+2
View File
@@ -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"
+2
View File
@@ -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"
+2
View File
@@ -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" = "インターフェースの言語"
+2
View File
@@ -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" = "인터페이스 언어"
+2
View File
@@ -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"
+2
View File
@@ -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"
+2
View File
@@ -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"
+2
View File
@@ -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" = "界面语言"
+3
View File
@@ -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!({}));
}
+2
View File
@@ -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