mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-12 16:37:06 +02:00
70db78fe3b55cf6df70aeb6a8be8c510ca937d9a
Comprehensive improvements to the republish feature for production deployment: **Performance Optimizations**: - Use useMemo for expensive computations (seenRelays, connectedRelays, allRelays) - Use useCallback for event handlers to prevent unnecessary re-renders - Memoize connected relays filter to avoid duplicate array operations - Reduce re-renders by caching computed values **Better Error Handling**: - Add try-catch with proper error logging to console - Extract error messages consistently across handlers - Add .catch() to relay fetch promise for graceful failures - Prevent duplicate publish operations with guard clauses **Accessibility Improvements**: - Add aria-labels to all interactive buttons with descriptive text - Add role="group" to relay sections for screen readers - Add role="status" to empty state message - Add aria-hidden="true" to decorative icons - Add type="button" to prevent form submission - Add focus ring styles for keyboard navigation **Code Quality**: - Add JSDoc comments to all handler functions - Better variable naming (isPublishing flag, connectedRelays) - Consolidate duplicate code (connected relays filter) - Improve code organization with clear sections - Remove magic numbers and duplicate logic **Edge Cases**: - Check isPublishing before starting batch publish - Check publishingRelays.has(relay) before individual publish - Handle relay fetch errors gracefully without crashing - Proper state cleanup in finally blocks **State Management**: - Consistent state updates using functional updates - Proper Set operations for tracking publishing/published states - Clear separation between local UI state and event state All tests pass and build succeeds. Code is now production-ready.
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%