chore: icon file & history message (#240)

* chore: icon file & fetch_source、pick_source、deep_read

* chore: message Timeout
This commit is contained in:
BiggerRain
2025-03-04 22:05:36 +08:00
committed by GitHub
parent 3aa433f1da
commit 3305298d29
9 changed files with 73 additions and 51 deletions

View File

@@ -201,7 +201,7 @@ const ChatAI = memo(
setTimedoutShow(true);
cancelChat();
}
}, 30000);
}, 60000);
if (msg.includes("assistant finished output")) {
clearTimeout(messageTimeoutRef.current);

View File

@@ -19,10 +19,11 @@ export const DeepRead = ({ Detail, ChunkData }: DeepReadeProps) => {
const [prevContent, setPrevContent] = useState("");
const [Data, setData] = useState<string[]>([]);
const [description, setDescription] = useState("");
useEffect(() => {
if (!Detail?.description) return;
setData(Detail?.description);
setDescription(Detail?.description);
setLoading(false);
}, [Detail?.description]);
@@ -67,16 +68,25 @@ export const DeepRead = ({ Detail, ChunkData }: DeepReadeProps) => {
<>
<Loader className="w-4 h-4 animate-spin text-[#1990FF]" />
<span className="text-xs text-[#999999] italic">
{t(`assistant.message.steps.${ChunkData?.chunk_type}`)}
{t(
`assistant.message.steps.${
ChunkData?.chunk_type || Detail?.type
}`
)}
</span>
</>
) : (
<>
<ReadingIcon className="w-4 h-4 text-[#38C200]" />
<span className="text-xs text-[#999999]">
{t(`assistant.message.steps.${ChunkData?.chunk_type}`, {
count: Number(Data.length),
})}
{t(
`assistant.message.steps.${
ChunkData?.chunk_type || Detail?.type
}`,
{
count: Number(Data.length),
}
)}
</span>
</>
)}
@@ -97,6 +107,14 @@ export const DeepRead = ({ Detail, ChunkData }: DeepReadeProps) => {
</div>
</div>
))}
{description?.split("\n").map(
(paragraph, idx) =>
paragraph.trim() && (
<p key={idx} className="text-sm">
{paragraph}
</p>
)
)}
</div>
</div>
</div>

View File

