Commit Graph

39 Commits

Author SHA1 Message Date
ruitanglin
1b0c016093 fix(citations): only render CitationLink badges for AI messages
Human messages should display links as plain underlined text,
not as citation badges. This preserves the original user input
appearance when users paste URLs in their messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 14:28:28 +08:00
ruitanglin
f6e625ec3b fix(citations): improve citation link rendering and copy behavior
- Use citation.title for display text in CitationLink to ensure correct
  titles show during streaming (instead of generic "Source" text)
- Render all external links as CitationLink badges for consistent styling
  during streaming output
- Add removeAllCitations when copying message content to clipboard
- Simplify citations_format prompt for cleaner AI output

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-04 16:34:12 +08:00
ruitanglin
c67f1af889 feat(citations): add shared citation components and optimize code
## New Features
- Add `CitationLink` shared component for rendering citation hover cards
- Add `CitationsLoadingIndicator` component for showing loading state
- Add `removeAllCitations` utility to strip all citations from content
- Add backend support for removing citations when downloading markdown files
- Add i18n support for citation loading messages (en-US, zh-CN)

## Code Optimizations
- Remove duplicate `ExternalLinkBadge` component, reuse `CitationLink` instead
- Consolidate `remarkPlugins` config in `streamdownPlugins` to avoid duplication
- Remove unused imports: `Citation`, `buildCitationMap`, `extractDomainFromUrl`, etc.
- Remove unused `messages` parameter from `ToolCall` component
- Remove unused `isWriteFile` parameter from `ArtifactFilePreview` component
- Remove unused `useI18n` hook from `MessageContent` component

## Bug Fixes
- Fix `remarkGfm` plugin configuration that prevented table rendering
- Fix React Hooks rule violation: move `useMemo` to component top level
- Replace `||` with `??` for nullish coalescing in clipboard data

## Code Cleanup
- Remove debug console.log/info statements from:
  - `threads/hooks.ts`
  - `notification/hooks.ts`
  - `memory-settings-page.tsx`
- Fix import order in `message-group.tsx`

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-04 11:56:10 +08:00
Henry Li
7274f9a6ae feat: adjust tooltips 2026-02-02 09:32:18 +08:00
Henry Li
cb494fe4df feat: wrap path and command in Tooltip for enhanced user experience 2026-02-02 09:23:36 +08:00
Henry Li
b797ef8168 feat: add skeleton 2026-02-02 09:05:33 +08:00
Henry Li
718bb947d0 fix: fix eslint errors and warnings 2026-01-31 21:46:31 +08:00
Henry Li
618b3e1e8f feat: support Github Flavored Markdown 2026-01-30 16:41:18 +08:00
Henry Li
4fc54a7408 feat: add placeholder for image 2026-01-29 15:01:18 +08:00
ruitanglin
ac283b92aa merge: upstream/experimental with citations feature
- Merge upstream changes including image search, tooltips, and UI improvements
- Keep citations feature with inline hover cards
- Resolve conflict in message-list-item.tsx: use upstream img max-width (90%) while preserving citations logic
- Maintain file upload improvements with citations support

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-29 12:55:43 +08:00
ruitanglin
ce9731c10a feat: improve file upload message handling and UI
Backend:
- Handle both string and list format for message content in uploads middleware
- Extract text content from structured message blocks
- Add logging for debugging file upload flow

Frontend:
- Separate file display from message bubble for human messages
- Show uploaded files outside the message bubble for cleaner layout
- Improve file card border styling with subtle border color
- Add debug logging for message submission with files

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-29 12:51:21 +08:00
Henry Li
f809b67c47 feat: enable images in content 2026-01-29 12:51:04 +08:00
ruitanglin
4b63e70b7e feat: refine citations format and improve content presentation
Backend:
- Simplify citations prompt format and rules
- Add clear distinction between chat responses and file content
- Enforce full URL usage in markdown links, prohibit [cite-1] format
- Require content-first approach: write full content, then add citations at end

