Update web_src/js/features/file-view.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: hamkido <hamki.do2000@gmail.com>
This commit is contained in:
hamkidoandCopilot authored and GitHub committed 2026-01-26 17:18:37 +08:00
1 parent 860afc51d3
commit 5896a80421
1 file changed
+3 -1
+3 -1
View File
@@ -77,7 +77,9 @@ function updateSidebarPosition(elFileView: HTMLElement, sidebar: HTMLElement): v
// Dynamically calculate max-height so sidebar doesn't extend below segment bottom
const availableHeight = Math.max(0, segmentRect.bottom - topPos);
const cssMaxHeight = window.innerHeight - 140; // Match CSS calc(100vh - 140px)
// 140px accounts for fixed layout chrome (header, spacing, etc.) and must match CSS: calc(100vh - 140px)
const cssMaxHeightOffset = 140;
const cssMaxHeight = window.innerHeight - cssMaxHeightOffset;
const maxHeight = Math.min(availableHeight, cssMaxHeight);
// Hide sidebar if available height is too small