Commit Graph

61 Commits

Author SHA1 Message Date
LofiSu d9a86c10e8 fix(frontend): no half-finished citations, correct state when SSE ends
Citations:
- In shouldShowCitationLoading, treat any unreplaced [cite-N] in cleanContent
  as show-loading (no body). Fixes Ultra and other modes when refs arrive
  before the <citations> block in the stream.
- Single rule: hasUnreplacedCitationRefs(cleanContent) => true forces loading;
  then isLoading && hasCitationsBlock(rawContent) for streaming indicator.

SSE end state:
- When stream finishes, SDK may set isLoading=false before client state has
  the final message content, so UI stayed wrong until refresh.
- Store onFinish(state) as finalState in chat page; clear when stream starts.
- Pass messagesOverride={finalState.messages} to MessageList when not loading
  so the list uses server-complete messages right after SSE ends (no refresh).

Chore:
- Stop tracking .githooks/pre-commit; add .githooks/ to .gitignore (local only).

Co-authored-by: Cursor <cursoragent@cursor.com>

---
fix(前端): 杜绝半成品引用,SSE 结束时展示正确状态

引用:
- shouldShowCitationLoading 中只要 cleanContent 仍含未替换的 [cite-N] 就
  只显示加载、不渲染正文,解决流式时引用块未到就出现 [cite-1] 的问题。
- 规则:hasUnreplacedCitationRefs(cleanContent) 为真则一律显示加载;
  此外 isLoading && hasCitationsBlock 用于流式时显示「正在整理引用」。

SSE 结束状态:
- 流结束时 SDK 可能先置 isLoading=false,客户端 messages 尚未包含
  最终内容,导致需刷新才显示正确。
- 在对话页保存 onFinish(state) 为 finalState,流开始时清空。
- 非加载时向 MessageList 传入 messagesOverride={finalState.messages},
  列表在 SSE 结束后立即用服务端完整消息渲染,无需刷新。

杂项:
- 取消跟踪 .githooks/pre-commit,.gitignore 增加 .githooks/(仅本地)。
2026-02-09 15:15:20 +08:00
Henry Li cebf2599c9 feat: add mode in welcome 2026-02-09 00:41:25 +08:00
Henry Li 3e2883e2a3 feat: support subtasks 2026-02-07 16:14:48 +08:00
hetao 449ffbad75 feat: add ultra mode 2026-02-06 17:48:14 +08:00
Henry Li f391060573 feat: adjust position 2026-02-06 09:39:20 +08:00
hetao b773bae407 fix: fix frontend rendering issue 2026-02-03 19:38:10 +08:00
Henry Li e84715831f fix: fix position 2026-02-02 16:40:43 +08:00
Henry Li 018241c203 fix: set default state for todo list collapse to true 2026-02-02 14:46:26 +08:00
Henry Li 6f6d799051 fix: set default state for todo list collapse to false 2026-02-02 14:46:10 +08:00
Henry Li b7c9bf557b feat: update button styling for artifacts tooltip 2026-02-02 11:43:02 +08:00
Henry Li 6c0e5fffd0 feat: integrate PromptInputProvider into ChatLayout and utilize prompt input controller in ChatPage 2026-02-02 10:18:02 +08:00
Henry Li 867749d7a3 feat: add file icons 2026-02-02 10:02:31 +08:00
Henry Li a0a3a3fc02 feat: dynamic title 2026-02-02 09:05:24 +08:00
Henry Li bdd2e25e14 feat: implement create skill 2026-01-31 22:31:25 +08:00
Henry Li cf961328a9 feat: preview the message if possible 2026-01-31 20:22:15 +08:00
Henry Li 5295f5b5b9 feat: add notification 2026-01-31 11:08:27 +08:00
Henry Li c07c0228f6 fix: fix condition of displaying artifacts 2026-01-30 21:51:18 +08:00
Henry Li 62ac3b6b03 feat: use "mode" instead of "thinking_enabled" and "is_plan_mode" 2026-01-29 15:48:50 +08:00
Henry Li 28361ca03c feat: add scroll indicator 2026-01-27 13:15:49 +08:00
Henry Li 598fed797f fix: many minor fixes 2026-01-25 21:57:57 +08:00
Henry Li c82f705541 fix: fix artifacts in demo mode 2026-01-25 11:42:25 +08:00
Henry Li 03b380cb8b fix: fix auto select first artifact 2026-01-24 23:59:41 +08:00
Henry Li a83e5e238d feat: auto expand in demo mode 2026-01-24 23:51:11 +08:00
Henry Li cae7e67a1f feat: remove over-scroll 2026-01-24 21:14:33 +08:00
Henry Li 930e6bd46f feat: remove background 2026-01-24 18:48:35 +08:00
Henry Li cd63f41b4c feat: support static website 2026-01-24 18:01:27 +08:00
Henry Li e9ab427326 feat: adjust styles 2026-01-22 14:28:10 +08:00
Henry Li 80b07bcac0 feat: update opacities 2026-01-22 13:50:09 +08:00
Henry Li 7d4d706738 feat: put all options into '+' 2026-01-22 13:43:45 +08:00
Henry Li 93842e81a4 feat: adjust styles 2026-01-22 11:42:25 +08:00
Henry Li e8e522c2fe feat: add animations 2026-01-22 09:41:01 +08:00
Henry Li 1e4e51a80c feat: add Todos 2026-01-22 00:26:11 +08:00
Henry Li fbe4d27ddd feat: use `resolvedTheme` instead of `systemTheme` 2026-01-21 10:48:29 +08:00
Henry Li e3d5b4960f feat: adjust colors 2026-01-21 10:35:50 +08:00
Henry Li 26587ee970 feat: bring back the deer 2026-01-21 10:31:54 +08:00
Henry Li d77b9922a6 feat: make artifact "floating" 2026-01-21 08:50:15 +08:00
Henry Li 32a45eb043 feat: implement i18n 2026-01-20 14:06:47 +08:00
Henry Li dd80348b76 feat: support SSE write_file(0 2026-01-18 17:13:15 +08:00
Henry Li 7ea7a7864e feat: use default sidebar width 2026-01-17 22:01:08 +08:00
Henry Li caf761be59 fix: fix z index 2026-01-17 21:34:32 +08:00
Henry Li 094553ea42 feat: change light theme 2026-01-17 20:32:27 +08:00
Henry Li 2bc5f30c4d feat: welcome, again 2026-01-17 19:46:02 +08:00
Henry Li b705a44f3c feat: pull up the input box when creating new thread 2026-01-17 18:02:01 +08:00
Henry Li d8f0f91238 feat: extract ThreadTitle component 2026-01-17 17:37:12 +08:00
Henry Li f1c6991194 feat: integrated with artifacts in states 2026-01-17 17:21:37 +08:00
Henry Li 584eed0166 fix: do not display 'Untitled' 2026-01-17 15:48:43 +08:00
Henry Li 56da1c990a feat: implement '/chats' 2026-01-17 15:44:49 +08:00
Henry Li 962d8f04ec feat: support artifact preview 2026-01-17 15:09:44 +08:00
Henry Li ec5bbf6b51 feat: set artifacts layout 2026-01-17 11:02:33 +08:00
Henry Li 4613d6e16e refactor: rename 2026-01-17 00:05:19 +08:00