fix: mobile hub AI keyboard layout and instance top nav scroll

Sync hub shell to visualViewport when the keyboard opens to prevent white screen above chat input. Make instance tabs horizontally scrollable with active tab centered on phone.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-09 17:16:00 +08:00
parent 9aba8ec645
commit 02d2a6c70b
9 changed files with 159 additions and 23 deletions
+29 -7
View File
@@ -3815,15 +3815,31 @@ body.hub-page-ai #page-ai {
@media (max-width: 720px) {
body.hub-page-ai .app-shell {
padding-bottom: max(8px, env(safe-area-inset-bottom));
height: 100dvh;
max-height: 100dvh;
height: var(--hub-vvh, 100dvh);
max-height: var(--hub-vvh, 100dvh);
overflow: hidden;
width: 100%;
max-width: none;
box-sizing: border-box;
will-change: transform, height;
}
body.hub-page-ai {
overflow: hidden;
background: var(--bg);
}
body.hub-page-ai.hub-ai-keyboard-open .app-header,
body.hub-page-ai.hub-ai-keyboard-open #page-ai .page-head {
display: none;
}
body.hub-page-ai.hub-ai-keyboard-open .ai-mobile-tabs {
margin-bottom: 4px;
}
body.hub-page-ai.hub-ai-keyboard-open .ai-panel-head {
padding-bottom: 0;
}
body.hub-page-ai #page-ai {
@@ -3896,23 +3912,29 @@ body.hub-page-ai #page-ai {
body.hub-page-ai .ai-chat-panel {
padding-bottom: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
body.hub-page-ai .ai-chat-messages {
flex: 1 1 auto;
min-height: 0;
padding-bottom: 8px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
body.hub-page-ai .ai-chat-form {
position: sticky;
bottom: 0;
position: relative;
flex-shrink: 0;
z-index: 3;
width: 100%;
margin: 0;
padding: 10px 0 max(10px, env(safe-area-inset-bottom));
background: color-mix(in srgb, var(--panel) 92%, transparent);
backdrop-filter: blur(10px);
background: var(--panel);
border-top: 1px solid var(--border-soft);
box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.28);
box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.18);
}
body.hub-page-ai .ai-chat-form textarea {