thePR0M3TH3ANandClaude Opus 4.7 c9cf28fbb9 Add NIP-57 zap tracking with totals, sort, and auto-close
Phase 1 — Sign zap requests:
- When the LNURL endpoint advertises allowsNostr + nostrPubkey and the
  tipper has NIP-07, sign a kind-9734 zap request and pass it as the
  nostr= param to the pay callback. Tags include e (event id), a
  (naddr coords) and p (recipient) for feed-card / preview tips, or
  just p for profile tips.
- Silent fallback to plain LNURL-pay for non-zap endpoints or
  signed-out users. Tips never silently fail.
- Tiny "⚡ Tracked zap" badge in the invoice view when the zap path
  engaged, so QR / copy users know their tip will count.

Phase 2 — Aggregate and display:
- Parse kind-9735 receipts via the embedded description tag (NIP-57
  amount) or a bolt11 amount fallback (with multiplier table).
- _zapCache aggregates by event id and by author pubkey; receipts are
  deduped by event id.
- Feed enrichment phase batch-queries receipts by #e for visible
  designs; profile-page opens query by #p for the author and by #e
  for each design in the grid.
- Feed cards display a "⚡ <total>" badge in the actions row.
- Design preview meta line gets the same badge.
- Profile page header shows "⚡ X sats received" under the npub.

Sort and visibility:
- New "⚡ Zapped" tab in both the Community modal and the welcome
  modal. Sort is pure zap-total with date as the tiebreaker.
- Existing Popular sort now leads with zap totals, falling back to
  reactions, trust, and date.
- isPreviewBroken now flags designs pre-emptively when the preview
  URL is missing (for modes that require artwork) or uses a non-http
  scheme, so broken designs sink to the bottom on first paint
  instead of waiting for an actual image-load failure.
- Broken-image set persists to localStorage so detected breakage
  survives reloads.

Payment detection:
- After a tracked invoice is issued, a background poller queries
  kind-9735 events with #p=recipient + since=now. When a receipt
  arrives whose embedded zap request matches the tipper's pubkey,
  the event id, and the amount (within 10% tolerance), the modal
  shows "✓ Payment received! Closing…" and auto-closes 1.2s later.
  Polling stops after 5 minutes (invoice expiry), on close, or on
  "New amount".
- WebLN auto-pay button appears in the invoice view when
  window.webln is available; one click pays via the extension and
  closes the modal on success. Rejections are handled quietly so
  the QR / copy paths remain available.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-18 14:46:31 -04:00
2026-05-13 17:25:59 -04:00
2026-05-18 13:21:30 -04:00

CaseWrap Studio

CaseWrap Studio is a static print-layout editor for physical media packaging. It supports DVD/Blu-ray case wraps, Avery 8960/8944 disc-label sheets, Avery 8693/8943 CD jewel-case insert sheets, and reusable single-disc designs.

What it supports

  • Separate front, spine, and back case artwork (or one combined wrap image)
  • Disc-label sheet mode (two print positions on one Avery 8960/8944 sheet)
  • CD jewel insert mode (front + tray inserts on one Avery 8693/8943 sheet)
  • Disc Designer mode for creating a reusable single-disc design
  • Additional image and text layers
  • Drag positioning, z-order changes, rotation, sizing, and opacity
  • PDF export through the browser print dialog
  • Nostr community browsing/sharing for templates and disc designs
  • Publishing, replies, reactions, follows, and reposts from inside the app

Important workflow

All image sources are remote URLs.

That means:

  • Case art, disc art, jewel insert art, and extra image layers should use http or https URLs
  • Saved project JSON remains portable across machines
  • Exported/copied Nostr events can reconstruct layouts from event content
  • Community feed data comes from relays listed in the Community panel
  • Publishing/social actions require a NIP-07 browser extension (for example Alby or nos2x)

If a URL stops working later, the image will no longer render. For long-term reliability, use stable hosted URLs.

Main file

  • src/index.html is the complete app entrypoint. Open it directly in a browser or serve it from any static host.

Export and print

  • Use Print / Save PDF for print-ready output
  • Keep browser scale at 100%
  • Disable browser headers and footers

Save, restore, and sharing

  • Save project writes project JSON
  • Load project restores project JSON
  • Copy Nostr event copies a signed event payload
  • Import from Nostr restores a template/design from a copied event
  • The Community modal lets you browse New/Popular/Search/Mine, preview templates, and import them
  • Disc designs can be published and reused independently, then imported into Disc 1 or Disc 2 positions on a disc sheet

Nostr data model

  • Template/design payloads are published as kind 30078 app-data events with casewrap tags
  • Typical social events use standard kinds (1, 7, 6, 3, 0)
  • Template modes include cover, disc, jewel, and disc-design
  • Current schema version is 5; minimum supported schema version is 4

Notes

  • The app is fully static and does not require a backend
  • Local browser autosave is still available
  • Older saved projects with embedded data URLs may still load, but new work should use remote URLs
S
Description
A static site DVD and Blu-Ray Case and disk label designer
Readme
5.7 MiB
0 Stars 1 Watchers 0 Forks
Languages
JavaScript 99.7%
HTML 0.3%