From 11cddac311cb4c9b19a4ff85412d1b1a4fc5d3bf Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Fri, 24 Apr 2026 17:19:38 +0200 Subject: [PATCH 1/2] feat(frontend): attach UFO --- .../src/lib/components/icons/IconLink.svelte | 2 +- .../attach-detach/AttachActions.svelte | 19 --------- .../attach-detach/AttachOrbiter.svelte | 24 ----------- .../attach-detach/AttachSatellite.svelte | 24 ----------- .../attach-detach/AttachSegment.svelte | 42 +++++++++++++------ .../modules/launchpad/LaunchpadToolbar.svelte | 4 +- .../src/lib/components/ui/Popover.svelte | 2 +- src/frontend/src/lib/i18n/en.json | 8 ++-- src/frontend/src/lib/i18n/zh-cn.json | 8 ++-- .../services/attach-detach/attach.services.ts | 6 ++- src/frontend/src/lib/types/i18n.d.ts | 6 +-- 11 files changed, 50 insertions(+), 95 deletions(-) delete mode 100644 src/frontend/src/lib/components/modules/attach-detach/AttachActions.svelte delete mode 100644 src/frontend/src/lib/components/modules/attach-detach/AttachOrbiter.svelte delete mode 100644 src/frontend/src/lib/components/modules/attach-detach/AttachSatellite.svelte diff --git a/src/frontend/src/lib/components/icons/IconLink.svelte b/src/frontend/src/lib/components/icons/IconLink.svelte index 216b1d334c..2f18c50962 100644 --- a/src/frontend/src/lib/components/icons/IconLink.svelte +++ b/src/frontend/src/lib/components/icons/IconLink.svelte @@ -4,7 +4,7 @@ size?: string; } - let { size = '24px' }: Props = $props(); + let { size = '20px' }: Props = $props(); - import Actions from '$lib/components/app/core/Actions.svelte'; - import IconMore from '$lib/components/icons/IconMore.svelte'; - import AttachOrbiter from '$lib/components/modules/attach-detach/AttachOrbiter.svelte'; - import AttachSatellite from '$lib/components/modules/attach-detach/AttachSatellite.svelte'; - - let visible: boolean = $state(false); - const close = () => (visible = false); - - - - {#snippet icon()} - - {/snippet} - - - - - diff --git a/src/frontend/src/lib/components/modules/attach-detach/AttachOrbiter.svelte b/src/frontend/src/lib/components/modules/attach-detach/AttachOrbiter.svelte deleted file mode 100644 index c7b85d46c8..0000000000 --- a/src/frontend/src/lib/components/modules/attach-detach/AttachOrbiter.svelte +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - {#snippet title()} - {$i18n.analytics.attach} - {/snippet} - {#snippet input()} - {$i18n.analytics.attach_id} - {/snippet} - diff --git a/src/frontend/src/lib/components/modules/attach-detach/AttachSatellite.svelte b/src/frontend/src/lib/components/modules/attach-detach/AttachSatellite.svelte deleted file mode 100644 index a04eb28a66..0000000000 --- a/src/frontend/src/lib/components/modules/attach-detach/AttachSatellite.svelte +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - {#snippet title()} - {$i18n.launchpad.attach} - {/snippet} - {#snippet input()} - {$i18n.satellites.id} - {/snippet} - diff --git a/src/frontend/src/lib/components/modules/attach-detach/AttachSegment.svelte b/src/frontend/src/lib/components/modules/attach-detach/AttachSegment.svelte index 140d04f9b9..b60b5bc001 100644 --- a/src/frontend/src/lib/components/modules/attach-detach/AttachSegment.svelte +++ b/src/frontend/src/lib/components/modules/attach-detach/AttachSegment.svelte @@ -2,7 +2,9 @@ import { Principal } from '@icp-sdk/core/principal'; import type { Snippet } from 'svelte'; import InputCanisterId from '$lib/components/app/core/InputCanisterId.svelte'; + import IconLink from '$lib/components/icons/IconLink.svelte'; import Popover from '$lib/components/ui/Popover.svelte'; + import Value from '$lib/components/ui/Value.svelte'; import { isBusy } from '$lib/derived/app/busy.derived'; import { authIdentity } from '$lib/derived/auth.derived'; import { missionControlId } from '$lib/derived/console/account.mission-control.derived'; @@ -12,15 +14,9 @@ import { toasts } from '$lib/stores/app/toasts.store'; import { i18nCapitalize, i18nFormat } from '$lib/utils/i18n.utils'; - interface Props { - segment: 'satellite' | 'orbiter'; - visible: boolean | undefined; - title?: Snippet; - input?: Snippet; - onsuccess: () => void; - } + let visible = $state(false); - let { segment, visible = $bindable(), title, input, onsuccess }: Props = $props(); + let segment = $state<'satellite' | 'orbiter' | 'ufo'>('satellite'); let validConfirm = $state(false); let canisterId = $state(''); @@ -53,8 +49,6 @@ visible = false; - onsuccess(); - toasts.success({ text: i18nCapitalize( i18nFormat($i18n.canisters.attach_success, [ @@ -68,13 +62,33 @@ }; + +
-

{@render title?.()}

+

{$i18n.launchpad.attach_title}

+ +

{$i18n.launchpad.attach_description}

+ +
+ + {#snippet label()} + {$i18n.cli.module} + {/snippet} + + + +
{#snippet label()} - {@render input?.()} + {$i18n.launchpad.attach_id} {/snippet} @@ -92,4 +106,8 @@ label { margin: var(--padding-1_5x) 0 0; } + + p { + font-size: var(--font-size-small); + } diff --git a/src/frontend/src/lib/components/modules/launchpad/LaunchpadToolbar.svelte b/src/frontend/src/lib/components/modules/launchpad/LaunchpadToolbar.svelte index 8a581ce959..9c3fe491d5 100644 --- a/src/frontend/src/lib/components/modules/launchpad/LaunchpadToolbar.svelte +++ b/src/frontend/src/lib/components/modules/launchpad/LaunchpadToolbar.svelte @@ -1,7 +1,7 @@