Skip to content

Commit 5014300

Browse files
committed
fix:调整聊天的显示样式
1 parent 6c2fe63 commit 5014300

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

src/metaCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ export async function processFilePlaceholder(messageText: string): Promise<strin
2020
// Replace placeholder with formatted content
2121
return messageText.replace(
2222
filePlaceholderRegex,
23-
`@file:${filePath}\n---------------\n${content}\n---------------\n`
23+
`<FILE_UPLOAD data-path="${filePath}"><content>\n${content}\n</content></FILE_UPLOAD>`
2424
);
2525
} catch (error) {
2626
return messageText.replace(
2727
filePlaceholderRegex,
28-
`@file:${filePath}\n---------------\n**Error reading file**: ${(error as Error).message}\n---------------\n`
28+
`<FILE_UPLOAD data-path="${filePath}">\n**Error reading file**: ${(error as Error).message}\n</FILE_UPLOAD>`
2929
);
3030
}
3131
}

src/resources/chatPanel.css

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ think {
175175
}
176176

177177
tool_call {
178-
display: block;
178+
display: inline-block;
179179
background: rgba(20, 20, 30, 0.95);
180180
border: 1px solid #00b7b7;
181181
border-radius: 8px;
@@ -229,3 +229,24 @@ html, body {
229229
padding-bottom: 10px; /* 防止遮挡 */
230230
box-sizing: border-box;
231231
}
232+
233+
file_upload content {
234+
display: none;
235+
}
236+
237+
file_upload::before {
238+
content: "File: " attr(data-path);
239+
display: inline-block;
240+
color: #e1ebe5de;
241+
background-color: #119b4aad;
242+
font-style: italic;
243+
margin: 10px 0;
244+
245+
padding: 4px 8px;
246+
border: 2px solid #1e90ff;
247+
border-radius: 6px;
248+
box-shadow:
249+
3px 3px 6px rgba(0, 0, 0, 0.4), /* 更深外阴影 */
250+
inset 2px 2px 3px rgba(255, 255, 255, 0.3), /* 更亮内阴影 */
251+
inset -2px -2px 3px rgba(0, 0, 0, 0.2); /* 内阴影加深 */
252+
}

0 commit comments

Comments
 (0)