Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
bit-pm
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
燕伟桐
bit-pm
Commits
d651a6aa
提交
d651a6aa
authored
4月 23, 2025
作者:
Will Chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
max height for proposal details
上级
3b2fb12d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
126 行增加
和
103 行删除
+126
-103
ChatInput.tsx
src/components/chat/ChatInput.tsx
+126
-103
没有找到文件。
src/components/chat/ChatInput.tsx
浏览文件 @
d651a6aa
...
@@ -345,6 +345,19 @@ function ChatInputActions({
...
@@ -345,6 +345,19 @@ function ChatInputActions({
const
otherFilesChanged
=
const
otherFilesChanged
=
proposal
.
filesChanged
?.
filter
((
f
:
FileChange
)
=>
!
f
.
isServerFunction
)
??
[];
proposal
.
filesChanged
?.
filter
((
f
:
FileChange
)
=>
!
f
.
isServerFunction
)
??
[];
function
formatTitle
({
title
,
isDetailsVisible
,
}:
{
title
:
string
;
isDetailsVisible
:
boolean
;
})
{
if
(
isDetailsVisible
)
{
return
title
;
}
return
title
.
slice
(
0
,
60
)
+
"..."
;
}
return
(
return
(
<
div
className=
"border-b border-border"
>
<
div
className=
"border-b border-border"
>
<
div
className=
"p-2"
>
<
div
className=
"p-2"
>
...
@@ -360,7 +373,9 @@ function ChatInputActions({
...
@@ -360,7 +373,9 @@ function ChatInputActions({
)
:
(
)
:
(
<
ChevronDown
size=
{
16
}
className=
"mr-1 flex-shrink-0"
/>
<
ChevronDown
size=
{
16
}
className=
"mr-1 flex-shrink-0"
/>
)
}
)
}
<
span
className=
"font-medium"
>
{
proposal
.
title
}
</
span
>
<
span
className=
"font-medium"
>
{
formatTitle
({
title
:
proposal
.
title
,
isDetailsVisible
})
}
</
span
>
</
div
>
</
div
>
<
div
className=
"text-xs text-muted-foreground ml-6"
>
<
div
className=
"text-xs text-muted-foreground ml-6"
>
<
ProposalSummary
<
ProposalSummary
...
@@ -414,112 +429,120 @@ function ChatInputActions({
...
@@ -414,112 +429,120 @@ function ChatInputActions({
</
div
>
</
div
>
</
div
>
</
div
>
{
isDetailsVisible
&&
(
<
div
className=
"overflow-y-auto max-h-[calc(100vh-300px)]"
>
<
div
className=
"p-3 border-t border-border bg-muted/50 text-sm"
>
{
isDetailsVisible
&&
(
{
!!
proposal
.
securityRisks
.
length
&&
(
<
div
className=
"p-3 border-t border-border bg-muted/50 text-sm"
>
<
div
className=
"mb-3"
>
{
!!
proposal
.
securityRisks
.
length
&&
(
<
h4
className=
"font-semibold mb-1"
>
Security Risks
</
h4
>
<
div
className=
"mb-3"
>
<
ul
className=
"space-y-1"
>
<
h4
className=
"font-semibold mb-1"
>
Security Risks
</
h4
>
{
proposal
.
securityRisks
.
map
((
risk
,
index
)
=>
(
<
ul
className=
"space-y-1"
>
<
li
key=
{
index
}
className=
"flex items-start space-x-2"
>
{
proposal
.
securityRisks
.
map
((
risk
,
index
)
=>
(
{
risk
.
type
===
"warning"
?
(
<
li
key=
{
index
}
className=
"flex items-start space-x-2"
>
<
AlertTriangle
{
risk
.
type
===
"warning"
?
(
size=
{
16
}
<
AlertTriangle
className=
"text-yellow-500 mt-0.5 flex-shrink-0"
size=
{
16
}
/>
className=
"text-yellow-500 mt-0.5 flex-shrink-0"
)
:
(
/>
<
AlertOctagon
)
:
(
size=
{
16
}
<
AlertOctagon
className=
"text-red-500 mt-0.5 flex-shrink-0"
size=
{
16
}
/>
className=
"text-red-500 mt-0.5 flex-shrink-0"
)
}
/>
<
div
>
)
}
<
span
className=
"font-medium"
>
{
risk
.
title
}
:
</
span
>
{
" "
}
<
div
>
<
span
>
{
risk
.
description
}
</
span
>
<
span
className=
"font-medium"
>
{
risk
.
title
}
:
</
span
>
{
" "
}
</
div
>
<
span
>
{
risk
.
description
}
</
span
>
</
li
>
</
div
>
))
}
</
li
>
</
ul
>
))
}
</
div
>
</
ul
>
)
}
</
div
>
)
}
{
proposal
.
sqlQueries
?.
length
>
0
&&
(
{
proposal
.
sqlQueries
?.
length
>
0
&&
(
<
div
className=
"mb-3"
>
<
div
className=
"mb-3"
>
<
h4
className=
"font-semibold mb-1"
>
SQL Queries
</
h4
>
<
h4
className=
"font-semibold mb-1"
>
SQL Queries
</
h4
>
<
ul
className=
"space-y-2"
>
<
ul
className=
"space-y-2"
>
{
proposal
.
sqlQueries
.
map
((
query
,
index
)
=>
(
{
proposal
.
sqlQueries
.
map
((
query
,
index
)
=>
(
<
SqlQueryItem
key=
{
index
}
query=
{
query
}
/>
<
SqlQueryItem
key=
{
index
}
query=
{
query
}
/>
))
}
))
}
</
ul
>
</
ul
>
</
div
>
</
div
>
)
}
)
}
{
proposal
.
packagesAdded
?.
length
>
0
&&
(
{
proposal
.
packagesAdded
?.
length
>
0
&&
(
<
div
className=
"mb-3"
>
<
div
className=
"mb-3"
>
<
h4
className=
"font-semibold mb-1"
>
Packages Added
</
h4
>
<
h4
className=
"font-semibold mb-1"
>
Packages Added
</
h4
>
<
ul
className=
"space-y-1"
>
<
ul
className=
"space-y-1"
>
{
proposal
.
packagesAdded
.
map
((
pkg
,
index
)
=>
(
{
proposal
.
packagesAdded
.
map
((
pkg
,
index
)
=>
(
<
li
<
li
key=
{
index
}
key=
{
index
}
className=
"flex items-center space-x-2"
className=
"flex items-center space-x-2"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
IpcClient
.
getInstance
().
openExternalUrl
(
IpcClient
.
getInstance
().
openExternalUrl
(
`https://www.npmjs.com/package/${pkg}`
`https://www.npmjs.com/package/${pkg}`
);
);
}
}
}
}
>
>
<
Package
<
Package
size=
{
16
}
size=
{
16
}
className=
"text-muted-foreground flex-shrink-0"
className=
"text-muted-foreground flex-shrink-0"
/>
/>
<
span
className=
"cursor-pointer text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
>
<
span
className=
"cursor-pointer text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
>
{
pkg
}
{
pkg
}
</
span
>
</
span
>
</
li
>
</
li
>
))
}
))
}
</
ul
>
</
ul
>
</
div
>
</
div
>
)
}
)
}
{
serverFunctions
.
length
>
0
&&
(
{
serverFunctions
.
length
>
0
&&
(
<
div
className=
"mb-3"
>
<
div
className=
"mb-3"
>
<
h4
className=
"font-semibold mb-1"
>
Server Functions Changed
</
h4
>
<
h4
className=
"font-semibold mb-1"
>
Server Functions Changed
</
h4
>
<
ul
className=
"space-y-1"
>
<
ul
className=
"space-y-1"
>
{
serverFunctions
.
map
((
file
:
FileChange
,
index
:
number
)
=>
(
{
serverFunctions
.
map
((
file
:
FileChange
,
index
:
number
)
=>
(
<
li
key=
{
index
}
className=
"flex items-center space-x-2"
>
<
li
key=
{
index
}
className=
"flex items-center space-x-2"
>
{
getIconForFileChange
(
file
)
}
{
getIconForFileChange
(
file
)
}
<
span
title=
{
file
.
path
}
className=
"truncate cursor-default"
>
<
span
{
file
.
name
}
title=
{
file
.
path
}
</
span
>
className=
"truncate cursor-default"
<
span
className=
"text-muted-foreground text-xs truncate"
>
>
-
{
file
.
summary
}
{
file
.
name
}
</
span
>
</
span
>
</
li
>
<
span
className=
"text-muted-foreground text-xs truncate"
>
))
}
-
{
file
.
summary
}
</
ul
>
</
span
>
</
div
>
</
li
>
)
}
))
}
</
ul
>
</
div
>
)
}
{
otherFilesChanged
.
length
>
0
&&
(
{
otherFilesChanged
.
length
>
0
&&
(
<
div
>
<
div
>
<
h4
className=
"font-semibold mb-1"
>
Files Changed
</
h4
>
<
h4
className=
"font-semibold mb-1"
>
Files Changed
</
h4
>
<
ul
className=
"space-y-1"
>
<
ul
className=
"space-y-1"
>
{
otherFilesChanged
.
map
((
file
:
FileChange
,
index
:
number
)
=>
(
{
otherFilesChanged
.
map
((
file
:
FileChange
,
index
:
number
)
=>
(
<
li
key=
{
index
}
className=
"flex items-center space-x-2"
>
<
li
key=
{
index
}
className=
"flex items-center space-x-2"
>
{
getIconForFileChange
(
file
)
}
{
getIconForFileChange
(
file
)
}
<
span
title=
{
file
.
path
}
className=
"truncate cursor-default"
>
<
span
{
file
.
name
}
title=
{
file
.
path
}
</
span
>
className=
"truncate cursor-default"
<
span
className=
"text-muted-foreground text-xs truncate"
>
>
-
{
file
.
summary
}
{
file
.
name
}
</
span
>
</
span
>
</
li
>
<
span
className=
"text-muted-foreground text-xs truncate"
>
))
}
-
{
file
.
summary
}
</
ul
>
</
span
>
</
div
>
</
li
>
)
}
))
}
</
div
>
</
ul
>
)
}
</
div
>
)
}
</
div
>
)
}
</
div
>
</
div
>
</
div
>
);
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论