Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
8537a077
Commit
8537a077
authored
Dec 18, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:分割线展示
parent
be60ab98
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
src/pages/ChatTactics/TacticsChat.tsx
+6
-3
No files found.
src/pages/ChatTactics/TacticsChat.tsx
View file @
8537a077
...
...
@@ -393,10 +393,12 @@ export const TacticsChat: React.FC = () => {
const
shouldIncludeQuestion
=
extra
?.
includeQuestion
!==
false
&&
!!
question
const
isReanalyze
=
extra
?.
isReanalyze
===
true
// 重新分析时,在添加新记录之前计算分割线位置
// 分割线应该显示在
历史
记录之后、新记录之前
// 分割线应该显示在
已有对话
记录之后、新记录之前
// 渲染时使用 divider.index === index + 1 来匹配,所以分割线的 index 应该是新记录的位置
// 只有当存在历史记录时,才显示分割线
if
(
isReanalyze
&&
hasHistory
===
true
)
{
// 判断 allItems 中是否存在除了 system 之外的记录(user 或 ai)
if
(
isReanalyze
)
{
const
hasExistingRecords
=
allItems
.
some
(
item
=>
item
.
role
!==
'system'
)
if
(
hasExistingRecords
)
{
// 基于当前 allItems 长度计算分割线位置
// 分割线会在新添加的第一个记录之前显示(即 prevItems.length + 1)
const
nextDividerIndex
=
allItems
.
length
+
1
...
...
@@ -409,6 +411,7 @@ export const TacticsChat: React.FC = () => {
return
[...
prev
,
{
index
:
nextDividerIndex
,
time
:
currentTime
}]
})
}
}
setAllItems
(
prevItems
=>
[
...
prevItems
,
...(
shouldIncludeQuestion
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment