From 77d35e7beac495967f69ef27bcc0426c686f28a4 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 31 May 2026 22:21:37 -0400 Subject: [PATCH] Layer extract: publish embedded design layer as its own linked event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User-triggered conversion of an embedded design layer into a fresh published kind-30078 event under the user's pubkey, replaced by a linked layer pointing at the new event. Spec Β§10.3 / Β§11.4 β€” when you decide a sub-design is reusable, one click extracts it without re-importing by hand. UI: new "πŸ”— Publish + link" button in the embedded design-layer options panel (alongside Edit and Replace from file). Hidden for linked layers since they're already what extract produces. Flow: 1. Confirm with copy that warns about publishing under the user's identity (per spec Β§10.3 β€” only do this for designs you made). 2. Clone the layer's payload, override payload.meta.title with the layer's name, keep host category/language so the new event discovers into the same bucket. 3. Strip linked-design ephemera + walk the linked tree for attribution p-tags + link tags, same as the host-publish path. 4. Mint d-tag = "extracted:::" so it can't collide with the user's regular published designs. 5. Sign + publish via publishCommunityEvent. 6. Mutate the layer in place: design becomes { kind: 'linked', ref, mode, pinnedEventId: null, slideIndex: 0 for decks }, name gets the πŸ”— prefix, push history. 7. Seed both resolver caches from the signed event via the new linkedDesigns.seed(spec, sourceEvent) method β€” the layer paints from cache instantly without waiting for relay propagation. linkedDesigns.seed reuses _entryFromEvent so vault / premium / private detection runs identically to a fresh fetch. Disk-cache write happens too so a reload also paints instantly. Group extraction is a natural follow-up β€” a group of layers would publish as a single customart-mode payload sized to the group's bbox. Not in this commit; ship single-layer first. --- src/index.html | 127 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 125 insertions(+), 2 deletions(-) diff --git a/src/index.html b/src/index.html index 867e68b..8edf481 100644 --- a/src/index.html +++ b/src/index.html @@ -3377,7 +3377,10 @@ -

Design objects keep the imported design editable inside this layer. Double-clicking the layer opens it too.

+
+ +
+

Design objects keep the imported design editable inside this layer. Double-clicking the layer opens it too. Publish + link extracts this layer into its own reusable Nostr design.