From d90cca7cef2f30d56f85bd20ce4c6684ed88ea3c Mon Sep 17 00:00:00 2001 From: Roe-xin Date: Sat, 17 Jan 2026 10:48:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=AE=9E=E7=8E=B0=E4=BA=86=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=A4=B4=E5=83=8F=E5=92=8C=E7=94=A8=E6=88=B7=E5=90=8D?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=B7=B3=E8=BD=AC=E5=88=B0=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=20=E8=BF=99=E9=87=8C=E8=BF=98=E9=9C=80=E8=A6=81=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E7=9A=84=E5=9C=B0=E6=96=B9=EF=BC=9A=20-=20=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=88=B0Web=E7=AB=AF=E8=BF=98=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E7=99=BB=E5=BD=95=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E8=A6=81=E8=87=AA=E5=8A=A8=E7=99=BB=E5=BD=95=20-=20=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=90=8E=E7=AB=AF=E7=BB=99=E4=B8=AA=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E6=8E=88=E6=9D=83=E7=A0=81=20-=20=E8=BF=99=E6=A0=B7?= =?UTF-8?q?=E5=B0=B1=E4=B8=8D=E7=94=A8=E5=89=8D=E7=AB=AF=E4=BC=A0=E9=80=92?= =?UTF-8?q?token=E7=84=B6=E5=90=8E=E8=87=AA=E5=8A=A8=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E4=BA=86=20-=20=E9=81=BF=E5=85=8D=E4=BA=86token=E6=9A=B4?= =?UTF-8?q?=E9=9C=B2=E7=9A=84=E9=A3=8E=E9=99=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/panels/ICHelperPanel.ts | 4 +++ src/views/userInfoComponent.ts | 48 ++++++++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/panels/ICHelperPanel.ts b/src/panels/ICHelperPanel.ts index a0731c3..e2906ca 100644 --- a/src/panels/ICHelperPanel.ts +++ b/src/panels/ICHelperPanel.ts @@ -350,6 +350,10 @@ export async function showICHelperPanel( // 退出登录 vscode.commands.executeCommand("ic-coder.logout"); break; + case "openICCoder": + // 跳转到 IC Coder 官网 + vscode.env.openExternal(vscode.Uri.parse("https://www.iccoder.com")); + break; case "openUserManual": // 打开用户手册 vscode.env.openExternal(vscode.Uri.parse("https://www.iccoder.com")); diff --git a/src/views/userInfoComponent.ts b/src/views/userInfoComponent.ts index 1943b52..3c699ea 100644 --- a/src/views/userInfoComponent.ts +++ b/src/views/userInfoComponent.ts @@ -14,13 +14,13 @@ export function getUserInfoComponentContent(): string {
-
+
-
加载中...
+
加载中...
@@ -103,6 +103,16 @@ export function getUserInfoComponentStyles(): string { align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0, 122, 204, 0.3); + transition: all 0.2s ease; + } + + .user-avatar-small.clickable { + cursor: pointer; + } + + .user-avatar-small.clickable:hover { + transform: scale(1.1); + box-shadow: 0 4px 12px rgba(0, 122, 204, 0.5); } .user-avatar-small svg { @@ -122,6 +132,16 @@ export function getUserInfoComponentStyles(): string { font-size: 14px; font-weight: 600; color: var(--vscode-foreground); + transition: all 0.2s ease; + } + + .user-detail-name.clickable { + cursor: pointer; + } + + .user-detail-name.clickable:hover { + color: #007acc; + text-decoration: underline; } .tier-icon-inline { @@ -248,6 +268,12 @@ export function getUserInfoComponentScript(): string { vscode.postMessage({ command: 'logout' }); } + // 跳转到 IC Coder 官网 + function openICCoder() { + console.log("跳转到 IC Coder 官网"); + vscode.postMessage({ command: 'openICCoder' }); + } + // 关闭用户详情下拉面板 function closeUserDetailModal() { const dropdown = document.getElementById('userDetailDropdown'); @@ -317,6 +343,24 @@ export function getUserInfoComponentScript(): string { }); } + // 绑定头像点击事件 + const userAvatar = document.getElementById('userAvatarClickable'); + if (userAvatar) { + userAvatar.addEventListener('click', (e) => { + e.stopPropagation(); + openICCoder(); + }); + } + + // 绑定用户名点击事件 + const userName = document.getElementById('userDetailName'); + if (userName) { + userName.addEventListener('click', (e) => { + e.stopPropagation(); + openICCoder(); + }); + } + // 点击页面其他地方关闭下拉面板 document.addEventListener('click', (e) => { const dropdown = document.getElementById('userDetailDropdown');