优化: 聊天体验批与Web规范合规

This commit is contained in:
lxy
2026-10-05 23:41:32 +08:00
parent 9e81182b4f
commit 28e6acbf3f
41 changed files with 1518 additions and 570 deletions
+5 -1
View File
@@ -27,7 +27,7 @@ export default {
aiStreamRetry: 'Connection interrupted, auto-retrying ({attempt}/{max})…',
// Fatal errors (4xx/auth) are not retryable — prompt user to check settings instead
notRetryable: 'This error cannot be resolved by retrying. Please check the configuration.',
streamInterruptedAfterTool: '⚠ The tool finished, but the following reply was interrupted (no data stream for a long time). You can click Continue to retry.',
streamInterruptedAfterTool: '⚠ The tool finished, but the following reply was interrupted (no data stream for a long time). Click Retry to continue (reruns the whole turn; completed tools will execute again).',
streamInterrupted: '⚠ The response was interrupted (no data stream for a long time). This may be due to a network disconnection or a backend error. Please try again.',
// Light-convergence notice when the watchdog probe reports the backend already finished (only the closing event was lost)
streamFinishedConverged: 'The response was interrupted during finalization and has been converged.',
@@ -45,6 +45,7 @@ export default {
queuedSendFailed: 'Failed to send queued message: {error}',
// UX-P2-A2: toast when queued messages get dropped by error/regenerate/edit (was silent)
queueCleared: 'Cleared {n} queued message(s)',
queueWillContinue: 'Stopped. {n} queued message(s) will still send automatically.',
approvalTimeout: '⚰ Approval timed out, automatically rejected: {toolName}',
// conversation load/switch failure feedback (network jitter/IPC down → empty list/blank, was silent)
loadConvFail: 'Failed to load conversations. Please check your network or backend connection.',
@@ -181,6 +182,9 @@ export default {
echoDirs: '{n} dirs',
echoBudget: 'budget {rounds} rounds / {tokens} tokens / {secs}s',
echoNoBudget: 'no budget limit',
// A12: budget validation field locator; A11: dirty-edit kept notice
budgetInvalidField: '{field} must be a positive integer',
dirtyKept: 'Unsaved edits kept (target conversation switched, verify before confirming)',
},
},
}
+22 -2
View File
@@ -49,6 +49,19 @@ export default {
pinOnTop: 'Pin on top',
unpin: 'Unpin',
closeWindow: 'Close window',
// I9(2026-10-05) text/code file attachment
pickFileTitle: 'Select text/code files',
textFileFilter: 'Text/code files',
fileTooLargeTruncated: 'File too large, truncated on insert',
fileReadFailed: 'Failed to read file, skipped',
shortcutsTitle: 'Keyboard shortcuts',
scNewConv: 'New conversation',
scFocusInput: 'Focus message input',
scRegenerate: 'Regenerate last reply',
scClearChat: 'Clear current conversation',
scSearch: 'Focus conversation search',
scToggleSidebar: 'Toggle sidebar',
scCloseOverlay: 'Close dialog / panel',
// ── Approval overlay (global top-right) ──
approvalWaitingTitle: 'Approval required',
@@ -163,9 +176,10 @@ export default {
copyAsImageFailed: 'Failed to copy as image',
// ── Message actions bar ──
regenerate: 'Regenerate',
regenerateFailed: 'Regenerate failed: {msg}',
// regenerateUnavailable: Ctrl+R / retry paths still call store.regenerate(); precheck toast key
// (I6 revert removed the UI button only — key still referenced by useAiSend.ts, review 2026-10-05 ②)
regenerateUnavailable: 'No reply to regenerate',
regenerateFailed: 'Regenerate failed: {msg}',
// fetch_url "Install obscura via AI" button triggers sendMessage; failure toast (mirrors editMessageFailed)
sendFailed: 'Send failed: {msg}',
@@ -237,6 +251,8 @@ export default {
compressing: 'Compressing…',
clearSuccess: 'Context cleared',
compressSuccess: 'Context compressed',
// B4: one-shot auto-compress notice (loop auto-compress no longer fully silent)
autoCompressed: 'Context auto-compressed (earlier messages folded into summary)',
compressError: 'Compression failed: {msg}',
clearError: 'Clear failed: {msg}',
// Separator expand / collapse
@@ -279,6 +295,10 @@ export default {
tokenInLabel: 'Input (cache miss, full price)',
tokenCacheLabel: 'Cache hit (low price)',
tokenOutLabel: 'Output',
// #12 conversation-cumulative tokens (token detail popover footer)
tokenConvTotal: 'Conversation total',
tokenConvTotalIn: 'Total in',
tokenConvTotalOut: 'Total out',
tokenReasonLabel: 'Reasoning',
tokenCacheRateLabel: 'Cache hit rate',
tokenModelLabel: 'Model',
+6
View File
@@ -14,6 +14,10 @@ export default {
argsCollapse: 'Collapse args',
// batch approve high-risk interception (count badge + confirm text)
batchHighRiskHint: '{n} high-risk',
// R7 group-header failure badge: folded group contains failed tool cards
groupFailCount: '{n} failed',
// #14 batch approve partial failure toast
batchPartialFail: 'Batch done: {ok} approved, {fail} failed.',
batchHighRiskConfirm: 'Batch approval includes {n} high-risk operations (e.g. delete/command execution/network requests). Approve all?',
rejectedHint: 'User rejected this action',
// tool execution slow hint (frontend fallback, no backend cancel IPC)
@@ -30,6 +34,8 @@ export default {
// Singular expand/collapse (ToolCard single-card content, command output toggle)
expand: 'Expand',
collapse: 'Collapse',
diffExpand: 'Expand all {n} lines',
diffCollapse: 'Collapse diff',
written: 'written',
items: 'items',
lines: 'lines',
+5 -1
View File
@@ -27,7 +27,7 @@ export default {
aiStreamRetry: '与上游连接中断,自动重试中({attempt}/{max})…',
// Fatal 类错误(4xx/鉴权)不可重试,提示用户去设置而非重试
notRetryable: '此错误无法通过重试解决,请检查配置',
streamInterruptedAfterTool: '⚠ 工具已执行完成,后续回复中断(长时间无数据流)。可点继续重试。',
streamInterruptedAfterTool: '⚠ 工具已执行完成,后续回复中断(长时间无数据流)。可点「重试」续跑(整轮重跑,已完成工具会重新执行)。',
streamInterrupted: '⚠ 响应中断(长时间无数据流)。可能是网络断连或后端异常,请重试。',
// 看门狗探测到后端已正常收敛(仅收尾事件丢失)时补的轻收敛提示,非错误语气
streamFinishedConverged: '响应在收尾阶段中断,已自动完成收敛。',
@@ -45,6 +45,7 @@ export default {
queuedSendFailed: '队列消息发送失败:{error}',
// UX-P2-A2:出错/重生成/编辑清排队消息的 toast 提示(原静默丢弃无任何反馈)
queueCleared: '已清 {n} 条排队消息',
queueWillContinue: '已停止,{n} 条排队消息仍将自动发送',
approvalTimeout: '⚰ 审批超时,已自动拒绝:{toolName}',
// 对话加载/切换失败反馈(网络抖动/IPC 断开 → 列表空/切换空白,原静默无反馈)
loadConvFail: '对话列表加载失败,请检查网络或后端连接',
@@ -176,6 +177,9 @@ export default {
echoDirs: '{n} 个目录',
echoBudget: '预算 {rounds} 轮 / {tokens} tokens / {secs}s',
echoNoBudget: '预算不限',
// A12: 预算校验错误定位字段;A11: 脏编辑保留提示
budgetInvalidField: '{field} 需为正整数',
dirtyKept: '有未提交的编辑已保留(目标会话已切换,确认前请核对)',
},
},
}
+22 -2
View File
@@ -49,6 +49,19 @@ export default {
pinOnTop: '置顶',
unpin: '取消置顶',
closeWindow: '关闭窗口',
// I9(2026-10-05)文本/代码文件附件
pickFileTitle: '选择文本/代码文件',
textFileFilter: '文本/代码文件',
fileTooLargeTruncated: '文件过大,已截断插入',
fileReadFailed: '文件读取失败,已跳过',
shortcutsTitle: '键盘快捷键',
scNewConv: '新建对话',
scFocusInput: '聚焦输入框',
scRegenerate: '重新生成回复',
scClearChat: '清空当前对话',
scSearch: '聚焦会话搜索',
scToggleSidebar: '展开/收起侧栏',
scCloseOverlay: '关闭弹窗/面板',
// ── 审批浮层(全局右上角)──
approvalWaitingTitle: '有待审批请求',
@@ -164,9 +177,10 @@ export default {
copyAsImageFailed: '复制为图片失败',
// ── 消息操作栏──
regenerate: '重新生成',
regenerateFailed: '重新生成失败:{msg}',
// regenerateUnavailable:Ctrl+R / 重试链仍走 store.regenerate(),前置校验失败 toast 用
// (I6 回滚只撤了 UI 按钮,此键仍被 useAiSend.ts 引用——review 2026-10-05 ②)
regenerateUnavailable: '没有可重新生成的回复',
regenerateFailed: '重新生成失败:{msg}',
// fetch_url "AI 帮装 obscura" 按钮触发 sendMessage 失败的 toast(对齐 editMessageFailed 模式)
sendFailed: '发送失败:{msg}',
@@ -238,6 +252,8 @@ export default {
compressing: '压缩中…',
clearSuccess: '上下文已清空',
compressSuccess: '上下文已压缩',
// B4: 自动压缩完成一次性提示(loop 自动压缩不再全程静默)
autoCompressed: '上下文已自动压缩(较早消息已折叠为摘要)',
compressError: '压缩失败:{msg}',
clearError: '清空失败:{msg}',
// 折叠条展开 / 收起
@@ -280,6 +296,10 @@ export default {
tokenInLabel: '输入(未命中,全价)',
tokenCacheLabel: '缓存命中(低价)',
tokenOutLabel: '输出',
// #12 会话累计 token(token 详情面板尾部段)
tokenConvTotal: '会话累计',
tokenConvTotalIn: '会话累计·输入',
tokenConvTotalOut: '会话累计·输出',
tokenReasonLabel: '思考(reasoning)',
tokenCacheRateLabel: '缓存命中率',
tokenModelLabel: '模型',
+6
View File
@@ -14,6 +14,10 @@ export default {
argsCollapse: '收起参数',
// 批量批准 High 风险拦截(计数徽标 + 二次确认文案)
batchHighRiskHint: '含 {n} 项高风险',
// R7 组头失败徽标:折叠组内含失败工具卡
groupFailCount: '{n} 失败',
// #14 批量审批部分失败提示
batchPartialFail: '批量完成:{ok} 项成功,{fail} 项失败',
batchHighRiskConfirm: '批量批准包含 {n} 项高风险操作(如删除/命令执行/网络请求),确认全部放行?',
rejectedHint: '用户拒绝了此操作',
// 工具执行超时提示(前端降级,无后端取消 IPC)
@@ -29,6 +33,8 @@ export default {
clickToCopy: '点击复制完整路径',
collapse: '收起',
expand: '展开',
diffExpand: '展开全部 {n} 行',
diffCollapse: '收起 diff',
written: '已写入',
items: '项',
lines: '行',