From eb0a67695e4a836e16119b323233b03c859b66b0 Mon Sep 17 00:00:00 2001 From: David Hill Date: Mon, 16 Mar 2026 16:38:41 +0000 Subject: [PATCH] fix(ui): remove left sidebar and back/forward nav when no project --- packages/app/src/components/titlebar.tsx | 197 ++++++++++++----------- packages/app/src/pages/layout.tsx | 146 +++++++++-------- 2 files changed, 182 insertions(+), 161 deletions(-) diff --git a/packages/app/src/components/titlebar.tsx b/packages/app/src/components/titlebar.tsx index 345903420c03..2230bffe5e58 100644 --- a/packages/app/src/components/titlebar.tsx +++ b/packages/app/src/components/titlebar.tsx @@ -58,6 +58,7 @@ export function Titlebar() { }) const path = () => `${location.pathname}${location.search}${location.hash}` + const home = createMemo(() => !params.dir) const creating = createMemo(() => { if (!params.dir) return false if (params.id) return false @@ -175,113 +176,119 @@ export function Titlebar() { >
-
- -
+ +
+ +
+
-
- -
+ +
+ +
+
- - - -
diff --git a/packages/app/src/pages/layout.tsx b/packages/app/src/pages/layout.tsx index ab2687dcab93..7dcd747dc4f9 100644 --- a/packages/app/src/pages/layout.tsx +++ b/packages/app/src/pages/layout.tsx @@ -111,6 +111,7 @@ export default function Layout(props: ParentProps) { let scrollContainerRef: HTMLDivElement | undefined const params = useParams() + const home = createMemo(() => !params.dir) const globalSDK = useGlobalSDK() const globalSync = useGlobalSync() const layout = useLayout() @@ -2241,7 +2242,7 @@ export default function Layout(props: ParentProps) { const sidebarContent = (mobile?: boolean) => ( layout.sidebar.opened()} + opened={() => (home() ? false : layout.sidebar.opened())} aimMove={aim.move} projects={projects} renderProject={(project) => ( @@ -2285,7 +2286,7 @@ export default function Layout(props: ParentProps) { "absolute inset-y-0 left-0": true, "z-10": true, }} - style={{ width: `${Math.max(layout.sidebar.width(), 244)}px` }} + style={{ width: home() ? "4rem" : `${Math.max(layout.sidebar.width(), 244)}px` }} ref={(el) => { setState("nav", el) }} @@ -2294,13 +2295,14 @@ export default function Layout(props: ParentProps) { }} onMouseLeave={() => { aim.reset() + if (home()) return if (!sidebarHovering()) return arm() }} >
{sidebarContent()}
- +
setState("sizing", true)}> -
-
{ - if (e.target === e.currentTarget) layout.mobileSidebar.hide() - }} - /> - -
+ +
+
{ + if (e.target === e.currentTarget) layout.mobileSidebar.hide() + }} + /> + +
+
}> @@ -2373,43 +2383,47 @@ export default function Layout(props: ParentProps) {
-
{ - disarm() - aim.reset() - }} - onPointerDown={disarm} - onMouseLeave={() => { - arm() - }} - > - - - -
+ +
{ + disarm() + aim.reset() + }} + onPointerDown={disarm} + onMouseLeave={() => { + arm() + }} + > + + + +
+
-
-
-
+ +
+
+
+
{import.meta.env.DEV && }