feat(artifacts): shareable purchase artifact page (flag: artifact_share)#735
Draft
dhamariT wants to merge 1 commit into
Draft
feat(artifacts): shareable purchase artifact page (flag: artifact_share)#735dhamariT wants to merge 1 commit into
dhamariT wants to merge 1 commit into
Conversation
…hare) A shop purchase gets a public, shareable "I earned this" page for posting on LinkedIn/Slack: earned by shipping <project>, redeemed <X> stardust for <item>. - Public page keyed by ShopOrder#signed_id(purpose: :artifact), not the sequential id, so purchases can't be enumerated; noindex by default - ArtifactsController#show + public ArtifactPolicy; reuses the existing OG-meta system and the featured project's OG image (project_og_image_url) for the social preview, no bespoke image generator - Provenance from the buyer's most recent ship-event payout ledger entry (stardust is pooled, not per-order); generic fallback when no ships - Reuses .idv-setup-card styling + copy_controller; no new SCSS/components - Share button on the orders page gated behind :artifact_share (off by default); the public page stays open-by-signed-link so logged-out recipients can view it No model, no migration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A shop purchase gets a public, shareable "I earned this" page, designed for posting on LinkedIn / Slack: "earned by shipping [project] on Stardance, then redeemed [X] stardust for [item]." Behind a new
artifact_shareFlipper flag (off by default).Why
Payouts are going out and people are spending stardust. Turning a purchase into a shareable artifact gives builders social proof to post off-platform, which is free, organic marketing for Stardance.
How (least code, reuse-heavy)
No new model, no migration, no bespoke image generator.
ArtifactsController#show+ArtifactPolicy#show? => true, modeled on the public project page.ShopOrder#signed_id(purpose: :artifact), not the sequential order id, so purchases cannot be enumerated (no IDOR).noindex, nofollowby default. Tampered/invalid ids 404.content_for :og_*system and the featured project's existing OG image viaproject_og_image_url— no new OG-image service/controller..idv-setup-cardstyling +copy_controller.jsfor the share button. No new SCSS or components.:artifact_share. The public page itself is not flag-gated (it is open-by-signed-link), so logged-out recipients can always view a shared link once the owner has the flag and mints it.Diff: 3 small new files (controller, policy, view) + ~19 lines across routes, the flag list, and the orders page.
Test
Place a shop order as that user, open the orders page, click "Share your win →", paste the link in a logged-out browser. Confirm: the page renders, OG meta + image are present (view-source or the OG preview tooling),
noindexis set, and a bare sequential id at/artifacts/123does NOT resolve (signed id only).Note: rubocop/erb_lint were not run locally (the sandbox only had Ruby 2.6, not the project's 3.4.3); ERB + controller syntax were validated and CI will run the full lint.
Follow-ups
OgImage::Artifactbranded share image ("bought [item] for [X] stardust").