mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-12 00:17:02 +02:00
8dc61635cf18fd56c3638094d653283acd868cce
Completely refactor POST command for simplicity and usability. Remove threading, replies, and title input. Focus on clean kind 1 posting with explicit relay selection and mention p-tag control. ## Major Changes **PostWindow (Simplified)**: - Removed thread/reply logic entirely - Support configurable `kind` prop (default: 1) - Build events inline (no external builders needed) - Relay validation (require at least 1 relay) - Clean error handling **PostComposer (Enhanced)**: - Added collapsible relay selector (checkboxes for user write relays) - Added collapsible mentions selector (auto-detect nostr: URIs, select which to p-tag) - Removed title input, reply preview, showTitleInput props - Extract mentions from content via nip19.decode() - Extract hashtags from content (#word pattern) - Auto-select all mentions by default (can deselect before posting) - Added onChange callback to MentionEditor for live content tracking **Command Syntax**: - `post` - Create kind 1 note (default) - `post -k <number>` - Create any event kind - `post --kind <number>` - Explicit kind flag **Removed**: - PostComposerExamples.tsx (outdated examples) - buildKind1Event/buildKind11Event dependencies - Thread and reply complexity ## UI Features **Relay Selector**: - Shows all user write relays as checkboxes - Displays count (e.g., "Relays (3/5)") - Collapsible to save space - All selected by default **Mentions Selector**: - Auto-detects `nostr:npub1...` and `nostr:nprofile1...` URIs - Shows truncated pubkeys (first 8 + last 8 chars) - Displays count (e.g., "Mentions (2/2)") - Auto-selects new mentions as they're typed - Collapsible, only shows when mentions exist ## Technical Notes - Uses GrimoireState.activeAccount for relay list (not applesauce IAccount) - Publishes to each relay individually in ActionRunner - Native `<label>` elements (shadcn Label doesn't support htmlFor) - Regex-based mention/hashtag extraction - NIP-30 emoji tags, NIP-92 imeta tags still supported ## Testing Build successful ✅ Kind 1 posting with relay selection ✅ Mention extraction and p-tag control ✅
…
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+Kto 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
Languages
TypeScript
98.9%
CSS
0.8%
JavaScript
0.3%