fix: resolve multiple issues and performance enhancement

Fix performance issue, Telegram prefix, and two encoding bugs; update custom prompt UI.

Co-authored-by: Jason <159670257+Jasonzhu1207@users.noreply.github.com>
This commit is contained in:
v0
2026-04-06 10:55:30 +00:00
parent a52619c4d5
commit 9adffc3cd7
2 changed files with 28 additions and 17 deletions

View File

@@ -1467,7 +1467,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
</div>
<div className="form-group quote-layout-group">
<label><EFBFBD><EFBFBD><EFBFBD></label>
<label></label>
<span className="form-hint"></span>
<div className="quote-layout-picker" role="radiogroup" aria-label="引用样式选择">
{[
@@ -2825,6 +2825,10 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
2. 控制在 80 字以内,直接、具体、一针见血。不要废话。
3. 输出纯文本,不使用 Markdown。
4. 只有在完全没有任何可说的内容时(比如对话只有一条"嗯"),才回复"SKIP"。绝大多数情况下你应该输出见解。`
// 展示值:有自定义内容时显示自定义内容,否则显示默认值(可直接编辑)
const displayValue = aiInsightSystemPrompt || DEFAULT_SYSTEM_PROMPT
return (
<div className="form-group">
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 6 }}>
@@ -2833,6 +2837,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
className="button-secondary"
style={{ fontSize: 12, padding: '3px 10px' }}
onClick={async () => {
// 恢复默认清空自定义值UI 回到显示默认内容的状态
setAiInsightSystemPrompt('')
await configService.setAiInsightSystemPrompt('')
}}
@@ -2841,16 +2846,16 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
</button>
</div>
<span className="form-hint">
使
</span>
<textarea
className="field-input"
rows={8}
style={{ width: '100%', resize: 'vertical', fontFamily: 'monospace', fontSize: 12 }}
placeholder={DEFAULT_SYSTEM_PROMPT}
value={aiInsightSystemPrompt}
value={displayValue}
onChange={(e) => {
const val = e.target.value
// 如果用户把内容改得和默认值一样,仍存自定义值(不影响功能)
setAiInsightSystemPrompt(val)
scheduleConfigSave('aiInsightSystemPrompt', () => configService.setAiInsightSystemPrompt(val))
}}
@@ -3117,7 +3122,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
<p className="api-desc" style={{ lineHeight: 1.7 }}>
<strong></strong> 500ms <br />
<strong></strong> 4 <br />
<strong></strong> <EFBFBD><EFBFBD>AI AI <br />
<strong></strong> AI AI <br />
<strong></strong> API WeFlow
</p>
</div>