feat/获取用户信息+展示用户名称

This commit is contained in:
Roe-xin
2026-01-09 15:26:33 +08:00
parent 4037e9e2d7
commit 940584e1ea
9 changed files with 423 additions and 8 deletions

View File

@ -19,11 +19,20 @@ export function getConversationHistoryBarContent(): string {
</div>
</div>
<button class="new-conversation-button" onclick="createNewConversation()" title="新建对话">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" fill="currentColor"/>
</svg>
</button>
<div class="right-actions">
<div class="user-info" id="userInfo" style="display: none;">
<svg class="user-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" fill="currentColor"/>
</svg>
<span class="user-nickname" id="userNickname">加载中...</span>
</div>
<button class="new-conversation-button" onclick="createNewConversation()" title="新建对话">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" fill="currentColor"/>
</svg>
</button>
</div>
</div>
`;
}
@ -49,6 +58,36 @@ export function getConversationHistoryBarStyles(): string {
flex: 1;
}
.right-actions {
display: flex;
align-items: center;
gap: 12px;
}
.user-info {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
background: var(--vscode-button-secondaryBackground);
border-radius: 4px;
font-size: 13px;
color: var(--vscode-button-secondaryForeground);
}
.user-icon {
width: 16px;
height: 16px;
flex-shrink: 0;
}
.user-nickname {
white-space: nowrap;
max-width: 120px;
overflow: hidden;
text-overflow: ellipsis;
}
.history-dropdown-button {
display: inline-flex;
align-items: center;