diff --git a/src/frontend/src/components/NotificationCenter.tsx b/src/frontend/src/components/NotificationCenter.tsx index 46aaa09..ec1356b 100644 --- a/src/frontend/src/components/NotificationCenter.tsx +++ b/src/frontend/src/components/NotificationCenter.tsx @@ -156,31 +156,30 @@ export default function NotificationCenter({ onClose }: { onClose: () => void })
{g.items.map(n => { const s = TYPE_STYLES[n.type]; - const isExpanded = expanded === n.id; return ( -
{ + // 直接操作:有任务链接就跳转,否则标记已读 + if (n.taskId) { handleViewTask(n); } + else if (!n.read) { handleMarkRead(n); } + }} style={{ padding: '8px 10px', borderRadius: 8, background: 'var(--panel2)', border: `1px solid ${n.read ? 'var(--line)' : s.color + '44'}`, opacity: n.read ? 0.5 : 1, + cursor: 'pointer', + transition: 'opacity 0.15s', }}> -
setExpanded(isExpanded ? null : n.id)}> +
{s.icon} {n.title} {n.source === 'mail' ? '✉️' : '📡'} + {!n.read && }
{n.message}
- {isExpanded && ( -
- {n.taskId && ( - - )} - {!n.read && ( - - )} -
- )} +
+ {n.taskId ? '👆 点击查看任务' : !n.read ? '👆 点击标记已读' : ''} +
); })}