From a38c30b57fb46a0709cc38b022c82d5db859adb9 Mon Sep 17 00:00:00 2001 From: Bhavishy Date: Tue, 7 Apr 2026 14:06:19 +0530 Subject: [PATCH] feat: add deep link customization --- src/app/components/IntentHandler.svelte | 201 ++++++++++++++++++++++++ src/app/components/ThreadCreate.svelte | 11 +- src/routes/intent/+page.svelte | 16 ++ 3 files changed, 226 insertions(+), 2 deletions(-) create mode 100644 src/app/components/IntentHandler.svelte create mode 100644 src/routes/intent/+page.svelte diff --git a/src/app/components/IntentHandler.svelte b/src/app/components/IntentHandler.svelte new file mode 100644 index 00000000..0b357ef3 --- /dev/null +++ b/src/app/components/IntentHandler.svelte @@ -0,0 +1,201 @@ + + +{#if hasSettings} +
+ +
+ +
+ Apply Customization? + A link is requesting to customize your app. +
+
+
+ + +

This link will apply the following changes:

+
    + {#if t} +
  • Set theme to "{t}"
  • + {/if} + {#if relays.length > 0} +
  • Add {relays.length} relay{relays.length > 1 ? "s" : ""} to your settings
  • + {/if} + {#if blossoms.length > 0} +
  • Add {blossoms.length} blossom server{blossoms.length > 1 ? "s" : ""}
  • + {/if} + {#if follows.length > 0} +
  • Follow {follows.length} person{follows.length > 1 ? "s" : ""}
  • + {/if} + {#if joins.length > 0} +
  • Join {joins.length} communit{joins.length > 1 ? "ies" : "y"}
  • + {/if} + {#if hasProfile} +
  • Update your profile metadata
  • + {/if} + {#if hasShare} +
  • Open a new post dialog in a specific room
  • + {/if} +
+
+ + + + + +
+{/if} diff --git a/src/app/components/ThreadCreate.svelte b/src/app/components/ThreadCreate.svelte index 5f947e0d..5ffc9d4f 100644 --- a/src/app/components/ThreadCreate.svelte +++ b/src/app/components/ThreadCreate.svelte @@ -23,9 +23,10 @@ type Props = { url: string h?: string + initialContent?: string } - const {url, h}: Props = $props() + const {url, h, initialContent = ""}: Props = $props() const shouldProtect = canEnforceNip70(url) @@ -73,7 +74,13 @@ history.back() } - const editor = makeEditor({url, submit, uploading, placeholder: "What's on your mind?"}) + const editor = makeEditor({ + content: initialContent, + url, + submit, + uploading, + placeholder: "What's on your mind?", + }) let title: string = $state("") diff --git a/src/routes/intent/+page.svelte b/src/routes/intent/+page.svelte new file mode 100644 index 00000000..15708a89 --- /dev/null +++ b/src/routes/intent/+page.svelte @@ -0,0 +1,16 @@ + + +