mirror of
https://github.com/PR0M3TH3AN/Artstr-Studio.git
synced 2026-10-27 08:40:39 +00:00
Spec for the next big arc: reference-based cross-design imports. Adds a `kind: 'linked'` flavor of the existing design layer that stores only a NIP-01 addressable-event coordinate (30078:<pubkey>:<dTag>) and resolves to the latest source on render. Sits alongside the existing embedded import path; user picks at import time. Key decisions baked in (per scoping conversation): - Versioning: always-latest by default, with an opt-in "Pin to this version" toggle exposed per linked layer. - Nesting: up to 3 levels deep with cycle detection + visible depth-exceeded placeholders. - Encrypted: Phase 1 ships public-only; Phase 2 adds premium (renders if viewer's unlocked) and private (share-list aware). - Attribution chain is first-class — host publish emits one ['p', '<contributor pubkey>', '<relay-hint>', 'design-contributor'] tag per distinct linked-tree creator, plus an in-app Credits panel surfacing co-creators. Lets larger collaborative projects carry honest attribution natively. Architectural shape: - Resolver IIFE (linkedDesigns) with session cache, multi-relay union (mirrors _vaultRelayUnion), and a manual Refresh button to bypass cache. - renderDesignObjectIntoElement gets a linked branch that calls the resolver before the existing render path. - Layer-options panel exposes pin / refresh / unlink / replace. - "Publish + link" action converts an embedded layer to a freshly- published source + linked reference (Phase 3 polish). - Convert-back-to-embed action snapshots the current resolution. Phased implementation: - Phase 1: Public-only linking, schema, resolver, rendering, UI. - Phase 2: Premium + private link resolution with access control. - Phase 3: Disk cache, attribution `p`-tag emission, Credits panel, Publish + link workflow. Acceptance criterion for Phase 1: a public cover design linked into a public slide deck renders correctly; editing the source updates the host's render on next refresh. 10-link host event stays under typical relay size limits. Outstanding open questions to revisit during implementation: - Whether the depth limit should be 3 forever or configurable. - Whether the 256 KB per-source payload cap is the right number. - Whether to surface "last resolved" times in the layer name itself or only on hover.