]> acesimba.cloud Git - codebuddy-web.git/commitdiff
feat: 浏览器标签页标题改为「会话名 - CLI」,去掉无意义状态点,便于多标签区分
authorCodebuddy <codebuddy@localhost>
Sat, 15 Aug 2026 10:11:56 +0000 (18:11 +0800)
committerCodebuddy <codebuddy@localhost>
Sat, 15 Aug 2026 10:11:56 +0000 (18:11 +0800)
frontend/index.html

index 55b8a46caf8bd5cd605e10f0697f3f09045813c3..48882257992b30e2e6a84f495b9e7cf533866157 100644 (file)
@@ -435,6 +435,7 @@ body { position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100%; over
 
   async function showPicker() {
     show('picker');
+    document.title = '任务列表 - CLI';
     await renderTasks();
     await renderSkillsSidebar();
   }
@@ -693,6 +694,7 @@ body { position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100%; over
     }
     document.getElementById('task-title').textContent = '🗂 ' + currentTask.name;
     document.getElementById('task-cwd').textContent = currentTask.cwd;
+    updateTitle();
     show('terminal');
     initTerminal();
     connectWS();
@@ -1327,9 +1329,16 @@ body { position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100%; over
     // 输入由 #msg-input 输入区处理,xterm 仅作 TUI 输出展示
   }
 
+  // 浏览器标签页标题:会话名 - CLI,便于在多标签页间区分
+  function updateTitle() {
+    if (!currentTask) { document.title = 'CLI'; return; }
+    document.title = currentTask.name + ' - CLI';
+  }
+
   function setConnected(v) {
     statusDot.className = 'dot ' + (v ? 'connected' : 'disconnected');
     statusText.textContent = v ? '已连接' : '未连接';
+    updateTitle();
     if (v && term && term.focus) { try { term.focus(); } catch(e){} }
   }