肖应宇
ff0c25db54
feat(ui): 新增文件名截断工具及下拉菜单文本溢出优化
...
- 新增 truncateMiddle 工具函数,支持中英文混合字符串按视觉宽度截断
- artifact-file-list 和 dropdown-selector 应用截断处理,避免长文本溢出
- dropdown-menu 和 ArtifactTitle 添加文本溢出省略样式
2026-03-24 10:28:50 +08:00
肖应宇
d2d3b73f53
feat(i18n): 附件删除按钮国际化
...
- 调整 prompt-input 附件删除按钮样式,默认隐藏,hover 时显示
2026-03-23 17:17:18 +08:00
肖应宇
da2023b42b
feat(artifacts): 新增 Markdown 导出 DOCX/PDF 功能
...
- 新增 document-converter.ts 工具模块,支持 Markdown 转换为 DOCX(docx 库)和 PDF(html2pdf.js)
- 在 artifact-file-detail 添加下载菜单选项(downloadAsDocx、downloadAsPdf)
- .gitignore 添加 docs 目录忽略
2026-03-23 17:09:39 +08:00
肖应宇
8dac856258
fix: 修复复制功能,向主页面发送信息;修复user的信息离复制按钮太远的问题;
2026-03-23 13:34:49 +08:00
肖应宇
03e95aee91
feat(ui): 调整聊天页布局比例及 artifacts 滚动条遮挡处理
...
- 修改 artifactsOpen 时容器宽度从 70% 改为 50%
- 文件阅读区添加圆角样式
- 文件阅读区添加滚动条顶部遮挡层,优化视觉体验
- 代码编辑器增加 py-[20px] 内边距
- InputBox 已提交状态强制显示阴影效果
2026-03-20 16:31:28 +08:00
肖应宇
0e3da716ed
style: 格式化代码
...
Prettier 格式化 CSS 类名顺序
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 10:19:06 +08:00
肖应宇
fb226f85a8
feat(ui): 重构聊天页布局并规范化 iframe 通信
...
- 移除 ResizablePanel 组件,改用自定义 flex 布局实现聊天区与 artifacts 面板
- 调整 artifacts 面板样式,支持全屏模式下的布局切换
- 新增 iframe-messages.ts 统一 postMessage 通信协议,定义 FULLSCREEN、SELECT_SKILL 等消息类型
- 优化 artifacts 工具栏图标为 SVG 内联实现,调整 zoom 默认值为 80%
- 重构 dropdown-selector 组件,支持展开/收起状态指示器
- 修改 layout.tsx 中 geist variable 的 className 拼接方式
- 新增 package.json prettier 格式化命令
2026-03-20 10:09:42 +08:00
肖应宇
4df604d491
style: prettier
2026-03-19 17:33:47 +08:00
肖应宇
cb0ebf41bb
feat(ui): 重构聊天页布局并规范化iframe 通信
2026-03-19 17:32:19 +08:00
肖应宇
1c4a4525b3
feat: 旧版系统第一版
2026-03-18 23:29:50 +08:00
肖应宇
aee59b978b
prettier
2026-03-18 16:44:03 +08:00
LofiSu
46048c76ce
chore: 移除所有 Citations 相关逻辑,为后续重构做准备
...
- Backend: 删除 lead_agent / general_purpose 中的 citations_format 与引用相关 reminder;artifacts 下载不再对 markdown 做 citation 清洗,统一走 FileResponse,保留 Response 用于二进制 inline
- Frontend: 删除 core/citations 模块、inline-citation、safe-citation-content;新增 MarkdownContent 仅做 Markdown 渲染;消息/artifact 预览与复制均使用原始 content
- i18n: 移除 citations 命名空间(loadingCitations、loadingCitationsWithCount)
- 技能与 demo: 措辞改为 references,demo 数据去掉 <citations> 块
- 文档: 更新 CLAUDE/AGENTS/README 描述,新增按文件 diff 的代码变更总结
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 16:24:01 +08:00
LofiSu
cef8d389fd
refactor(frontend): consolidate citation logic, slim exports and impl
...
- SafeCitationContent: add loadingOnly and renderBody props.
- loadingOnly: show only loading indicator or null (e.g. write_file step).
- renderBody(parsed): custom body renderer (e.g. artifact preview).
- message-group write_file: use SafeCitationContent(content, isLoading,
rehypePlugins, loadingOnly) instead of local useParsedCitations +
shouldShowCitationLoading + CitationsLoadingIndicator. Pass rehypePlugins
into ToolCall.
- artifact-file-detail markdown preview: use SafeCitationContent with
renderBody((p) => <ArtifactFilePreview ... cleanContent={p.cleanContent}
citationMap={p.citationMap} />). Remove local shouldShowCitationLoading
and CitationsLoadingIndicator branch.
- core/citations: inline buildCitationMap into use-parsed-citations, remove
from utils; stop exporting hasCitationsBlock (internal to shouldShowCitationLoading).
- inline-citation: make InlineCitationCard, InlineCitationCardBody,
InlineCitationSource file-private (no longer exported).
Co-authored-by: Cursor <cursoragent@cursor.com>
---
refactor(前端): 收拢引用逻辑、精简导出与实现
- SafeCitationContent 新增 loadingOnly、renderBody。
- loadingOnly:仅显示加载或 null(如 write_file 步骤)。
- renderBody(parsed):自定义正文渲染(如 artifact 预览)。
- message-group write_file:改用 SafeCitationContent(loadingOnly),去掉
本地 useParsedCitations + shouldShowCitationLoading + CitationsLoadingIndicator,
并向 ToolCall 传入 rehypePlugins。
- artifact-file-detail 的 markdown 预览:改用 SafeCitationContent +
renderBody 渲染 ArtifactFilePreview,去掉本地加载判断与
CitationsLoadingIndicator 分支。
- core/citations:buildCitationMap 内联到 use-parsed-citations 并从 utils
删除;hasCitationsBlock 不再导出(仅 shouldShowCitationLoading 内部使用)。
- inline-citation:InlineCitationCard/Body/Source 改为文件内私有,不再导出。
2026-02-09 15:58:59 +08:00
LofiSu
4f9d1d524e
feat(frontend): unify citation logic and prevent half-finished citations
...
- Add SafeCitationContent as single component for citation-aware body:
useParsedCitations + shouldShowCitationLoading; show loading until
citations complete, then render body with createCitationMarkdownComponents.
Supports optional remarkPlugins, rehypePlugins, isHuman, img.
- Refactor MessageListItem: assistant message body now uses
SafeCitationContent only; remove duplicate useParsedCitations,
shouldShowCitationLoading, createCitationMarkdownComponents and
CitationsLoadingIndicator logic. Human messages keep plain
AIElementMessageResponse (no citation parsing).
- Use SafeCitationContent for clarification, present-files (message-list),
thinking steps and write_file loading (message-group), subtask result
(subtask-card). Artifact markdown preview keeps same guard
(shouldShowCitationLoading) with ArtifactFilePreview.
- Unify loading condition: shouldShowCitationLoading(rawContent,
cleanContent, isLoading) is the single source of truth. Show loading when
(isLoading && hasCitationsBlock(rawContent)) or when
(hasCitationsBlock(rawContent) && hasUnreplacedCitationRefs(cleanContent))
so Pro/Ultra modes also show "loading citations" and half-finished
[cite-N] never appear.
- message-group write_file: replace hasCitationsBlock + threadIsLoading
with shouldShowCitationLoading(fileContent, cleanContent,
threadIsLoading && isLast) for consistency.
- citations/utils: parse incomplete <citations> during streaming;
remove isCitationsBlockIncomplete; keep hasUnreplacedCitationRefs
internal; document display rule in file header.
Co-authored-by: Cursor <cursoragent@cursor.com>
---
feat(前端): 统一引用逻辑并杜绝半成品引用
- 新增 SafeCitationContent 作为引用正文的唯一出口:内部使用
useParsedCitations + shouldShowCitationLoading,在引用未就绪时只显示
「正在整理引用」,就绪后用 createCitationMarkdownComponents 渲染正文;
支持可选 remarkPlugins、rehypePlugins、isHuman、img。
- 重构 MessageListItem:助手消息正文仅通过 SafeCitationContent 渲染,
删除重复的 useParsedCitations、shouldShowCitationLoading、
createCitationMarkdownComponents、CitationsLoadingIndicator 等逻辑;
用户消息仍用 AIElementMessageResponse,不做引用解析。
- 澄清、present-files(message-list)、思考步骤与 write_file 加载
(message-group)、子任务结果(subtask-card)均使用
SafeCitationContent;Artifact 的 markdown 预览仍用同一 guard
shouldShowCitationLoading,正文由 ArtifactFilePreview 渲染。
- 统一加载条件:shouldShowCitationLoading(rawContent, cleanContent,
isLoading) 为唯一判断。在「流式中且已有引用块」或「有引用块且
cleanContent 中仍有未替换的 [cite-N]」时仅显示加载,从而在 Pro/Ultra
下也能看到「正在整理引用」,且永不出现半成品 [cite-N]。
- message-group 的 write_file:用 shouldShowCitationLoading(
fileContent, cleanContent, threadIsLoading && isLast) 替代
hasCitationsBlock + threadIsLoading,与其他场景一致。
- citations/utils:流式时解析未闭合的 <citations>;移除
isCitationsBlockIncomplete;hasUnreplacedCitationRefs 保持内部使用;
在文件头注释中说明展示规则。
2026-02-09 15:01:51 +08:00
LofiSu
8168ea47b3
chore(frontend): remove unused Citation UI components from inline-citation
...
- Remove InlineCitation, InlineCitationText, InlineCitationCardTrigger
- Remove InlineCitationCarousel and all Carousel subcomponents (Content, Item, Header, Index, Prev, Next)
- Remove InlineCitationQuote
- Drop Carousel/carousel and ArrowLeft/ArrowRight icon imports; keep only CitationLink, CitationAwareLink, CitationsLoadingIndicator and their dependencies
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 12:49:31 +08:00
LofiSu
30e1760211
refactor(frontend): simplify and deduplicate Citation-related code
...
- Extract removeCitationsBlocks in utils, reuse in parseCitations and removeAllCitations
- Add hasCitationsBlock; isCitationsBlockIncomplete now uses it
- Add useParsedCitations hook (parseCitations + buildCitationMap) for message/artifact
- Add CitationAwareLink to unify link rendering (message-list-item + artifact-file-detail)
- Add getCleanContent helper; message-group uses it and useParsedCitations
- ArtifactFileDetail: single useParsedCitations, pass cleanContent/citationMap to Preview
- Stop exporting buildCitationMap and removeCitationsBlocks from citations index
- Remove duplicate MessageLink and inline link logic in artifact preview
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 12:13:06 +08:00
LofiSu
fe06be8258
Revert "fix(frontend): Turbopack about page + remove hover on web search/citations"
...
This reverts commit 7e9e061f20fcec1f1a9c35be40d9407c05ed82be.
2026-02-09 03:23:51 +08:00
LofiSu
842c4ecac0
fix(frontend): Turbopack about page + remove hover on web search/citations
...
- About: use aboutMarkdown from about-content.ts instead of raw-loader for
about.md (fixes Turbopack 'Cannot find module raw-loader')
- Web search: remove Tooltip from web_search and web_fetch result links
- Citations: remove HoverCard from CitationLink so no hover popup on badges
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 03:23:02 +08:00
Henry Li
b135449c07
fix: adjust suggestion positioning and height for improved UI layout
2026-02-07 17:56:06 +08:00
LofiSu
e4eb4a65cf
Merge pull request #25 from LofiSu/feat/citations
...
feat(citations): add shared citation components and optimize code
2026-02-07 12:13:32 +08:00
Henry Li
a122f76e36
feat: add animations
2026-02-07 10:30:35 +08:00
LofiSu
49f7cf1662
fix(citations): use markdown link text as fallback for display
...
When citation data is not available, use the markdown link text
(children) as display text instead of just the domain. This ensures
that links like [OpenJudge](github.com/...) show 'OpenJudge' instead
of just 'github.com'.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 15:06:51 +08:00
LofiSu
2debcf421c
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
LofiSu
644229f968
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
3067f8dd03
feat: add suggestions
2026-02-02 11:21:30 +08:00
Henry Li
867749d7a3
feat: add file icons
2026-02-02 10:02:31 +08:00
Henry Li
a4f749f939
fix: add max width
2026-01-29 16:12:30 +08:00
Henry Li
28361ca03c
feat: add scroll indicator
2026-01-27 13:15:49 +08:00
Henry Li
cd63f41b4c
feat: support static website
2026-01-24 18:01:27 +08:00
Henry Li
7d4d706738
feat: put all options into '+'
2026-01-22 13:43:45 +08:00
Henry Li
1e4e51a80c
feat: add Todos
2026-01-22 00:26:11 +08:00
Henry Li
11c562eb98
refactor: move
2026-01-21 10:46:43 +08:00
Henry Li
48742d1b59
feat: add code editor
2026-01-21 09:33:33 +08:00
Henry Li
7c6eb4cc8b
feat: enlarge shadow
2026-01-21 08:52:30 +08:00
Henry Li
b8f9678d07
feat: use code block to display bash commands
2026-01-19 21:59:23 +08:00
Henry Li
69b225082b
feat: re-implement message group
2026-01-18 19:56:07 +08:00
Henry Li
dd80348b76
feat: support SSE write_file(0
2026-01-18 17:13:15 +08:00
Henry Li
92fc19a3aa
feat: remove model icon
2026-01-18 09:55:17 +08:00
Henry Li
f1c6991194
feat: integrated with artifacts in states
2026-01-17 17:21:37 +08:00
Henry Li
9d1cf89532
chore: remove unused components
2026-01-17 10:09:43 +08:00
Henry Li
61499624a0
feat: adjust message group layout
2026-01-15 23:56:42 +08:00
Henry Li
c3cb4c348d
feat: remove max-w-
2026-01-15 23:47:28 +08:00
Henry Li
9f2b94ed52
feat: implement basic web app
2026-01-15 23:40:21 +08:00
Henry Li
c628c7f8db
chore: create frontend project from boilerplate
2026-01-14 09:50:26 +08:00