feat: align tab bar with terminal window under workspace hierarchy & add automated test suite

- Restructure UI layout: tab bar and stage actions are now housed inside .workspace-stage (.workspace-header), aligning 100% with the terminal window (#main-viewport) below it
- Establish clear workspace hierarchy: Global Titlebar -> Left Workspace Sidebar -> Active Workspace Content Stage (Tab Bar + Terminal Viewport)
- Add active workspace indicator badge to titlebar header
- Introduce comprehensive automated test suite (test/test-runner.cjs) covering PTY process lifecycle, workspace hierarchy, stage alignment, tab creation, split panes, shortcuts, and themes
- Add 'npm test' script to package.json
This commit is contained in:
2026-09-24 01:54:02 +08:00
parent 4707817053
commit 5a032b13ec
6 changed files with 542 additions and 26 deletions
+84 -2
View File
@@ -64,6 +64,46 @@ body {
flex-shrink: 0;
}
/* 顶部标题栏工作区标识 */
.titlebar-workspace-tag {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 2px 10px;
height: 22px;
background: var(--bg-tab-inactive);
border: 1px solid var(--border-color);
border-radius: 12px;
font-size: 11px;
color: var(--text-muted);
white-space: nowrap;
user-select: none;
-webkit-app-region: no-drag !important;
transition: all 0.15s ease;
}
.titlebar-workspace-tag:hover {
background: var(--bg-tab-hover);
color: var(--text-main);
border-color: var(--border-active);
}
.ws-tag-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--accent-color);
box-shadow: 0 0 6px var(--accent-glow);
flex-shrink: 0;
}
.ws-tag-name {
font-weight: 500;
max-width: 160px;
overflow: hidden;
text-overflow: ellipsis;
}
.titlebar-drag-spacer {
flex: 1;
height: 100%;
@@ -153,9 +193,51 @@ body {
color: #ffffff;
}
/* 主内容区 */
.main-viewport {
/* 工作区终端主舞台与标签页栏 (工作区子层级,与终端严格对齐) */
.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;
min-height: 0;
position: relative;
overflow: hidden;
background: transparent;