diff --git a/packages/ui/src/App.tsx b/packages/ui/src/App.tsx index 2aa430fc..1a312edf 100644 --- a/packages/ui/src/App.tsx +++ b/packages/ui/src/App.tsx @@ -101,7 +101,6 @@ const App: Component = () => { binaryPath: string instanceId: string } | null>(null) - const phoneQuery = useMediaQuery("(max-width: 767px)") const isPhoneLayout = createMemo(() => phoneQuery()) diff --git a/packages/ui/src/components/instance/instance-shell2.tsx b/packages/ui/src/components/instance/instance-shell2.tsx index c2689fdb..bbd39925 100644 --- a/packages/ui/src/components/instance/instance-shell2.tsx +++ b/packages/ui/src/components/instance/instance-shell2.tsx @@ -834,6 +834,50 @@ const InstanceShell2: Component = (props) => { } const showingInfoView = createMemo(() => activeSessionIdForInstance() === "info") + const activeSessionTitle = createMemo(() => { + if (showingInfoView()) return null + const title = activeSessionForInstance()?.title?.trim() + return title || t("sessionList.session.untitled") + }) + const showHeaderLeftSlot = createMemo(() => !leftPinned()) + const showHeaderSessionTitle = createMemo(() => showHeaderLeftSlot() && Boolean(activeSessionTitle())) + const headerToolbarHorizontalInset = createMemo(() => (isPhoneLayout() ? 16 : 24)) + const headerLeftSlotWidth = createMemo(() => Math.max(0, sessionSidebarWidth() - headerToolbarHorizontalInset())) + const headerLeftSlotStyle = createMemo(() => + leftDrawerState() === "floating-open" || showHeaderSessionTitle() ? { width: `${headerLeftSlotWidth()}px` } : undefined, + ) + + const renderActiveSessionHeaderTitle = () => ( + +
+ {activeSessionTitle()} +
+
+ ) + + const renderHeaderLeftSlot = () => ( + +
+ + + {leftAppBarButtonIcon()} + + + {renderActiveSessionHeaderTitle()} +
+
+ ) const isLaunching = createMemo(() => props.instance.status === "starting") @@ -926,33 +970,56 @@ const InstanceShell2: Component = (props) => { fallback={
- - - {leftAppBarButtonIcon()} - - + {renderHeaderLeftSlot()} -
- {renderSessionHeaderIndicators()} -
+
+ {renderSessionHeaderIndicators()} +
-
- +
+ + + + + + + + +
+ +
+ + + +
+ + - = (props) => { })()} - - - - -
- -
- - - -
- - - - - - - - {rightAppBarButtonIcon()} - - + + + {rightAppBarButtonIcon()} + +
@@ -1031,18 +1064,7 @@ const InstanceShell2: Component = (props) => { } >
- - - {leftAppBarButtonIcon()} - - + {renderHeaderLeftSlot()}