refactor: implement scroll container context and flex layout

Switch from fixed positioning to a flexbox-based layout for the
main application structure. This introduces a `ScrollContainerCtx` to
provide access to the main scrollable element, allowing child
components like `FileTree` and `RevealManager` to perform accurate
scrolling and positioning relative to the container instead of the
window.

refactor: set JournalPanel height to full
This commit is contained in:
2026-07-08 15:03:31 +08:00
parent b54f7ab1fa
commit 5097aba842
5 changed files with 115 additions and 49 deletions
+2 -2
View File
@@ -158,7 +158,7 @@ export const MobileSidebar: Component<SidebarProps> = (props) => {
};
/**
* 桌面端固定侧边栏
* 桌面端侧边栏 — flex child, no fixed positioning
*/
export const DesktopSidebar: Component<{
fileTree?: FileNode[];
@@ -182,7 +182,7 @@ export const DesktopSidebar: Component<{
});
return (
<aside class="hidden md:block fixed top-0 left-0 h-full w-64 bg-white shadow-lg z-30 overflow-hidden pt-16">
<aside class="hidden md:flex flex-col w-64 shrink-0 bg-white shadow-lg overflow-hidden">
<SidebarContent
fileTree={fileTree()}
pathHeadings={pathHeadings()}