deerflow2/frontend/src/components/workspace
ruitanglin 59c8fec7e7 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
..
artifacts refactor(frontend): consolidate citation logic, slim exports and impl 2026-02-09 15:58:59 +08:00
messages refactor(frontend): consolidate citation logic, slim exports and impl 2026-02-09 15:58:59 +08:00
settings fix(frontend): build + remove hover tooltips in step links 2026-02-09 03:42:16 +08:00
code-editor.tsx fix: fix eslint errors and warnings 2026-01-31 21:46:31 +08:00
copy-button.tsx feat: implement i18n 2026-01-20 14:06:47 +08:00
flip-display.tsx feat: re-implement message group 2026-01-18 19:56:07 +08:00
github-icon.tsx feat: implement basic web app 2026-01-15 23:40:21 +08:00
input-box.tsx feat(frontend): add mode hover guide and adjust mode i18n 2026-02-09 12:33:16 +08:00
mode-hover-guide.tsx feat(frontend): add mode hover guide and adjust mode i18n 2026-02-09 12:33:16 +08:00
overscroll.tsx feat: implement basic web app 2026-01-15 23:40:21 +08:00
recent-chat-list.tsx feat: add inline citations and thread management features 2026-01-28 19:15:11 +08:00
streaming-indicator.tsx feat: implement basic web app 2026-01-15 23:40:21 +08:00
thread-title.tsx feat: extract ThreadTitle component 2026-01-17 17:37:12 +08:00
todo-list.tsx feat: show `in-progress` 2026-01-22 11:56:45 +08:00
tooltip.tsx feat: adjust layout and style of tooltip 2026-01-16 19:51:14 +08:00
welcome.tsx feat: make the title golden in Ultra mode 2026-02-09 08:59:40 +08:00
workspace-container.tsx feat: implement i18n 2026-01-20 14:06:47 +08:00
workspace-header.tsx feat: update workspace header to conditionally render title based on environment variable 2026-02-09 09:20:32 +08:00
workspace-nav-chat-list.tsx feat: add main menu 2026-01-22 14:19:54 +08:00
workspace-nav-menu.tsx feat: enhance workspace navigation menu with conditional rendering and mounted state 2026-02-07 11:10:24 +08:00
workspace-sidebar.tsx fix: hide chats when sidebar is not open 2026-01-27 10:41:08 +08:00