open-notebook/open_notebook
LUIS NOVO 459aded96c fix: enhance chat reference links and prevent text overflow
This commit addresses two related issues in the chat interface:

1. **Fix broken reference links (OSS-310)**
   - Completely rewrote convertReferencesToMarkdownLinks() with greedy pattern matching
   - Now handles all edge cases: references after commas, nested brackets, bold markdown
   - Added visual icon indicators (FileText, Lightbulb, FileEdit) for reference types
   - Implemented proper error handling with toast notifications
   - Added validation for reference types and ID lengths

2. **Fix long URL/text overflow (#172)**
   - Added break-words and overflow-wrap classes to chat messages
   - Long URLs and text now wrap properly within chat bubbles
   - Applied fix consistently across source chat, notebook chat, and search results

**Technical Details:**
- Enhanced reference detection algorithm processes from end to start to preserve indices
- Context analysis (50 chars before/after) determines original formatting
- Icons are 12px, accessible, and themed appropriately
- All changes pass linting and build successfully

**Files Modified:**
- frontend/src/lib/utils/source-references.tsx (core algorithm rewrite)
- frontend/src/components/source/ChatPanel.tsx (error handling + text wrapping)
- frontend/src/components/search/StreamingResponse.tsx (error handling + text wrapping)
- open_notebook/utils/token_utils.py (ruff formatting fix)

fixes #172
2025-10-19 15:35:26 -03:00
..
database Version 1 (#160) 2025-10-18 12:46:22 -03:00
domain Version 1 (#160) 2025-10-18 12:46:22 -03:00
graphs fix: missing parenthesis 2025-10-18 13:22:39 -03:00
plugins Api podcast migration (#93) 2025-07-17 08:36:11 -03:00
utils fix: enhance chat reference links and prevent text overflow 2025-10-19 15:35:26 -03:00
__init__.py fix: enforce env variables are present 2025-06-10 11:53:53 -03:00
config.py feat: add persistent tiktoken cache to reduce re-downloads (#171) 2025-10-19 14:50:52 -03:00
exceptions.py refactor database module and migrations 2024-10-30 16:33:07 -03:00