From 494c6e2517bbe4ef85f7060ec2694d456faf5c74 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Fri, 24 Apr 2026 16:44:53 +0200 Subject: [PATCH] feat(frontend): launchpad with toolbar even for new user --- .../modules/launchpad/Launchpad.svelte | 70 ++++++------------- .../launchpad/LaunchpadFirstSatellite.svelte | 37 +++++----- .../modules/launchpad/LaunchpadGuard.svelte | 53 ++++++++++++++ .../launchpad/LaunchpadSegments.svelte | 15 ++-- src/frontend/src/lib/i18n/en.json | 4 +- src/frontend/src/lib/i18n/zh-cn.json | 4 +- 6 files changed, 106 insertions(+), 77 deletions(-) create mode 100644 src/frontend/src/lib/components/modules/launchpad/LaunchpadGuard.svelte diff --git a/src/frontend/src/lib/components/modules/launchpad/Launchpad.svelte b/src/frontend/src/lib/components/modules/launchpad/Launchpad.svelte index 5a456a4646..a6c9a9f790 100644 --- a/src/frontend/src/lib/components/modules/launchpad/Launchpad.svelte +++ b/src/frontend/src/lib/components/modules/launchpad/Launchpad.svelte @@ -1,52 +1,37 @@ -{#if loading || ($satellites?.length ?? 0n) === 0} - {#if loading} -
- - {#snippet icon()} - - {/snippet} + +
+ + + -

{$i18n.launchpad.loading_launchpad}

- -
- {:else} -
- -
- {/if} -{:else if ($satellites?.length ?? 0) >= 1} -
- +
-{/if} + diff --git a/src/frontend/src/lib/components/modules/launchpad/LaunchpadFirstSatellite.svelte b/src/frontend/src/lib/components/modules/launchpad/LaunchpadFirstSatellite.svelte index 62b90b846e..2953476092 100644 --- a/src/frontend/src/lib/components/modules/launchpad/LaunchpadFirstSatellite.svelte +++ b/src/frontend/src/lib/components/modules/launchpad/LaunchpadFirstSatellite.svelte @@ -1,14 +1,13 @@ - - - -
- + +
+

{$i18n.satellites.launch_first}

@@ -48,14 +39,24 @@ gap: var(--padding-4x); height: 100%; + + &.row { + justify-content: flex-end; + flex-direction: row; + gap: var(--padding-3x); + } + + &:not(.row) { + p { + max-width: 150px; + text-align: center; + } + } } p { @include fonts.bold(true); - max-width: 150px; - text-align: center; - margin: 0; } diff --git a/src/frontend/src/lib/components/modules/launchpad/LaunchpadGuard.svelte b/src/frontend/src/lib/components/modules/launchpad/LaunchpadGuard.svelte new file mode 100644 index 0000000000..31048edf5f --- /dev/null +++ b/src/frontend/src/lib/components/modules/launchpad/LaunchpadGuard.svelte @@ -0,0 +1,53 @@ + + +{#if loading} +
+ + {#snippet icon()} + + {/snippet} + +

{$i18n.launchpad.loading_launchpad}

+
+
+{:else if nonNullish($satellites)} +
+ {@render children()} +
+{/if} + + diff --git a/src/frontend/src/lib/components/modules/launchpad/LaunchpadSegments.svelte b/src/frontend/src/lib/components/modules/launchpad/LaunchpadSegments.svelte index 62a47bac13..09bbb2ae61 100644 --- a/src/frontend/src/lib/components/modules/launchpad/LaunchpadSegments.svelte +++ b/src/frontend/src/lib/components/modules/launchpad/LaunchpadSegments.svelte @@ -1,16 +1,19 @@ - - - +{#if (satellites?.length ?? 0n) === 0} + +{/if} diff --git a/src/frontend/src/lib/i18n/en.json b/src/frontend/src/lib/i18n/en.json index e2ddf21eb6..ff449cf999 100644 --- a/src/frontend/src/lib/i18n/en.json +++ b/src/frontend/src/lib/i18n/en.json @@ -324,7 +324,7 @@ }, "satellites": { "title": "Satellites", - "launch": "Launch a new Satellite", + "launch": "Launch a Satellite", "launch_first": "Launch your first Satellite", "search": "Search", "satellite": "Satellite", @@ -1184,7 +1184,7 @@ "create_ufo_price": "Starting a UFO requires {0}.", "ufo_name": "UFO name", "enter_name": "Enter a name for your UFO", - "create": "Create UFO", + "create": "Spin up a UFO", "ready": "Your UFO is ready!", "overview": "Overview", "loading_ufos": "Loading your UFOs", diff --git a/src/frontend/src/lib/i18n/zh-cn.json b/src/frontend/src/lib/i18n/zh-cn.json index f368f225f3..997ea30f4c 100644 --- a/src/frontend/src/lib/i18n/zh-cn.json +++ b/src/frontend/src/lib/i18n/zh-cn.json @@ -325,7 +325,7 @@ }, "satellites": { "title": "所有卫星", - "launch": "部署新卫星", + "launch": "启动一颗卫星", "launch_first": "启动您的第一个 Satellite", "search": "搜索", "satellite": "卫星", @@ -1186,7 +1186,7 @@ "create_ufo_price": "启动 UFO 需要 {0}。", "ufo_name": "UFO 名称", "enter_name": "为您的 UFO 输入名称", - "create": "创建 UFO", + "create": "启动 UFO", "ready": "您的 UFO 已准备就绪!", "overview": "概览", "loading_ufos": "正在加载您的 UFO",