fix(hub): keep AI coach page within one viewport
Lock page height and scroll summary/chat inside equal panels instead of extending the document. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3343,33 +3343,85 @@ html[data-theme="light"] button.danger {
|
|||||||
border-color: rgba(201, 53, 82, 0.45);
|
border-color: rgba(201, 53, 82, 0.45);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- Hub AI 教练 --- */
|
/* --- Hub AI 教练(整页一屏,内容区内滚动)--- */
|
||||||
|
body.hub-page-ai {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
body.hub-page-ai .app-shell {
|
||||||
|
padding-bottom: 12px;
|
||||||
|
height: 100dvh;
|
||||||
|
max-height: 100dvh;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
body.hub-page-ai .app-header {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
body.hub-page-ai #page-ai {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-height: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
#page-ai .page-head {
|
#page-ai .page-head {
|
||||||
margin-bottom: 12px;
|
flex-shrink: 0;
|
||||||
|
margin: 8px 0 10px;
|
||||||
|
}
|
||||||
|
#page-ai .page-head h1 {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
#page-ai .page-desc {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 0.78rem;
|
||||||
|
line-height: 1.35;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.ai-layout {
|
.ai-layout {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-height: 0;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
gap: 16px;
|
grid-template-rows: minmax(0, 1fr);
|
||||||
|
gap: 12px;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
min-height: calc(100vh - 168px);
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
@media (max-width: 960px) {
|
@media (max-width: 960px) {
|
||||||
|
body.hub-page-ai .app-shell {
|
||||||
|
height: auto;
|
||||||
|
max-height: none;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
body.hub-page-ai {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
body.hub-page-ai #page-ai {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
.ai-layout {
|
.ai-layout {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
min-height: 0;
|
grid-template-rows: minmax(280px, 42vh) minmax(280px, 42vh);
|
||||||
|
overflow: visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ai-panel {
|
.ai-panel {
|
||||||
background: var(--panel);
|
background: var(--panel);
|
||||||
border: 1px solid var(--border-soft);
|
border: 1px solid var(--border-soft);
|
||||||
border-radius: var(--radius);
|
border-radius: var(--radius);
|
||||||
padding: 14px 16px;
|
padding: 12px 14px;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
|
max-height: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 12px;
|
gap: 10px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.ai-panel-head {
|
.ai-panel-head {
|
||||||
@@ -3404,8 +3456,18 @@ html[data-theme="light"] button.danger {
|
|||||||
.ai-panel-scroll {
|
.ai-panel-scroll {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
overflow: auto;
|
max-height: 100%;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
overscroll-behavior: contain;
|
overscroll-behavior: contain;
|
||||||
|
scrollbar-gutter: stable;
|
||||||
|
}
|
||||||
|
.ai-panel-scroll::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
}
|
||||||
|
.ai-panel-scroll::-webkit-scrollbar-thumb {
|
||||||
|
background: color-mix(in srgb, var(--muted) 45%, transparent);
|
||||||
|
border-radius: 999px;
|
||||||
}
|
}
|
||||||
.ai-stats-row {
|
.ai-stats-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -3533,9 +3595,9 @@ html[data-theme="light"] button.danger {
|
|||||||
}
|
}
|
||||||
.ai-chat-form textarea {
|
.ai-chat-form textarea {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
resize: vertical;
|
resize: none;
|
||||||
min-height: 72px;
|
min-height: 52px;
|
||||||
max-height: 160px;
|
max-height: 88px;
|
||||||
padding: 10px 12px;
|
padding: 10px 12px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border: 1px solid var(--border-soft);
|
border: 1px solid var(--border-soft);
|
||||||
|
|||||||
@@ -647,6 +647,7 @@
|
|||||||
document.querySelectorAll(".page").forEach((el) => {
|
document.querySelectorAll(".page").forEach((el) => {
|
||||||
el.classList.toggle("hidden", el.id !== pageId);
|
el.classList.toggle("hidden", el.id !== pageId);
|
||||||
});
|
});
|
||||||
|
document.body.classList.toggle("hub-page-ai", page === "ai");
|
||||||
if (page === "monitor") startMonitorPoll();
|
if (page === "monitor") startMonitorPoll();
|
||||||
else stopMonitorPoll();
|
else stopMonitorPoll();
|
||||||
if (page === "settings") loadSettingsUI();
|
if (page === "settings") loadSettingsUI();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" media="print" onload="this.media='all'" />
|
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" media="print" onload="this.media='all'" />
|
||||||
<noscript><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" /></noscript>
|
<noscript><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" /></noscript>
|
||||||
<link rel="stylesheet" href="/assets/app.css?v=20260606-hub-ai2" />
|
<link rel="stylesheet" href="/assets/app.css?v=20260606-hub-ai3" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="app-bg" aria-hidden="true"></div>
|
<div class="app-bg" aria-hidden="true"></div>
|
||||||
@@ -233,7 +233,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="ai-chat-messages" class="ai-panel-scroll ai-chat-messages" aria-live="polite"></div>
|
<div id="ai-chat-messages" class="ai-panel-scroll ai-chat-messages" aria-live="polite"></div>
|
||||||
<form id="ai-chat-form" class="ai-chat-form">
|
<form id="ai-chat-form" class="ai-chat-form">
|
||||||
<textarea id="ai-chat-input" rows="3" placeholder="聊聊行情、心态、纪律、执行…" autocomplete="off"></textarea>
|
<textarea id="ai-chat-input" rows="2" placeholder="聊聊行情、心态、纪律、执行…" autocomplete="off"></textarea>
|
||||||
<button type="submit" id="btn-ai-chat-send" class="primary">发送</button>
|
<button type="submit" id="btn-ai-chat-send" class="primary">发送</button>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
@@ -287,6 +287,6 @@
|
|||||||
<div id="toast"></div>
|
<div id="toast"></div>
|
||||||
<script src="https://unpkg.com/lightweight-charts@4.2.0/dist/lightweight-charts.standalone.production.js"></script>
|
<script src="https://unpkg.com/lightweight-charts@4.2.0/dist/lightweight-charts.standalone.production.js"></script>
|
||||||
<script src="/assets/chart.js?v=20260604-upnl-contracts"></script>
|
<script src="/assets/chart.js?v=20260604-upnl-contracts"></script>
|
||||||
<script src="/assets/app.js?v=20260606-hub-ai2"></script>
|
<script src="/assets/app.js?v=20260606-hub-ai3"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user