fix(terminal): restore app-bar top inset so tab bar and xterm are not clipped
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# Changelog: 终端页顶部被遮挡修复
|
||||
|
||||
**日期**: 2026-06-02
|
||||
|
||||
## 摘要
|
||||
|
||||
修复 WebSSH 终端页顶部(标签栏 / xterm 首行)被顶栏 App Bar 裁切或遮挡的问题。
|
||||
|
||||
## 动机
|
||||
|
||||
`nexus-terminal-main` 曾设置 `padding-top: 0`,抵消了 Vuetify 为 `v-app-bar` 预留的 `--v-layout-top` 留白,导致终端区域上沿与全局顶栏重叠。
|
||||
|
||||
## 变更
|
||||
|
||||
- `frontend/src/App.vue`:恢复 `padding-top: var(--v-layout-top)`;高度改为 `100dvh` + `box-sizing: border-box`,在保留顶栏留白的同时占满剩余视口
|
||||
- `frontend/src/pages/TerminalPage.vue`:xterm 去掉顶部 padding,减轻首行字符被裁切
|
||||
|
||||
## 涉及文件
|
||||
|
||||
- `frontend/src/App.vue`
|
||||
- `frontend/src/pages/TerminalPage.vue`
|
||||
|
||||
## 验证
|
||||
|
||||
1. `cd frontend && npx vite build`
|
||||
2. 打开 `#/terminal`:标签栏完整可见,不被蓝色顶栏盖住
|
||||
3. 连接会话后 xterm 首行提示符完整显示
|
||||
|
||||
## 迁移 / 重启
|
||||
|
||||
仅前端构建部署。
|
||||
@@ -408,17 +408,19 @@ interface SearchResults {
|
||||
|
||||
<style>
|
||||
/*
|
||||
* 终端页:高度占满内容区;宽度随 --v-layout-left 随侧栏开合自动缩进(勿 padding:0)
|
||||
* 终端页:占满视口剩余高度;保留 --v-layout-top 顶栏留白(禁止 padding-top:0,否则标签栏被 App Bar 遮挡)
|
||||
* 宽度随 --v-layout-left 随侧栏开合自动缩进
|
||||
*/
|
||||
.v-application .v-main.nexus-terminal-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100dvh - var(--v-layout-top, 64px));
|
||||
box-sizing: border-box;
|
||||
height: 100dvh;
|
||||
max-height: 100dvh;
|
||||
min-height: 0;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
padding-top: 0 !important;
|
||||
padding-top: var(--v-layout-top, 64px) !important;
|
||||
padding-bottom: 0 !important;
|
||||
transition:
|
||||
padding 0.2s cubic-bezier(0.4, 0, 0.2, 1),
|
||||
|
||||
@@ -299,8 +299,10 @@ onBeforeUnmount(() => {
|
||||
font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Menlo, monospace;
|
||||
}
|
||||
:deep(.xterm) {
|
||||
padding: 4px;
|
||||
/* 顶部不加 padding,避免首行字符被 overflow 裁切 */
|
||||
padding: 0 4px 4px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
:deep(.xterm-viewport) {
|
||||
overflow-y: auto !important;
|
||||
|
||||
Reference in New Issue
Block a user