mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-06-06 10:41:21 +02:00
feat: Add Zapstore app and app curation set renderers (#49)
* feat: Add Zapstore app and app curation set renderers
Add support for rendering Zapstore app-related Nostr events:
- Kind 32267 (App Metadata): Display app details, icon, platforms, screenshots
- Kind 30267 (App Curation Set): Display curated app collections
New files:
- src/lib/zapstore-helpers.ts: Helper functions for extracting app metadata
- src/lib/zapstore-helpers.test.ts: Comprehensive test coverage (43 tests)
- src/components/nostr/kinds/ZapstoreAppRenderer.tsx: Feed view for apps
- src/components/nostr/kinds/ZapstoreAppDetailRenderer.tsx: Detail view for apps
- src/components/nostr/kinds/ZapstoreAppSetRenderer.tsx: Feed view for collections
- src/components/nostr/kinds/ZapstoreAppSetDetailRenderer.tsx: Detail view for collections
Modified:
- src/components/nostr/kinds/index.tsx: Register new renderers in kind registry
All tests pass (726 total), build succeeds, no lint errors.
* feat: Add Zapstore release renderer (kind 30063)
Add support for rendering Zapstore app release events (kind 30063):
- Kind 30063 (Release): Connects apps (32267) to file artifacts (1063)
New files:
- src/components/nostr/kinds/ZapstoreReleaseRenderer.tsx: Feed view for releases
- src/components/nostr/kinds/ZapstoreReleaseDetailRenderer.tsx: Detail view with embedded file metadata
Modified:
- src/lib/zapstore-helpers.ts: Add release helper functions
- getReleaseIdentifier(): Extract release ID (package@version)
- getReleaseVersion(): Parse version from identifier
- getReleaseFileEventId(): Get file metadata event pointer
- getReleaseAppPointer(): Get app metadata pointer
- src/lib/zapstore-helpers.test.ts: Add 18 new tests for release helpers (61 total)
- src/components/nostr/kinds/index.tsx: Register kind 30063 renderers
Complete Zapstore app ecosystem now supported:
- Kind 32267: App metadata (name, icon, description)
- Kind 30267: App curation sets (collections)
- Kind 30063: App releases (version tracking)
- Kind 1063: File metadata (downloads)
All tests pass (744 total), build succeeds.
* refactor: Simplify Zapstore app renderers with platform icons
Improve Zapstore app rendering for cleaner, more intuitive display:
Changes:
- Add detectPlatforms() helper to normalize architecture tags (e.g., "android-arm64-v8a" → "android")
- Replace verbose platform badges with clean platform icons (Android, iOS, Web, macOS, Windows, Linux)
- Remove screenshots from feed view (keep in detail view only)
- Remove repository links and license badges from feed view
- Update detail view to show "Available On" with icon+label platform items
Feed view now shows:
- App icon
- App name
- Summary (2 lines max)
- Platform icons (just icons, no text)
Detail view now shows:
- App icon, name, summary
- Publisher, Package ID, License, Repository (metadata grid)
- Available On (platforms with icons and labels)
- Screenshots gallery (unchanged)
All tests pass (744 total), build succeeds.
* fix: Polish Zapstore renderers with platform labels and clean layout
Address feedback to improve Zapstore renderer UX:
Changes:
1. App feed (ZapstoreAppRenderer):
- Add platform text labels next to icons (e.g., "Android", "iOS", "Web")
- Now shows icon + label for better clarity
2. Release feed (ZapstoreReleaseRenderer):
- Remove big package icon from feed view
- Cleaner, more compact layout with just app name, version badge, and action links
3. Registry comments:
- Update to human-friendly names:
* "Zapstore App" (instead of "App Metadata (Zapstore)")
* "Zapstore App Collection" (instead of "App Curation Set (Zapstore)")
* "Zapstore App Release" (instead of "App Release (Zapstore)")
All tests pass (744 total), build succeeds.
* refactor: Update Zapstore app set renderers with improved UX
- ZapstoreAppSetRenderer: Show ALL apps with compact spacing (gap-0.5) like relay lists, removed 5-app limit
- ZapstoreAppSetDetailRenderer: Replace raw platform tags with normalized platform icons using detectPlatforms()
- Both renderers now provide cleaner, more consistent UI following Grimoire patterns
* refactor: Add human-friendly names and simplify Zapstore renderers
- kinds.ts: Add kind 32267 (App), update 30063 to "App Release", update 30267 to "App Collection"
- Extract PlatformIcon to shared component (zapstore/PlatformIcon.tsx)
- Update all renderer comments to use human-friendly terminology
- Remove unnecessary comments throughout Zapstore renderers
- Simplify code without changing functionality
* feat: Add releases section to app detail view
- Query for all releases (kind 30063) that reference the app
- Display releases sorted by version (newest first)
- Each release shows version badge and download link
- Clicking release opens full release detail view
- Clicking download opens file metadata view
* fix: Force screenshots as images and filter releases by author
- Add type="image" to MediaEmbed for screenshots to fix "unsupported media type" errors
- Filter releases to only show those from the same author (pubkey) as the app
- Prevents releases from other apps or authors from appearing in the app detail view
* fix: Remove author filter from releases query
The a tag already uniquely identifies the app (32267:pubkey:identifier).
Releases may be published by different authors (maintainers, packagers)
than the app author, so we should show all releases that reference
the app via the a tag, regardless of who published them.
---------
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1172,8 +1172,8 @@ export const EVENT_KINDS: Record<number | string, EventKind> = {
|
||||
// },
|
||||
30063: {
|
||||
kind: 30063,
|
||||
name: "Release Artifact Set",
|
||||
description: "Release artifact sets",
|
||||
name: "App Release",
|
||||
description: "Application release with version and files",
|
||||
nip: "51",
|
||||
icon: Package,
|
||||
},
|
||||
@@ -1193,8 +1193,8 @@ export const EVENT_KINDS: Record<number | string, EventKind> = {
|
||||
},
|
||||
30267: {
|
||||
kind: 30267,
|
||||
name: "App Curation",
|
||||
description: "App curation sets",
|
||||
name: "App Collection",
|
||||
description: "Curated collection of applications",
|
||||
nip: "51",
|
||||
icon: BookHeart,
|
||||
},
|
||||
@@ -1345,13 +1345,13 @@ export const EVENT_KINDS: Record<number | string, EventKind> = {
|
||||
nip: "89",
|
||||
icon: Package,
|
||||
},
|
||||
// 32267: {
|
||||
// kind: 32267,
|
||||
// name: "Software App",
|
||||
// description: "Software Application",
|
||||
// nip: "",
|
||||
// icon: AppWindow,
|
||||
// },
|
||||
32267: {
|
||||
kind: 32267,
|
||||
name: "App",
|
||||
description: "Application metadata with platforms and screenshots",
|
||||
nip: "",
|
||||
icon: Package,
|
||||
},
|
||||
34235: {
|
||||
kind: 34235,
|
||||
name: "Video",
|
||||
|
||||
Reference in New Issue
Block a user