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>
This commit is contained in:
LofiSu
2026-01-28 19:15:11 +08:00
parent a010953880
commit ad85b72064
10 changed files with 658 additions and 66 deletions

View File

@@ -11,6 +11,8 @@ export const enUS: Translations = {
home: "Home",
settings: "Settings",
delete: "Delete",
rename: "Rename",
share: "Share",
openInNewWindow: "Open in new window",
close: "Close",
more: "More",
@@ -24,6 +26,8 @@ export const enUS: Translations = {
loading: "Loading...",
code: "Code",
preview: "Preview",
cancel: "Cancel",
save: "Save",
},
// Welcome
@@ -38,6 +42,7 @@ export const enUS: Translations = {
copyToClipboard: "Copy to clipboard",
copiedToClipboard: "Copied to clipboard",
failedToCopyToClipboard: "Failed to copy to clipboard",
linkCopied: "Link copied to clipboard",
},
// Input Box

View File

@@ -9,6 +9,8 @@ export interface Translations {
home: string;
settings: string;
delete: string;
rename: string;
share: string;
openInNewWindow: string;
close: string;
more: string;
@@ -22,6 +24,8 @@ export interface Translations {
loading: string;
code: string;
preview: string;
cancel: string;
save: string;
};
// Welcome
@@ -35,6 +39,7 @@ export interface Translations {
copyToClipboard: string;
copiedToClipboard: string;
failedToCopyToClipboard: string;
linkCopied: string;
};
// Input Box

View File

@@ -11,6 +11,8 @@ export const zhCN: Translations = {
home: "首页",
settings: "设置",
delete: "删除",
rename: "重命名",
share: "分享",
openInNewWindow: "在新窗口打开",
close: "关闭",
more: "更多",
@@ -24,6 +26,8 @@ export const zhCN: Translations = {
loading: "加载中...",
code: "代码",
preview: "预览",
cancel: "取消",
save: "保存",
},
// Welcome
@@ -38,6 +42,7 @@ export const zhCN: Translations = {
copyToClipboard: "复制到剪贴板",
copiedToClipboard: "已复制到剪贴板",
failedToCopyToClipboard: "复制到剪贴板失败",
linkCopied: "链接已复制到剪贴板",
},
// Input Box