feat: conversation selector selects tapped item and highlights it (per-row no-arg methods)

This commit is contained in:
2026-09-01 23:17:07 +08:00
parent c98bd6c919
commit d1a02e0ac2
+34 -15
View File
@@ -3,17 +3,38 @@
<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>
<input class="new-session" type="button" value="+ 新会话" onclick="newSession" />
<text class="page-title small">工作区</text>
<div class="ws-group" for="{{workTree}}">
<text class="ws-name">📁 {{$item.name}}</text>
<div class="sel-conv {{$item.title === currentConv ? 'sel-active' : ''}}" for="{{$item.convs}}">
<text class="sel-title fl{{fontLevel}}" onclick="cycleConv">{{$item.title}}</text>
<text class="sel-time" onclick="cycleConv">{{$item.time}}</text>
</div>
<text class="ws-name">📁 DeepSeek_Harness_Watch</text>
<div class="sel-conv {{currentConv === '小米手环10 Pro远程控制' ? 'sel-active' : ''}}">
<text class="sel-title fl{{fontLevel}}" onclick="pickConv0">小米手环10 Pro远程控制</text>
<text class="sel-time">刚刚</text>
</div>
<div class="sel-conv {{currentConv === 'DSHWatch 验收' ? 'sel-active' : ''}}">
<text class="sel-title fl{{fontLevel}}" onclick="pickConv1">DSHWatch 验收</text>
<text class="sel-time">1小时</text>
</div>
<text class="ws-name">📁 reactor</text>
<div class="sel-conv {{currentConv === '排查Git文件乱码问题' ? 'sel-active' : ''}}">
<text class="sel-title fl{{fontLevel}}" onclick="pickConv2">排查Git文件乱码问题</text>
<text class="sel-time">15天</text>
</div>
<text class="ws-name">📁 project</text>
<div class="sel-conv {{currentConv === '修改API配置为固定密钥' ? 'sel-active' : ''}}">
<text class="sel-title fl{{fontLevel}}" onclick="pickConv3">修改API配置为固定密钥</text>
<text class="sel-time">8天</text>
</div>
<div class="sel-conv {{currentConv === '检测DeepSeek API可用性' ? 'sel-active' : ''}}">
<text class="sel-title fl{{fontLevel}}" onclick="pickConv4">检测DeepSeek API可用性</text>
<text class="sel-time">9天</text>
</div>
<text class="ws-name">📁 truestudio.online</text>
<div class="sel-conv {{currentConv === '评估一下项目状态' ? 'sel-active' : ''}}">
<text class="sel-title fl{{fontLevel}}" onclick="pickConv5">评估一下项目状态</text>
<text class="sel-time">9天</text>
</div>
</div>
@@ -362,14 +383,12 @@ export default {
this.showOptionPicker = true
},
cycleConv() {
const titles = []
for (const ws of this.workTree) {
for (const c of ws.convs) titles.push(c.title)
}
const idx = titles.indexOf(this.currentConv)
this.currentConv = titles[(idx + 1) % titles.length]
},
pickConv0() { this.currentConv = '小米手环10 Pro远程控制'; this.currentIndex = 1 },
pickConv1() { this.currentConv = 'DSHWatch 验收'; this.currentIndex = 1 },
pickConv2() { this.currentConv = '排查Git文件乱码问题'; this.currentIndex = 1 },
pickConv3() { this.currentConv = '修改API配置为固定密钥'; this.currentIndex = 1 },
pickConv4() { this.currentConv = '检测DeepSeek API可用性'; this.currentIndex = 1 },
pickConv5() { this.currentConv = '评估一下项目状态'; this.currentIndex = 1 },
toggleThink(index) {
const m = this.messages[index]