Claude ff213d249f feat: Generalize post composer for kind 1 and kind 11
Add reusable PostComposer component with proper event builders for
creating kind 1 (short text notes) and kind 11 (threads) with full
NIP-10 threading support.

## Event Builders (src/lib/event-builders.ts)

- buildKind1Event: Creates kind 1 notes with NIP-10 reply tags
  - Proper root/reply markers for threading
  - Deduplicates p-tags
  - Supports emoji tags (NIP-30) and imeta tags (NIP-92)
- buildKind11Event: Creates kind 11 threads with title tag
  - Flat reply structure (per NIP-7D)
  - Full metadata support

## PostComposer Component (src/components/editor/PostComposer.tsx)

- Two variants: inline (chat-style) and card (timeline posts)
- Features:
  - @ mention autocomplete with NIP-19 npub encoding
  - : emoji autocomplete (unicode + custom emoji)
  - / slash commands (optional)
  - Blob attachments (NIP-92 imeta tags)
  - Reply context with full event object (not just ID)
  - Title input for kind 11 threads
  - Mobile-aware keyboard behavior

## Key Changes

- Pass replyTo as NostrEvent (full object) instead of string ID
  - Enables proper NIP-10 tag construction
  - Provides access to parent tags and metadata
- Card variant CSS (.editor-card) for multi-row editing
  - Min height 6rem, max height 24rem
  - Scrollable with proper padding
- Comprehensive tests for event builders (14 tests passing)
- Example usage components for integration guidance

## Technical Notes

- Uses UnsignedEvent type (includes pubkey) instead of EventTemplate
- Integrates with applesauce v5 ActionRunner via hub.exec()
- All emoji, mention, and blob metadata properly serialized
- Maintains backward compatibility with existing MentionEditor
2026-01-16 23:21:09 +00:00
2025-12-18 15:46:02 +01:00
2025-12-19 12:49:29 +01:00
2025-12-13 15:06:05 +01:00
2025-12-22 20:40:16 +00:00
2025-12-20 14:25:40 +01:00
2026-01-14 19:24:37 +01:00
2025-12-14 16:50:16 +01:00

Grimoire

A Nostr protocol explorer and developer tool with a tiling window manager interface.

Features

  • Tiling Windows - Each window is a Nostr "app" (profile viewer, event feed, NIP docs, etc.)
  • Command Palette - Unix-style commands via Cmd+K to open apps and navigate
  • Multi-workspace - Virtual desktops with independent layouts
  • Real-time - Reactive event subscriptions with automatic updates

Stack

React 19, TypeScript, Vite, TailwindCSS, Jotai, Dexie, Applesauce

Getting Started

npm install
npm run dev

Scripts

Command Description
npm run dev Start dev server
npm run build Build for production
npm test Run tests in watch mode
npm run lint Lint code
npm run format Format code

License

MIT

Description
No description provided
Readme MIT 14 MiB
Languages
TypeScript 98.9%
CSS 0.8%
JavaScript 0.3%