fix(chat): UI 修复—抽屉+新建项目可见性/标题迁移/折叠按钮不遮挡logo
This commit is contained in:
@@ -55,6 +55,8 @@
|
||||
position: relative;
|
||||
}
|
||||
#sidebar.collapsed { width: 56px; }
|
||||
#sidebar.collapsed #sidebar-toggle { top: auto; bottom: 14px; right: auto; left: 14px; }
|
||||
#sidebar.collapsed #session-list { padding-bottom: 52px; }
|
||||
.brand {
|
||||
display: flex; align-items: center; gap: 12px;
|
||||
padding: 16px 12px 12px 16px; margin: 0 8px 8px;
|
||||
@@ -73,6 +75,7 @@
|
||||
.brand:hover .brand-logo { transform: scale(1.1); }
|
||||
.brand-name { font-size: 17px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
|
||||
#sidebar.collapsed .brand-name { display: none; }
|
||||
.brand-sub { display: block; font-size: 11px; font-weight: 600; color: var(--gray-500); margin-top: 2px; letter-spacing: 0; }
|
||||
|
||||
/* 折叠按钮 */
|
||||
#sidebar-toggle {
|
||||
@@ -312,6 +315,11 @@
|
||||
.drawer-item.active { background: #fff; border-color: var(--blue-100); color: var(--blue-dark); font-weight: 700; box-shadow: var(--shadow-1); }
|
||||
.drawer-item .di-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.drawer-item .di-new { color: var(--blue); }
|
||||
.drawer-item.di-create {
|
||||
border: 1px dashed var(--blue-100); background: var(--blue-50);
|
||||
color: var(--blue-dark); font-weight: 700; justify-content: center; gap: 4px;
|
||||
}
|
||||
.drawer-item.di-create:hover { background: var(--blue-100); border-color: var(--blue); }
|
||||
.drawer-form { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
|
||||
.drawer-form label { font-size: 11px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 2px; display: block; }
|
||||
.drawer-form input {
|
||||
@@ -350,7 +358,7 @@
|
||||
<button id="sidebar-toggle" title="折叠/展开侧边栏">«</button>
|
||||
<div class="brand">
|
||||
<div class="brand-logo">G</div>
|
||||
<div class="brand-name">Genesis</div>
|
||||
<div class="brand-name">Genesis<span class="brand-sub">概要设计书做成Agent</span></div>
|
||||
</div>
|
||||
<button id="new-chat" title="新建会话"><span class="ic-plus">+</span><span class="nc-text">新会话</span></button>
|
||||
<h2>会话历史</h2>
|
||||
@@ -359,7 +367,7 @@
|
||||
|
||||
<div id="main">
|
||||
<header>
|
||||
<h1>Genesis 概要设计书 Agent</h1>
|
||||
|
||||
<div class="proj-switcher" id="proj-switcher">
|
||||
<button class="ps-current" id="ps-current" type="button" title="切换项目">
|
||||
<span class="ps-label">项目</span>
|
||||
@@ -590,7 +598,9 @@ function openProjectDrawer(projectName) {
|
||||
drawerOpen = true;
|
||||
toggleProjectSwitcher(false);
|
||||
drawer.classList.add('open');
|
||||
loadDrawerForm(projectName === undefined ? drawerSelected : projectName);
|
||||
const sel = (projectName === undefined || projectName === null) ? drawerSelected : projectName;
|
||||
try { loadDrawerForm(sel); } catch (e) { console.error(e); }
|
||||
renderDrawerList(); // 始终渲染左侧列表(含 +新建项目)
|
||||
}
|
||||
|
||||
function closeProjectDrawer() {
|
||||
@@ -654,8 +664,8 @@ function guardDrawerDirty() {
|
||||
}
|
||||
|
||||
function renderDrawerList() {
|
||||
let html = '<div class="drawer-item' + (drawerSelected === null ? ' active' : '') + '" data-name="">'
|
||||
+ '<span class="di-new">+</span><span class="di-name">新建项目</span></div>';
|
||||
let html = '<div class="drawer-item di-create' + (drawerSelected === null ? ' active' : '') + '" data-name="">'
|
||||
+ '<span class="di-new">+</span><span class="di-name">新建项目</span></div>';
|
||||
for (const p of projects) {
|
||||
html += '<div class="drawer-item' + (p.name === drawerSelected ? ' active' : '') + '" data-name="' + esc(p.name) + '">'
|
||||
+ '<span class="di-name">' + esc(p.display_name || p.name) + '</span></div>';
|
||||
|
||||
Reference in New Issue
Block a user