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
+9 -8
View File
@@ -1,7 +1,8 @@
/**
* JournalPanel — right panel container for the journal stream
*
* Fixed overlay. Shows stream when connected, connect dialog when not.
* On mobile: fixed overlay with backdrop.
* On desktop: positioned by the parent flex container (width transition).
* Auto-connects to ws://{current host}:{current port} — no URL input needed.
*/
@@ -33,19 +34,19 @@ export const JournalPanel: Component<JournalPanelProps> = (props) => {
return (
<>
{/* Backdrop — only on mobile, starts below header */}
{/* Mobile backdrop — overlay that appears below the header */}
<div
class="fixed top-16 inset-x-0 bottom-0 bg-black/30 z-40 md:hidden"
classList={{ hidden: !props.open }}
onClick={props.onClose}
/>
{/* Panel — always mounted for exit animation, visibility toggled */}
{/* Panel — on mobile: fixed overlay; on desktop: fills the parent wrapper */}
<aside
class={`fixed top-16 right-0 bottom-0 z-50 bg-white border-l border-gray-200
flex flex-col w-full max-w-md md:w-105 shadow-lg
transition-transform duration-300 ease-in-out ${
props.open ? "translate-x-0" : "translate-x-full"
}`}
class={`fixed top-16 right-0 bottom-0 z-50 bg-white
flex flex-col w-full h-full max-w-md shadow-lg
transition-transform duration-300 ease-in-out
md:static md:inset-auto md:w-105 md:max-w-none md:shadow-none md:border-l md:border-gray-200
${props.open ? "translate-x-0" : "translate-x-full"}`}
inert={!props.open}
>
<JournalContext.Provider value={{ onClose: props.onClose }}>