From 258afb1e7e2166b1e7eac4dbfa3bd7eb127ed3cd Mon Sep 17 00:00:00 2001 From: ymq Date: Sun, 9 Aug 2026 19:49:19 +0800 Subject: [PATCH] fix: left-align agent response text widgets --- wwwroot/api/cockpit_chat.dspy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wwwroot/api/cockpit_chat.dspy b/wwwroot/api/cockpit_chat.dspy index 1663417..bb7f871 100644 --- a/wwwroot/api/cockpit_chat.dspy +++ b/wwwroot/api/cockpit_chat.dspy @@ -121,7 +121,7 @@ def _parse(raw): except: pass return {"action":"reply","message":raw} -def _w_text(t): return {"widgettype":"Text","options":{"text":t,"css":"agent-text"}} +def _w_text(t): return {"widgettype":"Text","options":{"text":t,"css":"agent-text","halign":"left"}} def _w_card(title, body, kind="success"): colors = {"success":"#10b981","error":"#ef4444","reply":"#6366f1","progress":"#f59e0b"} c = colors.get(kind,"#6b7280") @@ -129,7 +129,7 @@ def _w_card(title, body, kind="success"): {"widgettype":"Text","options":{"text":title,"style":{"fontWeight":"bold","fontSize":"13px","color":c}}}, body ]} -def _w_progress(text): return {"widgettype":"Text","options":{"text":text,"style":{"color":"#f59e0b","fontSize":"12px","padding":"2px 8px"}}} +def _w_progress(text): return {"widgettype":"Text","options":{"text":text,"style":{"color":"#f59e0b","fontSize":"12px","padding":"2px 8px"},"halign":"left"}} _tool_labels = {'list_projects':'列出项目','switch_project':'切换项目','create_project':'创建项目','list_tasks':'查询任务','task_detail':'任务详情','list_deliverables':'查看交付件','view_deliverable':'交付件内容','list_questions':'查看问题','answer_question':'回答问题','create_task':'创建任务','start_agents':'启动角色Agent','check_progress':'检查进度','add_repo':'关联仓库','list_repos':'查看仓库','clone_repo':'克隆仓库','add_bug':'报告Bug','run_command':'执行命令'}