fix: 工作空间面板改为 flex 子元素,修复与主内容区错位
- workspace-panel 从 position:fixed 改为 flex 子元素,与日志面板布局模式一致 - 移除 margin-right:480px hack,工作空间自然占据宽度 - 移除 updateNavHeight() 和 --nav-height CSS 变量(不再需要) - 移除 border-top(flex 布局下顶部自动对齐)
This commit is contained in:
+1
-16
@@ -212,8 +212,6 @@ async function init(): Promise<void> {
|
||||
setupDesktopIntegration();
|
||||
|
||||
bindGlobalEvents();
|
||||
updateNavHeight();
|
||||
window.addEventListener('resize', updateNavHeight);
|
||||
|
||||
await checkConnection();
|
||||
await loadModels();
|
||||
@@ -285,24 +283,11 @@ async function init(): Promise<void> {
|
||||
initSettingsModal();
|
||||
initHistoryModal();
|
||||
setupDesktopIntegration();
|
||||
updateNavHeight();
|
||||
window.addEventListener('resize', updateNavHeight);
|
||||
checkConnection().then(loadModels);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态计算顶部导航高度(header + model-bar),
|
||||
* 设为 CSS 变量 --nav-height,供 workspace-panel 引用
|
||||
*/
|
||||
function updateNavHeight(): void {
|
||||
const header = document.querySelector<HTMLElement>('.app-header');
|
||||
const modelBar = document.querySelector<HTMLElement>('.model-bar');
|
||||
const headerH = header?.getBoundingClientRect().height ?? 0;
|
||||
const modelBarH = modelBar?.getBoundingClientRect().height ?? 0;
|
||||
const total = Math.ceil(headerH + modelBarH);
|
||||
document.documentElement.style.setProperty('--nav-height', `${total}px`);
|
||||
}
|
||||
|
||||
|
||||
function bindGlobalEvents(): void {
|
||||
document.querySelector('#btnNewChat')?.addEventListener('click', startNewSession);
|
||||
|
||||
Reference in New Issue
Block a user