Add event template generator with 140+ Nostr event kinds (v0.36.2)
Some checks failed
Go / build-and-release (push) Has been cancelled

- Add comprehensive eventKinds.js database with all NIPs event kinds
  including templates, descriptions, NIP references, and type flags
- Create EventTemplateSelector.svelte modal with search functionality
  and category filtering (Social, Messaging, Lists, Marketplace, etc.)
- Update ComposeView with "Generate Template" button and error banner
  for displaying permission-aware publish error messages
- Enhance publishEvent() in App.svelte with detailed error handling
  that explains policy restrictions, permission issues, and provides
  actionable guidance for users
- Add permission pre-check to prevent read-only users from attempting
  to publish events
- Update CLAUDE.md with Web UI event templates documentation
- Create docs/WEB_UI_EVENT_TEMPLATES.md with comprehensive user guide

Files modified:
- app/web/src/eventKinds.js (new)
- app/web/src/EventTemplateSelector.svelte (new)
- app/web/src/ComposeView.svelte
- app/web/src/App.svelte
- docs/WEB_UI_EVENT_TEMPLATES.md (new)
- CLAUDE.md
- pkg/version/version

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-16 10:39:02 +01:00
parent 9d6280eab1
commit 0a3e639fee
7 changed files with 3433 additions and 16 deletions

View File

@@ -334,6 +334,11 @@ export ORLY_AUTH_TO_WRITE=false # Require auth only for writes
- Features: event browser with advanced filtering, sprocket management, policy management, user admin, settings
- **Event Browser:** Enhanced filter system with kind, author, tag, and time range filters (replaced simple search)
- **Policy Management Tab:** JSON editor with validation, save publishes kind 12345 event
- **Compose Tab with Event Templates:** Generate pre-filled event templates for all 140+ Nostr event kinds
- `eventKinds.js` - Comprehensive database of event kinds from NIPs with templates
- `EventTemplateSelector.svelte` - Scrolling modal with search and category filtering
- Category filters: All, Regular, Replaceable, Ephemeral, Addressable, Social, Messaging, Lists, Marketplace, Lightning, Media, Git, Calendar, Groups
- Permission-aware error messages explaining policy/role restrictions when publishing fails
**Command-line Tools (`cmd/`):**
- `relay-tester/` - Nostr protocol compliance testing
@@ -816,7 +821,7 @@ Files modified:
3. GitHub Actions workflow builds binaries for multiple platforms
4. Release created automatically with binaries and checksums
## Recent Features (v0.34.x)
## Recent Features (v0.34.x - v0.36.x)
### Directory Spider
The directory spider (`pkg/spider/directory.go`) automatically discovers and syncs metadata from other relays:
@@ -860,6 +865,22 @@ WebAssembly-compatible database backend (`pkg/wasmdb/`):
- **Reference Documentation**: `docs/POLICY_CONFIGURATION_REFERENCE.md` provides authoritative read vs write applicability
- See also: `pkg/policy/README.md` for quick reference
### Web UI Event Templates (v0.36.x)
The Compose tab now includes a comprehensive event template generator:
- **140+ Event Kinds**: Complete database of Nostr event kinds from the NIPs repository
- **Template Generator**: Click "Generate Template" to open searchable modal with all event types
- **Category Filtering**: Filter by Regular, Replaceable, Ephemeral, Addressable, or domain-specific categories (Social, Messaging, Lists, Marketplace, Lightning, Media, Git, Calendar, Groups)
- **Search**: Find events by name, description, kind number, or NIP reference
- **Pre-filled Templates**: Each kind includes proper tag structure and example content
- **Permission-Aware Errors**: When publishing fails, error messages explain:
- Policy restrictions (kind blocked, content limits)
- Permission issues (user role insufficient)
- Guidance on how to resolve (contact admin, policy config)
- **Key Files**:
- `app/web/src/eventKinds.js` - Event kinds database with templates
- `app/web/src/EventTemplateSelector.svelte` - Template selection modal
- `app/web/src/ComposeView.svelte` - Updated compose interface
### Policy JSON Configuration Quick Reference
```json
@@ -956,4 +977,6 @@ Invite-based access control system:
| `pkg/neo4j/MODIFYING_SCHEMA.md` | How to modify Neo4j schema |
| `pkg/neo4j/TESTING.md` | Neo4j testing guide |
| `.claude/skills/cypher/SKILL.md` | Cypher query language skill for Neo4j |
| `app/web/src/eventKinds.js` | Comprehensive Nostr event kinds database (140+ kinds with templates) |
| `docs/WEB_UI_EVENT_TEMPLATES.md` | Web UI event template generator documentation |
| `readme.adoc` | Project README with feature overview |