From 23d7e8921259b6e41695bf51b6c1974e4c74c0a5 Mon Sep 17 00:00:00 2001 From: kicer Date: Tue, 1 Sep 2026 23:50:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=BD=92=E6=A1=A3=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E9=BB=98=E8=AE=A4=E6=98=BE=E7=A4=BA10=E6=9D=A1,?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A=E6=8C=89=E9=92=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=89=A9=E4=BD=99=E6=95=B0,=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/server/public/css/style.css | 10 ---------- app/server/public/index.html | 10 +++++----- app/server/public/js/tasks.js | 24 +++++++++--------------- 3 files changed, 14 insertions(+), 30 deletions(-) diff --git a/app/server/public/css/style.css b/app/server/public/css/style.css index 963b79a..08adb2c 100644 --- a/app/server/public/css/style.css +++ b/app/server/public/css/style.css @@ -78,16 +78,6 @@ body { .search-bar input:focus { border-color: #2a5299; } .search-cancel { background: none; border: none; color: #2a5299; font-size: 14px; padding: 6px 4px; cursor: pointer; flex: none; } .search-tip { color: #8891a5; font-size: 12px; padding: 2px 4px 8px; } -.done-head { - display: flex; align-items: center; justify-content: center; gap: 4px; - color: #77818f; font-size: 13px; padding: 10px 0 12px; cursor: pointer; user-select: none; -} -.done-head:active { color: #445; } -.done-head .chev { - width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; - stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; -} -.done-head.open .chev { transform: rotate(180deg); } .load-more { width: 100%; background: none; border: 1px dashed #ccd2dd; border-radius: 10px; color: #667; font-size: 13px; padding: 9px; margin-bottom: 10px; cursor: pointer; diff --git a/app/server/public/index.html b/app/server/public/index.html index 23c87c1..bb39bc7 100644 --- a/app/server/public/index.html +++ b/app/server/public/index.html @@ -284,10 +284,10 @@ - - - - - + + + + + diff --git a/app/server/public/js/tasks.js b/app/server/public/js/tasks.js index 5b4f351..658dbd1 100644 --- a/app/server/public/js/tasks.js +++ b/app/server/public/js/tasks.js @@ -54,11 +54,10 @@ function showList() { }, { passive: true }); })(); -// ---------- 会话列表(活跃 + 归档折叠 + 搜索) ---------- -const DONE_PAGE = 20; // 归档每页条数 +// ---------- 会话列表(活跃 + 归档分页 + 搜索) ---------- +const DONE_PAGE = 10; // 归档每页条数 let activeRows = []; // 当前活跃会话(含排队/保持) let searchMode = false; // 搜索模式:列表区显示搜索结果 -let doneExpanded = false; // 归档区是否展开 let doneRows = []; // 已加载的归档行 let doneTotal = 0; // 归档总数 let doneCursor = null; // 下一页游标 {updated_at, id} @@ -81,19 +80,15 @@ function sessionCard(s) { function renderSessionList() { const el = $('session-list'); let html = activeRows.map(sessionCard).join(''); - if (doneTotal) { - html += '
' + - '已完成/已终止 (' + doneTotal + ')' + - '
'; - if (doneExpanded) { - html += doneRows.map(sessionCard).join(''); - if (doneRows.length < doneTotal) { - html += ''; - } - } - } else if (!activeRows.length) { + html += doneRows.map(sessionCard).join(''); + if (!activeRows.length && !doneTotal) { html += '
还没有任务,点右上角 + 新建
'; } + const remain = doneTotal - doneRows.length; + if (remain > 0) { + // 括号内是剩余未展示的归档数,如总共 100、已显 10 则显示「加载更多(90)」 + html += ''; + } el.innerHTML = html; } @@ -540,7 +535,6 @@ const ui = { logout() { location.href = '/logout'; }, toggleSearch() { toggleSearch(); }, doSearch() { doSearch(); }, - toggleDone() { doneExpanded = !doneExpanded; renderSessionList(); }, loadMoreDone() { return loadMoreDone(); }, };