feat: merge titlebar and tab bar into single header with dynamic workspace alignment
- Merge titlebar and tab bar into a single unified top bar (.titlebar) - Remove redundant floating workspace button that caused overlap on collapsed sidebar - Ensure tab bar left aligns with terminal window when workspace sidebar is expanded - Allow tab bar to sit naturally at leftmost position when workspace sidebar is collapsed - Update test runner suite to cover merged titlebar and alignment behavior
This commit is contained in:
+46
-49
@@ -28,26 +28,47 @@ body {
|
||||
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
/* 顶部无边框拖拽标题栏 */
|
||||
/* 顶部无边框拖拽标题栏 (与标签栏合二为一) */
|
||||
.titlebar {
|
||||
height: var(--titlebar-height);
|
||||
background: var(--bg-titlebar);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
-webkit-app-region: drag; /* 允许窗口拖拽 */
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
padding: 0 8px;
|
||||
padding: 0;
|
||||
padding-right: 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.titlebar-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
height: 100%;
|
||||
padding: 0 8px;
|
||||
width: var(--sidebar-width, 250px);
|
||||
min-width: var(--sidebar-width, 250px);
|
||||
max-width: var(--sidebar-width, 250px);
|
||||
border-right: 1px solid var(--border-color);
|
||||
-webkit-app-region: no-drag;
|
||||
overflow: hidden;
|
||||
-webkit-app-region: no-drag; /* 允许子元素正常响应鼠标交互 */
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
|
||||
min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
|
||||
max-width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
#app.sidebar-collapsed .titlebar-left,
|
||||
.titlebar-left.sidebar-collapsed {
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
max-width: none;
|
||||
border-right: none;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.app-brand {
|
||||
@@ -57,7 +78,7 @@ body {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--accent-color);
|
||||
padding: 0 8px;
|
||||
padding: 0 4px;
|
||||
letter-spacing: 0.5px;
|
||||
-webkit-app-region: drag;
|
||||
cursor: grab;
|
||||
@@ -69,7 +90,7 @@ body {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 2px 10px;
|
||||
padding: 2px 8px;
|
||||
height: 22px;
|
||||
background: var(--bg-tab-inactive);
|
||||
border: 1px solid var(--border-color);
|
||||
@@ -80,6 +101,9 @@ body {
|
||||
user-select: none;
|
||||
-webkit-app-region: no-drag !important;
|
||||
transition: all 0.15s ease;
|
||||
flex-shrink: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.titlebar-workspace-tag:hover {
|
||||
@@ -99,9 +123,23 @@ body {
|
||||
|
||||
.ws-tag-name {
|
||||
font-weight: 500;
|
||||
max-width: 160px;
|
||||
max-width: 95px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 标签页栏容器 (位于顶栏中央,工作区展开时与终端左侧像素对齐) */
|
||||
.tab-bar-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
max-width: calc(100vw - 360px);
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
-webkit-app-region: no-drag !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.titlebar-drag-spacer {
|
||||
@@ -109,7 +147,7 @@ body {
|
||||
height: 100%;
|
||||
-webkit-app-region: drag; /* 中间大面积空白区域允许拖拽 */
|
||||
cursor: grab;
|
||||
min-width: 40px;
|
||||
min-width: 20px;
|
||||
}
|
||||
|
||||
.app-brand-icon {
|
||||
@@ -193,47 +231,6 @@ body {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* 工作区终端主舞台与标签页栏 (工作区子层级,与终端严格对齐) */
|
||||
.workspace-stage {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.workspace-header {
|
||||
height: 38px;
|
||||
min-height: 38px;
|
||||
background: var(--bg-titlebar);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 8px;
|
||||
gap: 8px;
|
||||
user-select: none;
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
.tab-bar-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.stage-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 主内容区终端视口 */
|
||||
.main-viewport {
|
||||
flex: 1;
|
||||
|
||||
Reference in New Issue
Block a user