From 4bd51106e819a8c61b99d70da450d1c0a7c64e94 Mon Sep 17 00:00:00 2001 From: cdricms <36056008+cdricms@users.noreply.github.com> Date: Fri, 24 Jul 2026 14:41:37 +0200 Subject: [PATCH] feat(apple): cover the window while the core boots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The core initializes asynchronously at launch, so for a moment the transfer lists look empty and the app feels stalled. Show a full-window overlay (centered spinner + "Starting…") as the top layer of the root stack while coreState.isInitialized is false; it fades out once the core is ready. --- apple/VniDrop/App/RootView.swift | 34 +++++++++++++++++++ localization/strings.json | 14 ++++++++ .../composeResources/values-de/strings.xml | 1 + .../composeResources/values-es/strings.xml | 1 + .../composeResources/values-fr/strings.xml | 1 + .../composeResources/values-it/strings.xml | 1 + .../composeResources/values-nl/strings.xml | 1 + .../composeResources/values-pl/strings.xml | 1 + .../composeResources/values-pt/strings.xml | 1 + .../composeResources/values-ru/strings.xml | 1 + .../composeResources/values/strings.xml | 1 + 11 files changed, 57 insertions(+) diff --git a/apple/VniDrop/App/RootView.swift b/apple/VniDrop/App/RootView.swift index 7abbc96..4954e07 100644 --- a/apple/VniDrop/App/RootView.swift +++ b/apple/VniDrop/App/RootView.swift @@ -63,6 +63,14 @@ struct RootView: View { onRefuse: approvals.refuse ) } + .overlay { + // A small, unobtrusive indicator while the core finishes its async + // startup — otherwise the lists look empty and the app feels stalled. + if !sendModel.coreState.isInitialized { + CoreStartingOverlay() + } + } + .animation(.easeInOut(duration: 0.25), value: sendModel.coreState.isInitialized) .vniDropTheme(isDark: isDark) .preferredColorScheme(appModel.themeMode.preferredColorScheme) .environment(\.vniColors, isDark ? .dark : .light) @@ -183,6 +191,32 @@ struct RootView: View { } } +/// A full-window cover with a centered spinner shown while the core is starting. +private struct CoreStartingOverlay: View { + var body: some View { + ZStack { + backgroundColor.ignoresSafeArea() + VStack(spacing: 16) { + ProgressView().controlSize(.large) + Text(String(localized: L10n.App.starting)) + .font(.headline) + .foregroundStyle(.secondary) + } + } + .transition(.opacity) + .accessibilityElement(children: .combine) + .accessibilityLabel(Text(String(localized: L10n.App.starting))) + } + + private var backgroundColor: Color { + #if os(iOS) + Color(uiColor: .systemBackground) + #else + Color(nsColor: .windowBackgroundColor) + #endif + } +} + #if os(iOS) import UIKit #else diff --git a/localization/strings.json b/localization/strings.json index 4c826e4..4a59818 100644 --- a/localization/strings.json +++ b/localization/strings.json @@ -321,6 +321,20 @@ "ru": "О приложении" } }, + "app_starting": { + "context": "Shown briefly at launch while the core is still starting up.", + "translations": { + "en": "Starting…", + "fr": "Démarrage…", + "es": "Iniciando…", + "it": "Avvio…", + "de": "Wird gestartet…", + "pt": "A iniciar…", + "pl": "Uruchamianie…", + "nl": "Bezig met starten…", + "ru": "Запуск…" + } + }, "appearance_auto_description": { "context": "Settings > Appearance: description for the System/auto option.", "translations": { diff --git a/shared/src/commonMain/composeResources/values-de/strings.xml b/shared/src/commonMain/composeResources/values-de/strings.xml index 32660c6..315627c 100644 --- a/shared/src/commonMain/composeResources/values-de/strings.xml +++ b/shared/src/commonMain/composeResources/values-de/strings.xml @@ -22,6 +22,7 @@ Datenschutz & Sicherheit Senden Sie Dateien direkt. Behalten Sie die Kontrolle darüber, wer sie empfängt. Über + Wird gestartet… Der hellen oder dunklen Darstellung dieses Geräts folgen. Dunkelmodus Hellmodus diff --git a/shared/src/commonMain/composeResources/values-es/strings.xml b/shared/src/commonMain/composeResources/values-es/strings.xml index 551f8e1..130422a 100644 --- a/shared/src/commonMain/composeResources/values-es/strings.xml +++ b/shared/src/commonMain/composeResources/values-es/strings.xml @@ -22,6 +22,7 @@ Privacidad y seguridad Envíe archivos directamente. Mantenga el control de quién los recibe. Acerca de + Iniciando… Seguir la apariencia clara u oscura de este dispositivo. Modo oscuro Modo claro diff --git a/shared/src/commonMain/composeResources/values-fr/strings.xml b/shared/src/commonMain/composeResources/values-fr/strings.xml index 0e86280..ce9eb80 100644 --- a/shared/src/commonMain/composeResources/values-fr/strings.xml +++ b/shared/src/commonMain/composeResources/values-fr/strings.xml @@ -22,6 +22,7 @@ Confidentialité et sécurité Envoyez des fichiers directement. Gardez le contrôle de qui les reçoit. À propos + Démarrage… Suivre l’apparence claire ou sombre de cet appareil. Mode sombre Mode clair diff --git a/shared/src/commonMain/composeResources/values-it/strings.xml b/shared/src/commonMain/composeResources/values-it/strings.xml index 4394347..03645d8 100644 --- a/shared/src/commonMain/composeResources/values-it/strings.xml +++ b/shared/src/commonMain/composeResources/values-it/strings.xml @@ -22,6 +22,7 @@ Privacy e sicurezza Invii file direttamente. Mantenga il controllo su chi li riceve. Informazioni + Avvio… Segue l’aspetto chiaro o scuro di questo dispositivo. Modalità scura Modalità chiara diff --git a/shared/src/commonMain/composeResources/values-nl/strings.xml b/shared/src/commonMain/composeResources/values-nl/strings.xml index 58930d7..4674cec 100644 --- a/shared/src/commonMain/composeResources/values-nl/strings.xml +++ b/shared/src/commonMain/composeResources/values-nl/strings.xml @@ -22,6 +22,7 @@ Privacy en beveiliging Verstuur bestanden rechtstreeks. Houd controle over wie ze ontvangt. Over + Bezig met starten… De lichte of donkere weergave van dit apparaat volgen. Donkere modus Lichte modus diff --git a/shared/src/commonMain/composeResources/values-pl/strings.xml b/shared/src/commonMain/composeResources/values-pl/strings.xml index 391b3e4..237dabe 100644 --- a/shared/src/commonMain/composeResources/values-pl/strings.xml +++ b/shared/src/commonMain/composeResources/values-pl/strings.xml @@ -22,6 +22,7 @@ Prywatność i bezpieczeństwo Wysyłaj pliki bezpośrednio. Zachowaj kontrolę nad tym, kto je otrzymuje. Informacje + Uruchamianie… Dopasuj do jasnego lub ciemnego wyglądu tego urządzenia. Tryb ciemny Tryb jasny diff --git a/shared/src/commonMain/composeResources/values-pt/strings.xml b/shared/src/commonMain/composeResources/values-pt/strings.xml index 54a990d..b95839c 100644 --- a/shared/src/commonMain/composeResources/values-pt/strings.xml +++ b/shared/src/commonMain/composeResources/values-pt/strings.xml @@ -22,6 +22,7 @@ Privacidade e segurança Envie ficheiros diretamente. Mantenha o controlo sobre quem os recebe. Acerca de + A iniciar… Acompanhar o aspeto claro ou escuro deste dispositivo. Modo escuro Modo claro diff --git a/shared/src/commonMain/composeResources/values-ru/strings.xml b/shared/src/commonMain/composeResources/values-ru/strings.xml index 8c9ed33..8eb0899 100644 --- a/shared/src/commonMain/composeResources/values-ru/strings.xml +++ b/shared/src/commonMain/composeResources/values-ru/strings.xml @@ -22,6 +22,7 @@ Конфиденциальность и безопасность Отправляйте файлы напрямую. Сохраняйте контроль над тем, кто их получает. О приложении + Запуск… Следовать светлому или тёмному оформлению этого устройства. Тёмный режим Светлый режим diff --git a/shared/src/commonMain/composeResources/values/strings.xml b/shared/src/commonMain/composeResources/values/strings.xml index 4dc463a..f8c1232 100644 --- a/shared/src/commonMain/composeResources/values/strings.xml +++ b/shared/src/commonMain/composeResources/values/strings.xml @@ -22,6 +22,7 @@ Privacy & security Send files directly. Stay in control of who receives them. About + Starting… Match this device’s light or dark appearance. Dark mode Light mode