diff --git a/frontend/dashboard.html b/frontend/dashboard.html
index 0131aad..2a00e07 100644
--- a/frontend/dashboard.html
+++ b/frontend/dashboard.html
@@ -79,28 +79,29 @@
return;
}
- tree.innerHTML = filtered.map(p => `
+ tree.innerHTML = filtered.map((p, idx) => `
+ id="project-${idx}">
加载中...
`).join('');
}
- async function toggleProject(header, projectName) {
+ async function toggleProject(header) {
header.classList.toggle('open');
const content = header.nextElementSibling;
content.classList.toggle('open');
if (content.classList.contains('open')) {
+ const projectName = header.getAttribute('data-project');
currentProject = projectName;
await loadSessions(projectName, content.querySelector('.sessions-container'));
}
@@ -130,7 +131,9 @@
async function selectSession(sessionId, projectName) {
currentSession = sessionId;
currentProject = projectName;
- renderProjectTree(); // Re-render to highlight
+ // Update highlight without re-rendering the whole tree
+ document.querySelectorAll('.sessions-container .selected-session').forEach(el => el.classList.remove('selected-session'));
+ event.currentTarget.classList.add('selected-session');
try {
const data = await API.get(`/api/dashboard/prompts?session_id=${encodeURIComponent(sessionId)}&page_size=50`);
diff --git a/frontend/static/common.css b/frontend/static/common.css
index f7e7ea5..9ad3d42 100644
--- a/frontend/static/common.css
+++ b/frontend/static/common.css
@@ -406,3 +406,8 @@ body {
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
+
+.selected-session {
+ background: var(--bg-tertiary) !important;
+ border-left: 3px solid var(--accent-color);
+}