- Add HashtagSuggestion.cy.tsx (16 tests): popup trigger, filtering,
keyboard/click selection, new tag creation, escape to close
- Add ItemMentionSuggestion.cy.tsx (16 tests): popup trigger, filtering,
keyboard/click selection, markdown serialization, edge cases
- Add SuggestionList.cy.tsx (14 tests): rendering, keyboard navigation,
click selection, empty state
- Update TestEditor.tsx to support enableSuggestions prop for testing
These tests validate user-facing autocomplete behaviors for # and @
mentions in the rich text editor.
Reorder processing steps: truncate raw markdown first, then preprocess.
Previously, preprocessMarkdown converted mentions/hashtags to HTML tags
before truncation, but truncateMarkdown only recognizes markdown syntax
([@Label](/item/id)), not HTML tags (<span data-item-mention...>),
causing tags to be cut in half.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add null checks for editor in RichTextEditor (handleChange, useEffect)
- Extract video URL patterns to shared videoPatterns.ts module
- Refactor VideoEmbed.tsx and preprocessMarkdown.ts to use shared patterns
- Add helper functions: getVideoEmbedUrl, getVideoCanonicalUrl, parseVideoUrl
- Remove unused markdownToTiptapJson function
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add strict regex patterns for tag restoration that only match exact expected format
- Add sanitizeUrl() to block javascript:, data:, vbscript: URLs in markdown links
- Add containsDangerousAttributes() to detect event handlers in restored content
- Prevents onclick/onload injection via malformed preprocessed tags
- Add missing dependencies to useEditor in TextView.tsx (items, getItemColor, addFilterTag)
- Remove redundant useEffect that duplicated editor initialization
- Update all TipTap packages to v3.15.3 for version consistency
- Make YouTube video ID pattern more flexible (10-12 chars instead of exactly 11)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace addStorage() with markdownTokenizer/parseMarkdown/renderMarkdown
- Remove tiptap-markdown from rollup commonjs config
- These changes fix serialization of hashtags and mentions to markdown
- Add convertNakedUrls() to skip URLs already inside markdown links
- Rewrite truncateMarkdown() with token-aware truncation
- Add @tiptap/markdown support to VideoEmbed, ItemMention, Hashtag
- Fix double-conversion of URLs in existing links
- Fix truncation cutting tokens in the middle
- Fix eslint warnings with proper types
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The @tiptap/markdown extension doesn't automatically parse custom
markdown syntax like [@Label](/item/id). We need to preprocess the
markdown before loading it into the editor to convert these patterns
to HTML spans that the extensions' parseHTML handlers can recognize.
- RichTextEditor: preprocess defaultValue before loading
- TextView: preprocess innerText before loading
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove old addStorage.markdown.serialize (community tiptap-markdown)
- Keep only renderMarkdown (official @tiptap/markdown)
- Update TextView.tsx to use @tiptap/markdown with contentType
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace community `tiptap-markdown` with official `@tiptap/markdown`
- Use new API: `editor.getMarkdown()` instead of `editor.storage.markdown.getMarkdown()`
- Add `contentType: 'markdown'` for direct markdown loading
- Remove unused `@tiptap/extension-color` (no UI was using it)
- Remove custom MarkdownStorage type declaration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
UUIDs can contain both uppercase and lowercase hex characters (A-F, a-f).
The regex was only matching lowercase, causing @mentions to not be
converted to links in TextViewStatic.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Pass items and getItemColor to simpleMarkdownToHtml
- Item mentions now display with correct colors (item.color → tag color → layer default)
- Add font-weight: bold to hashtags and item mentions for consistency
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix import order issues
- Fix TypeScript type annotations
- Use .at() for array access to satisfy lint rules
- Cast props to correct types in command handlers
- Fix template literal type issues
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add suggestion system for #hashtags and @item-mentions in RichTextEditor
- New files:
- HashtagSuggestion.tsx: autocomplete for existing tags, create new tags
- ItemMentionSuggestion.tsx: autocomplete for items with @syntax
- ItemMention.tsx: TipTap node for item links with markdown serialization
- SuggestionList.tsx: shared popup UI component
- useItemColor.tsx: hook for consistent item color calculation
- Features:
- Type # to see tag suggestions, space key confirms selection
- Type @ to see item suggestions with correct colors
- New tags can be created inline
- Clickable mentions in view mode (hashtags filter map, @mentions navigate)
- Bold styling for all mentions and suggestions
- Disabled clicks in edit mode
- Refactored components to use useItemColor hook for consistent colors
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ReactNodeViewRenderer for video preview in RichTextEditor
- Add ProseMirror plugin for paste detection of video URLs
- Add markdown serialization to output autolink format <url>
- Integrate VideoEmbed extension in RichTextEditor
- Preprocess video links when loading content
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Support markdown autolinks <https://youtube.com/...> in addition to
standard markdown links [text](url) for YouTube and Rumble videos.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Export TextViewStatic from ItemPopupComponents and Item modules
- Update MapContainer to use TextViewStatic instead of TextView for popups
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add TextViewStatic component for Leaflet popups and card previews:
- Uses simple HTML rendering instead of TipTap EditorContent
- No contenteditable attribute = no Leaflet click blocking issues
- Better performance for rendering many items
Changes:
- Add TextViewStatic.tsx for popups/cards
- Add simpleMarkdownToHtml.tsx utility for lightweight markdown conversion
- Update ItemViewPopup to use TextViewStatic
- Update ItemCard to use TextViewStatic
TextView (full TipTap) remains for profile pages with all features.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace react-markdown with TipTap read-only editor for TextView component.
Changes:
- Create TipTap extensions folder with custom Hashtag and VideoEmbed nodes
- Hashtag extension: clickable hashtags with tag colors and filter integration
- VideoEmbed extension: YouTube and Rumble iframe embeds
- Add preprocessMarkdown utility for URL, email, video link, and hashtag conversion
- Migrate TextView to use TipTap with StarterKit, Markdown, Link extensions
- Remove unused itemId prop from TextView and all callers
Known issue: Popup buttons may not work correctly when TextView has content
due to Leaflet's handling of contenteditable elements. To be fixed in follow-up.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>