mirror of
https://github.com/PR0M3TH3AN/Artstr-Studio.git
synced 2026-11-05 05:00:39 +00:00
User-facing entry point to create a linked design layer. Both layer-panel sites (designer-app disc target + template-app per- target panel) now expose a "🔗 Link from Nostr" button alongside the existing "Import from Nostr" — embed vs link is a one-click distinction at import time. Mechanics: - openLinkedDesignNostrSearch(targetOverride) mirrors the existing embed-flow opener but stashes state._designLayerImportMode = 'link' before opening the community modal. The modal is unchanged; the same row-click handler picks the route. - addLinkedDesignLayerFromRow(row, target) creates a kind: 'linked' layer with { ref, mode, pinnedEventId: null }. Ref is built from the source event's kind + pubkey + d-tag. Refuses to link sources without a d-tag (legacy non-replaceable events). The initial layer dimensions mirror the embed path — uses designObjectAspect on the freshly-clicked payload — so the layer lands at the source's natural aspect. Layer name prefixed with '🔗 ' so it's visually distinct in the layer list. - tryDesignLayerImportRow now dispatches on _designLayerImportMode: 'embed' keeps the existing addDesignLayerFromPayload behaviour; 'link' routes to addLinkedDesignLayerFromRow. Resets the mode back to 'embed' on completion or cancellation. - openDesignLayerNostrSearch (the embed entry point) explicitly sets mode = 'embed' on open so a previously-cancelled link attempt doesn't pollute the next embed. - The new addLinkedDesignLayerFromRow warms the resolver cache with the just-fetched payload so the very first render is sync — no placeholder flicker for the user who just clicked. Toast copy is honest about the difference: - embed: "Design imported as an editable object layer." - link: "🔗 Linked — renders the latest version of the source on each refresh." Layer-options panel (refresh / pin / unlink / replace) for selected linked layers is the next commit in this phase.