mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-06-16 17:48:34 +02:00
d0345d74a829fc4cd97f5f4dfd2283892ac60bdd
Implements a new `thread` command that displays NIP-22 comment threads with expandable tree visualization. **New Command:** - `thread <identifier>` - Display comment thread for any Nostr event - Accepts nevent, naddr, note, hex IDs, and kind:pubkey:d-tag formats - Reuses parseOpenCommand for argument parsing **ThreadViewer Component** (`src/components/ThreadViewer.tsx`): - Displays root event at top followed by comment tree - Fetches all kind 1111 comments that reference the root event - Builds hierarchical tree structure from flat comment list - Distinguishes top-level comments (root === parent) from nested replies - Expandable/collapsible tree nodes with chevron indicators **Comment Tree Features:** - Two-level reply visualization (root → reply → nested replies) - Automatic sorting by created_at (oldest first) - Shows reply count and relative timestamps - Focus support for highlighting specific comments - Empty state when no comments exist **Technical Implementation:** - Uses NIP-22 helpers: getCommentRootPointer, getCommentReplyPointer - Reactive timeline subscription via use$ and eventStore.timeline - Proper pointer matching for both event IDs and address pointers - Custom CommentReply renderer with UserName and RichText integration - BaseEventContainer integration for consistent event display **Integration:** - Added "thread" to AppId type - Registered in WindowRenderer with lazy loading - Added thread command to man pages with examples - Cross-referenced with "open" command in seeAlso This implements the foundation for NIP-22 thread exploration. Future enhancements can include reply UI, thread depth visualization, and better focus/scroll behavior.
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%