feat: add 4th swiper page (workspace/conversation selector) + richer message types (tool/error/plan/code/table)

This commit is contained in:
2026-09-01 23:05:21 +08:00
parent ab41ff2943
commit ff14d44c01
2 changed files with 55 additions and 3 deletions
+2 -1
View File
@@ -12,7 +12,8 @@
"features": [
{ "name": "system.router" },
{ "name": "system.interconnect" },
{ "name": "system.audio" }
{ "name": "system.audio" },
{ "name": "system.storage" }
],
"config": {
"logLevel": "log",
+53 -2
View File
@@ -3,6 +3,19 @@
<swiper class="swiper" index="{{currentIndex}}" indicator="false" loop="false"
previousmargin="0px" nextmargin="0px" onchange="onSwipeChange">
<!-- 最左页:选择对话 / 工作区 -->
<div class="page-item left-page">
<text class="page-title">选择对话</text>
<text class="ws-name">DeepSeek_Harness_Watch</text>
<div class="sel-conv" onclick="selectConv('小米手环10 Pro远程控制')"><text>小米手环10 Pro远程控制</text></div>
<div class="sel-conv" onclick="selectConv('DSHWatch 验收')"><text>DSHWatch 验收</text></div>
<text class="ws-name">reactor</text>
<div class="sel-conv" onclick="selectConv('任务-001')"><text>任务-001</text></div>
<div class="sel-conv" onclick="selectConv('任务-002')"><text>任务-002</text></div>
<text class="ws-name">truestudio.online</text>
<div class="sel-conv" onclick="selectConv('评估-今天')"><text>评估-今天</text></div>
</div>
<!-- 左页:对话(Harness 式) -->
<div class="page-item left-page">
<!-- 当前会话 / 点开选工作区 -->
@@ -103,6 +116,7 @@
<div class="dot {{currentIndex == 0 ? 'dot-active' : ''}}"></div>
<div class="dot {{currentIndex == 1 ? 'dot-active' : ''}}"></div>
<div class="dot {{currentIndex == 2 ? 'dot-active' : ''}}"></div>
<div class="dot {{currentIndex == 3 ? 'dot-active' : ''}}"></div>
</div>
<!-- 软键盘弹层:输入框上移、键盘贴底 -->
@@ -184,7 +198,7 @@ function playDuckSound() {
export default {
private: {
currentIndex: 1,
currentIndex: 2,
messages: [
{ role:'user', text:'帮我看看今天有什么任务', preview:'', think:null, kind:'normal', showThink:false, collapsed:false },
{ role:'assistant', text:'好的,今天三件事:1) 回复 DSHWatch 进度;2) 调整手环 UI;3) 准备部署。', preview:'好的,今天三件事:1) 回复 DSHWatch 进度;2) 调整手环…', think:'正在从工作区任务列表整理,并对比上次状态…', kind:'normal', showThink:true, collapsed:true },
@@ -196,7 +210,13 @@ export default {
{ role:'user', text:'帮我生成一张手环 UI 草图', preview:'', think:null, kind:'normal', showThink:false, collapsed:false },
{ role:'assistant', text:'生成了一张「手表主界面」草图,点击可放大。', preview:'生成了一张「手表主界面」草图…', think:'正在渲染图像…', kind:'image', showThink:true, collapsed:false },
{ role:'assistant', text:'另外建议把左边做成对话流、右边放设置,中间吉祥物可交互——这样最贴合你说的“把 Harness 串流过来”。', preview:'另外建议把左边做成对话流、右边放设置…', think:'正在思考布局建议…', kind:'normal', showThink:true, collapsed:true },
{ role:'system', text:'会话已切换工作区:reactor', preview:'', think:null, kind:'normal', showThink:false, collapsed:false }
{ role:'system', text:'会话已切换工作区:reactor', preview:'', think:null, kind:'normal', showThink:false, collapsed:false },
{ role:'assistant', text:'正在调用工具 bash 执行 npm run build…', preview:'正在调用工具 bash…', think:null, kind:'tool', tag:'🔧 工具调用', showThink:false, collapsed:true },
{ role:'assistant', text:'构建失败:UxLoader 错误,缺少 system.storage 特性。', preview:'构建失败:UxLoader 错误…', think:null, kind:'error', tag:'❌ 错误', showThink:false, collapsed:false },
{ role:'assistant', text:'方案一:三页结构;方案二:四页+浮动层。', preview:'方案一:三页结构;方案二:四页+浮动层…', think:'正在比较两种布局…', kind:'plan', tag:'🧭 计划', showThink:true, collapsed:true },
{ role:'assistant', text:'const a = 1;\nconsole.log(a);', preview:'const a = 1;…', think:null, kind:'code', tag:'💻 代码', showThink:false, collapsed:true },
{ role:'assistant', text:'模型 | 价格 | 状态\nFlash | 0.1 | 可用', preview:'模型 | 价格 | 状态…', think:null, kind:'table', tag:'📊 表格', showThink:false, collapsed:true },
{ role:'assistant', text:'「把 Harness 串流过来」这个目标,建议先做最小闭环。', preview:'「把 Harness 串流过来」…', think:null, kind:'normal', showThink:false, collapsed:true }
],
workspaces: [
{ name:'DeepSeek_Harness_Watch', conversations:['小米手环10 Pro远程控制','DSHWatch 验收'] },
@@ -300,6 +320,12 @@ export default {
this.showSelect = false
},
selectConv(name) {
this.currentConv = name
this.currentIndex = 1
this.showSelect = false
},
toggleThink(index) {
const m = this.messages[index]
if (m) m.showThink = !m.showThink
@@ -999,4 +1025,29 @@ export default {
background-color: #33b4ff;
color: #08131f;
}
.ws-name {
color: #9db3d8;
font-size: 15px;
font-weight: bold;
margin-top: 10px;
margin-bottom: 4px;
}
.sel-conv {
width: 100%;
min-height: 40px;
flex-direction: row;
justify-content: flex-start;
align-items: center;
padding: 6px 10px;
border-radius: 10px;
background-color: #152238;
margin-bottom: 6px;
}
.sel-conv text {
color: #e6f0ff;
font-size: 16px;
}
</style>