@@ -43,6 +43,7 @@ export const FetchSource = ({ Detail, ChunkData }: FetchSourceProps) => {
useEffect(() => {
if (!Detail?.payload) return;
setData(Detail?.payload);
setTotal(Detail?.payload.length);
}, [Detail?.payload]);
useEffect(() => {
@@ -88,7 +89,7 @@ export const FetchSource = ({ Detail, ChunkData }: FetchSourceProps) => {
<div className="flex-1 min-w-0 flex items-center gap-2">
<RetrieveIcon className="w-4 h-4 text-[#38C200] flex-shrink-0" />
<span className="text-xs text-[#999999]">
{t(`assistant.message.steps.${ChunkData?.chunk_type}`, {
{t(`assistant.message.steps.${ChunkData?.chunk_type || Detail.type }`, {
count: Number(total),
})}
</span>

View File

@@ -105,7 +105,7 @@ export const PickSource = ({ Detail, ChunkData }: PickSourceProps) => {
<>
<SelectionIcon className="w-4 h-4 text-[#38C200]" />
<span className="text-xs text-[#999999]">
{t(`assistant.message.steps.${ChunkData?.chunk_type}`, {
{t(`assistant.message.steps.${ChunkData?.chunk_type || Detail.type }`, {
count: Data?.length,
})}
</span>

View File

@@ -36,6 +36,9 @@ export const QueryIntent = ({
useEffect(() => {
if (!Detail?.payload) return;
setData(Detail?.payload);
if (Detail?.payload?.suggestion && getSuggestion) {
getSuggestion(Detail?.payload?.suggestion);
}
setLoading(false);
}, [Detail?.payload]);

View File

@@ -6,14 +6,14 @@ export default function Reading(props: I.SVG) {
<g
id="deading"
stroke="none"
stroke-width="1"
strokeWidth="1"
fill="none"
fill-rule="evenodd"
fillRule="evenodd"
>
<circle
id="椭圆形"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
cx="8"
cy="3"
r="1.375"
@@ -21,7 +21,7 @@ export default function Reading(props: I.SVG) {
<circle
id="椭圆形备份-2"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
cx="3"
cy="5"
r="1.375"
@@ -29,7 +29,7 @@ export default function Reading(props: I.SVG) {
<circle
id="椭圆形备份-4"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
cx="13"
cy="5"
r="1.375"
@@ -37,7 +37,7 @@ export default function Reading(props: I.SVG) {
<circle
id="椭圆形备份"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
cx="8"
cy="13"
r="1.375"
@@ -45,7 +45,7 @@ export default function Reading(props: I.SVG) {
<circle
id="椭圆形备份-3"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
cx="3"
cy="11"
r="1.375"
@@ -53,7 +53,7 @@ export default function Reading(props: I.SVG) {
<circle
id="椭圆形备份-5"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
cx="13"
cy="11"
r="1.375"
@@ -62,7 +62,7 @@ export default function Reading(props: I.SVG) {
d="M8.0070039,4.03345364 L8.0070039,8.50590493 L4.1923477,10.2855921"
id="路径-13"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
></path>
<line
x1="11.7924093"
@@ -71,14 +71,14 @@ export default function Reading(props: I.SVG) {
y2="10.2754456"
id="路径-13备份"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
transform="translate(9.8962, 9.3755) scale(-1, 1) translate(-9.8962, -9.3755)"
></line>
<path
d="M4.17568738,4.53038288 L6.65384701,3.54050563 M9.35480875,3.53987819 L11.7283558,4.49062879"
id="形状"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
></path>
<line
x1="3"
@@ -87,7 +87,7 @@ export default function Reading(props: I.SVG) {
y2="9.97988046"
id="路径-14"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
></line>
<line
x1="13"
@@ -96,7 +96,7 @@ export default function Reading(props: I.SVG) {
y2="9.97988046"
id="路径-14备份"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
></line>
</g>
</SVGWrap>

View File

@@ -6,11 +6,11 @@ export default function Retrieve(props: I.SVG) {
<g
id="Retrieve"
stroke="none"
stroke-width="1"
strokeWidth="1"
fill="none"
fill-rule="evenodd"
stroke-linecap="round"
stroke-linejoin="round"
fillRule="evenodd"
strokeLinecap="round"
strokeLinejoin="round"
>
<line
x1="10.8977456"
@@ -19,13 +19,13 @@ export default function Retrieve(props: I.SVG) {
y2="10.9204757"
id="路径"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
transform="translate(12.4489, 12.7102) scale(-1, 1) translate(-12.4489, -12.7102)"
></line>
<circle
id="椭圆形"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
transform="translate(7.5, 7) scale(-1, 1) translate(-7.5, -7)"
cx="7.5"
cy="7"

View File

@@ -6,15 +6,15 @@ export default function Selection(props: I.SVG) {
<g
id="selection"
stroke="none"
stroke-width="1"
strokeWidth="1"
fill="none"
fill-rule="evenodd"
fillRule="evenodd"
>
<g
id="编组"
transform="translate(1.4813, 1)"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
>
<line
x1="6.7986538"
@@ -22,8 +22,8 @@ export default function Selection(props: I.SVG) {
x2="6.7986538"
y2="2.07241631e-17"
id="路径"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
></line>
<circle
id="椭圆形"
@@ -38,8 +38,8 @@ export default function Selection(props: I.SVG) {
x2="4.62042688"
y2="8.89822692"
id="路径"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
></line>
<line
x1="10.1008425"
@@ -47,8 +47,8 @@ export default function Selection(props: I.SVG) {
x2="10.1008425"
y2="2.66781133"
id="路径"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
transform="translate(10.1008, 3.4178) rotate(45) translate(-10.1008, -3.4178)"
></line>
<line
@@ -57,8 +57,8 @@ export default function Selection(props: I.SVG) {
x2="12.1186538"
y2="5.32"
id="路径"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
transform="translate(12.1187, 6.72) rotate(90) translate(-12.1187, -6.72)"
></line>
<line
@@ -67,8 +67,8 @@ export default function Selection(props: I.SVG) {
x2="10.1008425"
y2="9.27218867"
id="路径"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
transform="translate(10.1008, 10.0222) rotate(135) translate(-10.1008, -10.0222)"
></line>
<line
@@ -77,8 +77,8 @@ export default function Selection(props: I.SVG) {
x2="6.7986538"
y2="10.64"
id="路径"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
transform="translate(6.7987, 12.04) rotate(180) translate(-6.7987, -12.04)"
></line>
<line
@@ -87,8 +87,8 @@ export default function Selection(props: I.SVG) {
x2="1.4786538"
y2="5.32"
id="路径"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
transform="translate(1.4787, 6.72) rotate(270) translate(-1.4787, -6.72)"
></line>
<line
@@ -97,8 +97,8 @@ export default function Selection(props: I.SVG) {
x2="3.49646513"
y2="2.66781133"
id="路径"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
transform="translate(3.4965, 3.4178) rotate(315) translate(-3.4965, -3.4178)"
></line>
</g>

View File

@@ -6,17 +6,17 @@ export default function Understand(props: I.SVG) {
<g
id="Understand"
stroke="none"
stroke-width="1"
strokeWidth="1"
fill="none"
fill-rule="evenodd"
stroke-linecap="round"
stroke-linejoin="round"
fillRule="evenodd"
strokeLinecap="round"
strokeLinejoin="round"
>
<g
id="编组"
transform="translate(0.5, 0.5)"
stroke="currentColor"
stroke-width="1.25"
strokeWidth="1.25"
>
<path
d="M7.44444444,3 C9.89904333,3 11.8888889,4.95366655 11.8888889,7.36363636 C11.8888889,9.06711551 10.8946979,10.5426108 9.44492275,11.2613085 L9.44444444,12.2727273 C9.44444444,13.3772968 8.54901394,14.2727273 7.44444444,14.2727273 C6.33987494,14.2727273 5.44444444,13.3772968 5.44444444,12.2727273 L5.44396614,11.2613085 C3.99419095,10.5426108 3,9.06711551 3,7.36363636 C3,4.95366655 4.98984556,3 7.44444444,3 Z"