Fixes#1368
Previously, was duplicated in 4 places with 3 subtly different fallback behaviors:
1. inline-citation.tsx: returned on error
2. markdown-text.tsx: returned on error
3. assistant-message.tsx: returned on error
4. citation.tsx: returned on error
Created canonical in that:
- Returns
- Strips prefix from hostname
- Returns on invalid URL (safest contract)
Updated all 4 call sites:
- inline-citation.tsx: (preserves original fallback)
- markdown-text.tsx: (preserves original fallback)
- assistant-message.tsx: (drop-in, both return )
- citation.tsx: (drop-in, both return )
Co-authored-by: guangyang1206 <guangyang1206@users.noreply.github.com>
- Added `enableCitations` prop to `MarkdownViewer` to support interactive citation badges.
- Updated instances of `MarkdownViewer` across various components to utilize the new citation feature.
- Enhanced citation processing in `PlateEditor` for read-only views, ensuring citations are rendered correctly without affecting markdown serialization.
- Refactored citation handling in `InlineCitation` and `MarkdownText` to improve citation context management.
- Updated `content_hash` in the `Document` model to remove global uniqueness, allowing identical content across different paths.
- Enhanced `_create_document` function to handle path uniqueness and prevent session-poisoning from `IntegrityError`.
- Added detailed comments for clarity on the changes and their implications.
- Introduced new citation handling in the editor for improved user experience with citation jumps.
- Updated package dependencies in the frontend for better functionality.