Commit Graph

53 Commits

Author SHA1 Message Date
ruitanglin
53509eaeb1 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
d197ee8f28 feat: add mode in welcome 2026-02-09 00:41:25 +08:00
Henry Li
46798c0931 feat: support subtasks 2026-02-07 16:14:48 +08:00
hetao
96baab12a2 feat: add ultra mode 2026-02-06 17:48:14 +08:00
Henry Li
dedfa1bfb5 feat: adjust position 2026-02-06 09:39:20 +08:00
Henry Li
268b7f911c fix: fix position 2026-02-02 16:40:43 +08:00
Henry Li
8bc9d1b226 fix: set default state for todo list collapse to true 2026-02-02 14:46:26 +08:00
Henry Li
e01127eec9 fix: set default state for todo list collapse to false 2026-02-02 14:46:10 +08:00
Henry Li
b5e9eeea99 feat: update button styling for artifacts tooltip 2026-02-02 11:43:02 +08:00
Henry Li
b1227bb911 feat: integrate PromptInputProvider into ChatLayout and utilize prompt input controller in ChatPage 2026-02-02 10:18:02 +08:00
Henry Li
f1db301d77 feat: add file icons 2026-02-02 10:02:31 +08:00
Henry Li
1eb4da6c75 feat: dynamic title 2026-02-02 09:05:24 +08:00
Henry Li
67ec1162cb feat: implement create skill 2026-01-31 22:31:25 +08:00
Henry Li
9c3b928f1d feat: preview the message if possible 2026-01-31 20:22:15 +08:00
Henry Li
c62caf95c4 feat: add notification 2026-01-31 11:08:27 +08:00
Henry Li
21e12d91eb fix: fix condition of displaying artifacts 2026-01-30 21:51:18 +08:00
Henry Li
98e08a85c9 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
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
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
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
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
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
Henry Li
9d64c7e076 feat: integrated with artifacts 2026-01-17 00:02:03 +08:00
Henry Li
6464a67230 feat: remember sidebar state 2026-01-16 23:03:39 +08:00
Henry Li
93a231cfb1 feat: integrated with artifact resizable 2026-01-16 21:55:31 +08:00
Henry Li
03f0e3f0c7 refactor: move biz logic to core 2026-01-16 19:51:39 +08:00
Henry Li
faf80bb429 feat: rename 'model' to 'model_name' 2026-01-16 14:03:34 +08:00
Henry Li
028f402ff5 feat: store the local settings 2026-01-16 09:55:02 +08:00
Henry Li
3f2bfded41 feat: enable edit context options 2026-01-16 09:37:04 +08:00
Henry Li
956f8f0cfb refactor: rename 2026-01-16 09:15:04 +08:00