@@ -79,6 +79,7 @@ interface DialogRound {
7979 elementRef ?: React . RefObject < HTMLDivElement > ;
8080 knowledgeEntries ?: string [ ] ;
8181 fileOperations ?: FileOperation [ ] ;
82+ hideUserInput ?: boolean ; // 是否隐藏用户输入气泡
8283}
8384
8485// 自定义代码块组件
@@ -416,6 +417,7 @@ export default function AIagent({
416417 userInput : initialPrompt ,
417418 aiResponse : "" ,
418419 files : relevantFiles ,
420+ hideUserInput : true , // 隐藏第一轮用户输入气泡
419421 } ;
420422
421423 setDialogRounds ( [ newRound ] ) ;
@@ -1473,31 +1475,33 @@ false
14731475 < div className = "flex flex-col space-y-4 mb-4" >
14741476 { dialogRounds . map ( ( round , index ) => (
14751477 < div key = { index } className = "flex flex-col space-y-2" >
1476- { /* 用户输入 */ }
1477- < div className = "bg-blue-50 dark:bg-blue-900/30 p-3 rounded-lg" >
1478- < div className = "flex items-center mb-2" >
1479- < div className = "w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center text-white mr-2" >
1480- < svg
1481- xmlns = "http://www.w3.org/2000/svg"
1482- className = "h-5 w-5"
1483- viewBox = "0 0 20 20"
1484- fill = "currentColor"
1485- >
1486- < path
1487- fillRule = "evenodd"
1488- d = "M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
1489- clipRule = "evenodd"
1490- />
1491- </ svg >
1478+ { /* 用户输入 - 只有当hideUserInput为false或未定义时才显示 */ }
1479+ { ! round . hideUserInput && (
1480+ < div className = "bg-blue-50 dark:bg-blue-900/30 p-3 rounded-lg" >
1481+ < div className = "flex items-center mb-2" >
1482+ < div className = "w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center text-white mr-2" >
1483+ < svg
1484+ xmlns = "http://www.w3.org/2000/svg"
1485+ className = "h-5 w-5"
1486+ viewBox = "0 0 20 20"
1487+ fill = "currentColor"
1488+ >
1489+ < path
1490+ fillRule = "evenodd"
1491+ d = "M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
1492+ clipRule = "evenodd"
1493+ />
1494+ </ svg >
1495+ </ div >
1496+ < div className = "font-medium text-blue-700 dark:text-blue-300" >
1497+ { t ( "aiagent.user" ) }
1498+ </ div >
14921499 </ div >
1493- < div className = "font-medium text-blue -700 dark:text-blue-300 " >
1494- { t ( "aiagent.user" ) }
1500+ < div className = "text-gray -700 dark:text-gray-200 ml-10 " >
1501+ { round . userInput }
14951502 </ div >
14961503 </ div >
1497- < div className = "text-gray-700 dark:text-gray-200 ml-10" >
1498- { round . userInput }
1499- </ div >
1500- </ div >
1504+ ) }
15011505
15021506 { /* AI响应 */ }
15031507 < div
@@ -1659,23 +1663,45 @@ false
16591663 < p className = "text-gray-600 dark:text-gray-300 text-center mb-6" >
16601664 { t ( "aiagent.permissionDescription" ) }
16611665 </ p >
1662- < div className = "bg-yellow-50 dark:bg-yellow-900/30 p-3 rounded-lg mb-6 w-full" >
1663- < div className = "flex items-start" >
1664- < svg
1665- xmlns = "http://www.w3.org/2000/svg"
1666- className = "h-5 w-5 text-yellow-500 mt-0.5 mr-2 flex-shrink-0"
1667- viewBox = "0 0 20 20"
1668- fill = "currentColor"
1669- >
1670- < path
1671- fillRule = "evenodd"
1672- d = "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
1673- clipRule = "evenodd"
1674- />
1675- </ svg >
1676- < p className = "text-sm text-yellow-700 dark:text-yellow-200" >
1677- { t ( "aiagent.permissionWarning" ) }
1678- </ p >
1666+ < div className = "space-y-3 mb-6 w-full" >
1667+ < div className = "bg-yellow-50 dark:bg-yellow-900/30 p-3 rounded-lg" >
1668+ < div className = "flex items-start" >
1669+ < svg
1670+ xmlns = "http://www.w3.org/2000/svg"
1671+ className = "h-5 w-5 text-yellow-500 mt-0.5 mr-2 flex-shrink-0"
1672+ viewBox = "0 0 20 20"
1673+ fill = "currentColor"
1674+ >
1675+ < path
1676+ fillRule = "evenodd"
1677+ d = "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
1678+ clipRule = "evenodd"
1679+ />
1680+ </ svg >
1681+ < p className = "text-sm text-yellow-700 dark:text-yellow-200" >
1682+ { t ( "aiagent.permissionWarning" ) }
1683+ </ p >
1684+ </ div >
1685+ </ div >
1686+
1687+ < div className = "bg-blue-50 dark:bg-blue-900/30 p-3 rounded-lg" >
1688+ < div className = "flex items-start" >
1689+ < svg
1690+ xmlns = "http://www.w3.org/2000/svg"
1691+ className = "h-5 w-5 text-blue-500 mt-0.5 mr-2 flex-shrink-0"
1692+ viewBox = "0 0 20 20"
1693+ fill = "currentColor"
1694+ >
1695+ < path
1696+ fillRule = "evenodd"
1697+ d = "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z"
1698+ clipRule = "evenodd"
1699+ />
1700+ </ svg >
1701+ < p className = "text-sm text-blue-700 dark:text-blue-200" >
1702+ { t ( "aiagent.indexingReminder" ) }
1703+ </ p >
1704+ </ div >
16791705 </ div >
16801706 </ div >
16811707 < div className = "flex space-x-4" >
0 commit comments