diff --git a/webui/src/App.tsx b/webui/src/App.tsx index d5f31a6ca..2a15d5380 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -2816,6 +2816,7 @@ function Shell({ hostChromeTitleInset={hostSidebarCollapsed} hideThemeButton={!context.active} hideHeaderTitle + inlineHandle={workbenchPaneSessions.length > 1} headerActions={context.headerActions} headerPortalTarget={context.headerPortalTarget} headerActive={context.active} diff --git a/webui/src/components/thread/ThreadShell.tsx b/webui/src/components/thread/ThreadShell.tsx index 273b56c57..f2abe9e78 100644 --- a/webui/src/components/thread/ThreadShell.tsx +++ b/webui/src/components/thread/ThreadShell.tsx @@ -346,6 +346,7 @@ interface ThreadShellProps { hostChromeTitleInset?: boolean; hideThemeButton?: boolean; hideHeaderTitle?: boolean; + inlineHandle?: boolean; hideHeader?: boolean; headerActions?: ReactNode; headerPortalTarget?: HTMLElement | null; @@ -645,6 +646,7 @@ export function ThreadShell({ hostChromeTitleInset = false, hideThemeButton = false, hideHeaderTitle = false, + inlineHandle = false, hideHeader = false, headerActions, headerPortalTarget, @@ -1614,7 +1616,7 @@ export function ThreadShell({ const threadHeader = !hideHeader ? (
- {hideHeaderTitle && !temporary && session?.handle ? ( + {hideHeaderTitle && inlineHandle && !temporary && session?.handle ? (
{ ); }); + it("moves the session handle into the pane only when the workbench is split", () => { + const client = makeClient(); + const portal = document.createElement("div"); + document.body.append(portal); + const activeSession = { + ...session("pane-handle"), + handle: { + id: "handle_11111111111111111111111111111111", + name: "soro", + }, + }; + + const { unmount } = render(wrap( + client, + {}} + hideHeaderTitle + headerPortalTarget={portal} + />, + )); + + expect(within(portal).getByText("@soro")).toBeInTheDocument(); + expect(screen.queryByLabelText("Session @soro")).not.toBeInTheDocument(); + + unmount(); + const splitView = render(wrap( + client, + {}} + hideHeaderTitle + inlineHandle + headerPortalTarget={portal} + />, + )); + + expect(screen.getByLabelText("Session @soro")).toHaveTextContent("@soro"); + expect(within(portal).queryByText("@soro")).not.toBeInTheDocument(); + + splitView.unmount(); + portal.remove(); + }); + it("keeps inferred file paths non-interactive when the availability probe fails", async () => { await preloadMarkdownText(); const client = makeClient();