From 7aeb31f93512bbd20f5f38827bb3700b4696146a Mon Sep 17 00:00:00 2001 From: kicer Date: Tue, 22 Sep 2026 17:00:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E4=BE=A7?= =?UTF-8?q?=E8=BE=B9=E6=A0=8F=E5=8A=A0=E4=B8=8A=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/server/public/css/style.css | 7 +++++++ app/server/public/index.html | 7 ++++--- app/server/public/js/sessions.js | 2 +- app/server/routes/sessions.js | 4 +++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/server/public/css/style.css b/app/server/public/css/style.css index 9de3c42..a750df4 100644 --- a/app/server/public/css/style.css +++ b/app/server/public/css/style.css @@ -733,6 +733,13 @@ footer { flex: none; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0 position: relative; border-radius: 12px; } +/* 定时任务会话标记:左缘紫色短竖条,绝对定位压在 conv-item 左 padding 区,不吃标题宽度; + 颜色与 schedule-bar 紫色体系呼应,区别于状态色(蓝/绿/黄) */ +.conv-wrap.scheduled::before { + content: ""; position: absolute; left: 2px; top: 24%; bottom: 24%; + width: 3px; border-radius: 2px; background: #7048e8; + pointer-events: none; +} .conv-item { position: relative; transition: background .12s; diff --git a/app/server/public/index.html b/app/server/public/index.html index 4ce008d..0c8944f 100644 --- a/app/server/public/index.html +++ b/app/server/public/index.html @@ -56,12 +56,13 @@ .stop-link.icon-only.icon-primary:hover { color: #2854d6; } /* 推到 phase-bar 最右侧(独立动作,与左侧状态/选择模型区分) */ .phase-bar .phase-bar-right { margin-left: auto; } - /* 定时任务状态条:整条可点,弹详情窗(改频次/提示词、删除;创建走 AI 的 schedule_task 工具),淡黄底区别于状态栏。 + /* 定时任务状态条:整条可点,弹详情窗(改频次/提示词、删除;创建走 AI 的 schedule_task 工具),紫色调区别于状态栏; + 左侧 3px 竖条与侧边栏定时任务会话的紫色标记同一语义。 高度与 phase-bar 对齐:同 6px 上下内边距,sched-text 用与 stop-link 同构的 12px 字 + 4px 上下 padding(天然同 line-box),eye 同 icon-only 钮 */ .schedule-bar { flex: none; display: flex; align-items: center; gap: 8px; - padding: 6px 12px; font-size: 12px; color: #8a6400; cursor: pointer; - background: #fffdf2; border-bottom: 1px solid #f0e6c8; + padding: 6px 12px; font-size: 12px; color: #5f3dc4; cursor: pointer; + background: #f8f5ff; border-bottom: 1px solid #e7def9; border-left: 3px solid #7048e8; } .schedule-bar:active { opacity: 0.75; } .schedule-bar .sched-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 0; } diff --git a/app/server/public/js/sessions.js b/app/server/public/js/sessions.js index 25395fc..6f3575d 100644 --- a/app/server/public/js/sessions.js +++ b/app/server/public/js/sessions.js @@ -27,7 +27,7 @@ for (const s of list) { const g = groupLabel(s.updated_at); if (g !== lastGroup) { html += '
' + esc(g) + '
'; lastGroup = g; } - html += '
' + + html += '
' + '' + diff --git a/app/server/routes/sessions.js b/app/server/routes/sessions.js index cdf3cfa..55e4a90 100644 --- a/app/server/routes/sessions.js +++ b/app/server/routes/sessions.js @@ -122,8 +122,10 @@ router.get('/', wrap((req, res) => { } const whereSql = where.length ? ' WHERE ' + where.join(' AND ') : ''; + // has_schedule:侧边栏定时任务标记用,EXISTS 子查询单条搞定(非 N+1);schedule 详情仍只在单会话接口返回 const stmt = db.prepare( - 'SELECT * FROM sessions' + whereSql + ' ORDER BY updated_at DESC, id DESC LIMIT ?' + 'SELECT *, EXISTS(SELECT 1 FROM scheduled_tasks t WHERE t.session_id = sessions.id) AS has_schedule FROM sessions' + + whereSql + ' ORDER BY updated_at DESC, id DESC LIMIT ?' ); const rows = stmt.all.apply(stmt, args.concat([limit]));