Skip to content

Commit 1ef00ae

Browse files
committed
feat: add indicator on notification item for current terminal code agent tab
1 parent 5a5bb09 commit 1ef00ae

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

ui/src/components/terminal/AINotificationBar.vue

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,14 @@ const currentProjectId = computed(() => {
449449
return typeof id === 'string' ? id : '';
450450
});
451451
452+
// 当前激活的终端 session ID
453+
const currentActiveSessionId = computed(() => {
454+
if (!currentProjectId.value) {
455+
return '';
456+
}
457+
return terminalStore.getActiveTabId(currentProjectId.value) || '';
458+
});
459+
452460
const filteredNotifications = computed(() => {
453461
if (!notificationsEnabled.value) {
454462
return [];
@@ -1364,7 +1372,19 @@ watch(
13641372
v-for="notification in filteredNotifications"
13651373
:key="notification.id"
13661374
class="notification-row"
1375+
:class="{ 'is-current-session': notification.sessionId === currentActiveSessionId }"
13671376
>
1377+
<!-- 当前激活 tab 指示器(眼睛图标) -->
1378+
<span
1379+
v-if="notification.sessionId === currentActiveSessionId"
1380+
class="current-session-indicator"
1381+
:title="t('terminal.currentActiveSession')"
1382+
>
1383+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
1384+
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
1385+
<circle cx="12" cy="12" r="3"></circle>
1386+
</svg>
1387+
</span>
13681388
<!-- 项目序号标签(在卡片外面,仅多个项目时显示) -->
13691389
<button
13701390
v-if="projectIndexMap.size > 1 && getProjectIndex(notification)"
@@ -1848,6 +1868,7 @@ watch(
18481868
align-items: flex-start;
18491869
gap: 6px;
18501870
pointer-events: auto;
1871+
position: relative;
18511872
}
18521873
18531874
/* 项目序号标签样式(在卡片外部) */
@@ -1891,6 +1912,55 @@ watch(
18911912
margin-top: 4px;
18921913
}
18931914
1915+
/* 当前激活 tab 指示器样式 - 绝对定位不占宽度 */
1916+
.current-session-indicator {
1917+
position: absolute;
1918+
left: 1px;
1919+
top: 50%;
1920+
width: 18px;
1921+
height: 18px;
1922+
border-radius: 50%;
1923+
background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
1924+
color: #fff;
1925+
display: flex;
1926+
align-items: center;
1927+
justify-content: center;
1928+
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
1929+
animation: pulse-glow 2s ease-in-out infinite;
1930+
z-index: 10;
1931+
}
1932+
1933+
.current-session-indicator svg {
1934+
width: 10px;
1935+
height: 10px;
1936+
}
1937+
1938+
.notification-list.is-compact .current-session-indicator {
1939+
width: 18px;
1940+
height: 18px;
1941+
left: -23px;
1942+
margin-top: -13px;
1943+
}
1944+
1945+
.notification-list.is-compact .current-session-indicator svg {
1946+
width: 10px;
1947+
height: 10px;
1948+
}
1949+
1950+
/* 当前激活 tab 行高亮效果 */
1951+
.notification-row.is-current-session .notification-item {
1952+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), 0 12px 28px rgba(15, 23, 42, 0.18);
1953+
}
1954+
1955+
@keyframes pulse-glow {
1956+
0%, 100% {
1957+
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
1958+
}
1959+
50% {
1960+
box-shadow: 0 2px 12px rgba(59, 130, 246, 0.6);
1961+
}
1962+
}
1963+
18941964
.notification-close {
18951965
flex-shrink: 0;
18961966
width: 20px;

ui/src/i18n/locales/en-US.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ export default {
430430
aiNeedsApproval: 'AI Needs Approval',
431431
isWaitingForApproval: 'is waiting for your approval',
432432
clickToJumpTerminal: 'Click to jump to this terminal',
433+
currentActiveSession: 'Currently viewing this terminal',
433434
tabLabel: 'Tab Name',
434435
latestAgentCommand: 'Latest Code Agent Instruction',
435436
enableNotifications: 'Enable AI Completion Alerts',

ui/src/i18n/locales/zh-CN.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ export default {
430430
aiNeedsApproval: 'AI 需要批准',
431431
isWaitingForApproval: '正在等待您的批准',
432432
clickToJumpTerminal: '点击跳转对应终端',
433+
currentActiveSession: '当前正在操作的终端',
433434
tabLabel: '标签名',
434435
latestAgentCommand: '最近一次 Code Agent 指令',
435436
enableNotifications: '启用 AI 完成提醒',

0 commit comments

Comments
 (0)