mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-09 15:07:10 +02:00
1356afe9ea8d541f6f1f5fc7a174711f3fadf7c8
* Fix newline rendering in chat messages The Text component was not properly rendering newlines in chat messages. The previous implementation had buggy logic that only rendered <br /> for empty lines and used an inconsistent mix of spans and divs for non-empty lines, which didn't create proper line breaks between consecutive text lines. Changes: - Render each line in a span with <br /> between consecutive lines - Remove unused useMemo import and fix React hooks violation - Simplify logic for better maintainability This ensures that multi-line messages in chat (and other text content) display correctly with proper line breaks. Fixes rendering of newlines in NIP-29 groups and NIP-53 live chat. * Preserve newlines when sending chat messages The MentionEditor's serializeContent function was not handling hardBreak nodes created by Shift+Enter. This caused newlines within messages to be lost during serialization, even though the editor displayed them correctly. Changes: - Add hardBreak node handling in serializeContent - Preserve newlines (\n) from Shift+Enter keypresses - Ensure multi-line messages are sent with proper line breaks With this fix and the previous Text.tsx fix, newlines are now properly: 1. Captured when typing (Shift+Enter creates hardBreak) 2. Preserved when sending (hardBreak serialized as \n) 3. Rendered when displaying (Text component renders \n as <br />) * Make Enter insert newline on mobile devices On mobile devices, pressing Enter now inserts a newline (hardBreak) instead of submitting the message. This provides better UX since mobile keyboards don't have easy access to Shift+Enter for multiline input. Behavior: - Desktop: Enter submits, Shift+Enter inserts newline (unchanged) - Mobile: Enter inserts newline, Cmd/Ctrl+Enter submits - Mobile detection: Uses touch support API (ontouchstart or maxTouchPoints) Users can still submit messages on mobile using: 1. The Send button (primary method) 2. Ctrl+Enter keyboard shortcut (if available) --------- Co-authored-by: Claude <noreply@anthropic.com>
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%