Frontend:
- Hide <citations> block in both chat messages and markdown preview
- Remove top-level Citations/Sources list for cleaner UI
- Auto-remove <citations> block in code editor view for markdown files
- Keep inline citation hover cards for reference details

This ensures citations are presented like Claude: clean content with inline reference badges.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-29 12:29:13 +08:00
Henry Li
e4d373541f feat: add tooltips 2026-01-29 09:23:06 +08:00
Henry Li
f7ec116c26 feat: enhance search_image 2026-01-29 09:19:43 +08:00
Henry Li
d787b1ca54 feat: support image_search 2026-01-29 08:59:55 +08:00
hetaoBackend
73a1d32a5b feat: display ask_clarification tool messages directly in frontend
Simplify clarification message handling by having the frontend detect and
display ask_clarification tool messages directly, instead of relying on
backend to add an extra AIMessage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 01:25:31 +08:00
ruitanglin
33c47e0c56 feat: add inline citations and thread management features
Citations:
- Add citations parsing utilities for extracting source references from AI responses
- Render inline citations as hover card badges in message content
- Display citation cards with title, URL, and description on hover
- Add citation badge rendering in artifact markdown preview
- Update prompt to guide AI to output citations in correct format

Thread Management:
- Add rename functionality for chat threads with dialog UI
- Add share functionality to copy thread link to clipboard
- Share links use Vercel URL for production accessibility
- Add useRenameThread hook for thread title updates

i18n:
- Add translations for rename, share, cancel, save, and linkCopied

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-01-28 19:15:11 +08:00
Henry Li
0bcbaebb7e fix: bugfix 2026-01-27 09:50:42 +08:00
Henry Li
c6dbd9fbf4 feat: add Titanic ADA demo 2026-01-25 00:35:42 +08:00
Henry Li
56b21e00bf feat: expand by default in demo mode 2026-01-24 22:03:38 +08:00
Henry Li
4aef821344 feat: support absolute path as image src 2026-01-24 20:58:56 +08:00
Henry Li
0908127bd7 feat: implement the first version of landing page 2026-01-23 13:24:03 +08:00
Henry Li
44850d9a61 feat: add Todos 2026-01-22 00:26:11 +08:00
Henry Li
4467b1860f feat: auto open artifact 2026-01-21 09:45:55 +08:00
Henry Li
ac9ef30780 feat: implement i18n 2026-01-20 14:06:47 +08:00
Henry Li
5d6162d006 feat: use code block to display bash commands 2026-01-19 21:59:23 +08:00
Henry Li
5624b0cd38 feat: support clarification tool 2026-01-18 20:17:32 +08:00
Henry Li
aa44566fef feat: re-implement message group 2026-01-18 19:56:07 +08:00
Henry Li
ec1964c829 feat: support SSE write_file(0 2026-01-18 17:13:15 +08:00
Henry Li
71eadc942f fix: fix message grouping issues 2026-01-18 13:07:56 +08:00
Henry Li
9605cec6d3 feat: enhance message display 2026-01-18 11:25:46 +08:00
Henry Li
0ea448a220 feat: add reasoning check to message list item rendering 2026-01-17 18:02:19 +08:00
Henry Li
62921ec96a feat: redesign step counter 2026-01-17 17:45:13 +08:00
Henry Li
63f3c9e2bb fix: remove unused imports 2026-01-17 17:37:36 +08:00
Henry Li
1a3b70ac43 feat: merge the last thinking with the previous group 2026-01-17 16:10:58 +08:00
Henry Li
0c6f8353bf feat: support artifact preview 2026-01-17 15:09:44 +08:00
Henry Li
80c928fcf5 feat: set artifacts layout 2026-01-17 11:02:33 +08:00
Henry Li
c216093360 refactor: rename 2026-01-17 00:05:19 +08:00