A desktop coding agent with free access to frontier models.
TypeScript
feat: IDE layout and narrow chat fixes
ogsamrat77859c752cf7
diff --git a/apps/app/src/components/chat/message-list.tsx b/apps/app/src/components/chat/message-list.tsxindex 228924d9..5f342355 100644--- a/apps/app/src/components/chat/message-list.tsx+++ b/apps/app/src/components/chat/message-list.tsx@@ -527,7 +527,7 @@ const AssistantMessage = React.memo(return (<Message- className="mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 md:px-10"+ className="mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 @min-[40rem]/chatpane:px-10"data-message-id={message.id}data-message-role={message.role}>@@ -722,7 +722,7 @@ const UserMessage = React.memo(return (<Message- className="mx-auto flex w-full max-w-3xl flex-col items-end gap-2 px-2 md:px-10"+ className="mx-auto flex w-full max-w-3xl flex-col items-end gap-2 px-2 @min-[40rem]/chatpane:px-10"data-message-id={message.id}data-message-role={message.role}>@@ -899,7 +899,7 @@ const MessageComponent = React.memo(MessageComponent.displayName = "MessageComponent"const LoadingMessage = React.memo(({ elapsedSeconds }: { elapsedSeconds: number }) => (- <Message className="mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 md:px-10">+ <Message className="mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 @min-[40rem]/chatpane:px-10"><div data-loading-message="working" className="py-1 text-sm text-muted-foreground"><span className="ow-text-shimmer tabular-nums">Working {formatElapsedSeconds(elapsedSeconds)}</span></div>@@ -938,7 +938,7 @@ const ReconnectingMessage = React.memo(({ lastConfirmedAt }: { lastConfirmedAt:}, [])const lastConfirmedLabel = reconnectingLastConfirmedLabel(lastConfirmedAt, now)return (- <Message className="mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 md:px-10">+ <Message className="mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 @min-[40rem]/chatpane:px-10"><divdata-loading-message="reconnecting"className="flex min-w-0 items-center gap-2 py-1 text-sm text-muted-foreground"@@ -1042,7 +1042,7 @@ function ErrorMessage({ error, description, showDescriptionOnResume, resumePromp// quiet status line (like "Working 12s"), with Resume as the emphasis.if (resumePrompt && onResumeInterrupted) {return (- <Message className="not-prose mx-auto flex w-full max-w-3xl flex-col items-start gap-1 px-2 md:px-10">+ <Message className="not-prose mx-auto flex w-full max-w-3xl flex-col items-start gap-1 px-2 @min-[40rem]/chatpane:px-10"><divdata-testid="session-error-interrupted"className="flex min-w-0 items-center gap-2 py-1 text-sm text-muted-foreground"@@ -1070,7 +1070,7 @@ function ErrorMessage({ error, description, showDescriptionOnResume, resumePromp}return (- <Message className="not-prose mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-0 md:px-10">+ <Message className="not-prose mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-0 @min-[40rem]/chatpane:px-10"><div className="group flex w-full flex-col items-start gap-0"><div className="flex min-w-0 flex-1 flex-col gap-1.5 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm"><div className="flex flex-row items-start gap-2">@@ -1141,7 +1141,7 @@ const RetryMessage = React.memo(({ status }: RetryMessageProps) => {const freeModelLimit = action?.reason === "free_tier_limit"return (- <Message className="not-prose mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-0 md:px-10">+ <Message className="not-prose mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-0 @min-[40rem]/chatpane:px-10"><div className="group flex w-full flex-col items-start gap-0"><div className="flex min-w-0 flex-1 flex-col gap-1.5 rounded-md border border-warning/30 bg-warning/5 px-3 py-2 text-sm text-amber-12"><div className="flex items-start gap-2">@@ -1208,7 +1208,7 @@ function CompletedStepRun({ label, children }: { label: string; children: React.return (<Collapsible open={open} onOpenChange={setOpen} className="flex w-full flex-col gap-2">- <div className="mx-auto flex w-full max-w-3xl px-2 md:px-10">+ <div className="mx-auto flex w-full max-w-3xl px-2 @min-[40rem]/chatpane:px-10"><CollapsibleTriggerclassName="group flex cursor-pointer items-center gap-1 text-sm text-muted-foreground transition-colors hover:text-foreground"aria-label={open ? `${label}. Hide steps` : `${label}. Show steps`}@@ -1347,7 +1347,7 @@ function MessageGroup({? proseReasoning.map((reasoning) => (<Messagekey={`folded-reasoning-${reasoning.key}`}- className="mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 md:px-10"+ className="mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 @min-[40rem]/chatpane:px-10"><ReasoningBlock text={reasoning.text} isStreaming={reasoning.isStreaming} /></Message>@@ -1380,7 +1380,7 @@ function MessageGroup({if (!run) returnnodes.push(<div key={`aggregate-${run.key}`}>- <Message className="mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 md:px-10">+ <Message className="mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 @min-[40rem]/chatpane:px-10"><ToolAggregateGroup parts={run.parts} className="w-full" /></Message></div>@@ -1427,7 +1427,7 @@ function MessageGroup({{mcpAppParts.map((part) => (<Messagekey={`mcp-app-${part.toolCallId}`}- className="mx-auto flex w-full max-w-3xl flex-col px-2 empty:hidden md:px-10"+ className="mx-auto flex w-full max-w-3xl flex-col px-2 empty:hidden @min-[40rem]/chatpane:px-10"><McpAppFrame part={part} /></Message>diff --git a/apps/app/src/react-app/domains/quality/good-session.tsx b/apps/app/src/react-app/domains/quality/good-session.tsxindex c6e2eb14..2c75a6c9 100644--- a/apps/app/src/react-app/domains/quality/good-session.tsx+++ b/apps/app/src/react-app/domains/quality/good-session.tsx@@ -2,7 +2,9 @@import { useEffect, useMemo, useRef, useState } from "react";import type { UIMessage } from "ai";import type { OmniRushSessionStatus } from "@omnirush/types/desktop-ipc";-import { AlertTriangle, CircleCheck, CircleX, Star } from "lucide-react";+import { AlertTriangle, ChevronDown, CircleCheck, CircleX, Star } from "lucide-react";++const CHECKLIST_OPEN_KEY = "omnirush.goodSession.checklistOpen";import {AlertDialog,@@ -419,6 +421,8 @@ export function GoodSessionChecklistBar(props: GoodSessionChecklistBarProps) {const prompts = useMemo(() => promptsInTranscript(props.messages), [props.messages]);const [followUpFor, setFollowUpFor] = useState<string | null>(null);const [followUpOff, setFollowUpOff] = useState(() => readPref(FOLLOW_UP_OFF_KEY) === "1");+ // The checklist opens on demand (remembered); the summary always shows how many checks pass.+ const [checklistOpen, setChecklistOpen] = useState(() => readPref(CHECKLIST_OPEN_KEY) === "1");const serverFollowUpOff = serverStatusUsable(server) && server.client?.oneMoreTurn === false;useEffect(() => {const sessionId = props.sessionId;@@ -465,10 +469,12 @@ export function GoodSessionChecklistBar(props: GoodSessionChecklistBarProps) {if (!hasPrompt) return null;const verdict = checklist.verdict;+ const passedChecks = checklist.checks.filter((check) => check.state === "pass").length;const dock = checklist.dock;const dockLink = dock?.link;return (- <div className="px-4 max-lg:px-3 lg:px-8" data-testid="good-session-checklist" data-verdict={verdict} data-source={checklist.source}>+ // A container: the checklist lays out by the chat's own width (the chat can be narrow beside the editor), not the window's.+ <div className="@container/quality px-4 max-lg:px-3 lg:px-8" data-testid="good-session-checklist" data-verdict={verdict} data-source={checklist.source}>{dock ? (<divrole="status"@@ -516,33 +522,51 @@ export function GoodSessionChecklistBar(props: GoodSessionChecklistBarProps) {</div>) : null}{props.client ? <GoodSessionLine result={goodSession} /> : null}- <div className="mx-auto flex max-w-[800px] items-center gap-2 pb-1.5">- <div- className="flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 rounded-full border border-border bg-popover/60 px-2.5 py-1 text-[11px] leading-4 text-muted-foreground"+ {/* At every width: a compact summary ("On track ★ 4/6") that opens to the full checklist,+ and the guide link on its own line under it (never cut off at the right edge). */}+ <div className="mx-auto flex max-w-[800px] flex-col items-start gap-1 pb-1.5" data-testid="good-session-row" data-expanded={checklistOpen ? "" : undefined}>+ <button+ type="button"+ onClick={() => {+ const next = !checklistOpen;+ setChecklistOpen(next);+ writePref(CHECKLIST_OPEN_KEY, next ? "1" : "0");+ }}+ aria-expanded={checklistOpen}aria-label={checklist.text}role="status"+ data-testid="good-session-summary"+ className={cn(+ "flex max-w-full min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1 border border-border bg-popover/60 px-2.5 py-1 text-start text-[11px] leading-4 text-muted-foreground transition-colors hover:bg-muted/60",+ checklistOpen ? "w-full rounded-xl px-3 py-1.5" : "rounded-full",+ )}>- <Star- data-testid="good-session-star"- data-filled={verdict === "good" ? "" : undefined}- className={cn("size-3 shrink-0", verdict === "good" ? "fill-current text-foreground" : verdict === "on-track" ? "text-foreground" : "text-muted-foreground")}- aria-hidden="true"- />- <span className="whitespace-nowrap font-medium text-foreground">{checklistHeading(verdict)}:</span>- {checklist.checks.map((check, index) => (- <span key={check.id} className="inline-flex items-center gap-1.5">- {index > 0 ? <span aria-hidden="true" className="text-muted-foreground/60">·</span> : null}- <CheckMark check={check} />+ <span className="inline-flex min-w-0 items-center gap-1.5">+ <Star+ data-testid="good-session-star"+ data-filled={verdict === "good" ? "" : undefined}+ className={cn("size-3 shrink-0", verdict === "good" ? "fill-current text-foreground" : verdict === "on-track" ? "text-foreground" : "text-muted-foreground")}+ aria-hidden="true"+ />+ <span className="truncate font-medium text-foreground">{checklistHeading(verdict)}</span>+ <span className={cn("shrink-0 tabular-nums", passedChecks < checklist.checks.length && "text-amber-11")} data-testid="good-session-count">+ {passedChecks}/{checklist.checks.length}</span>- ))}- </div>+ <ChevronDown className={cn("size-3 shrink-0 transition-transform", checklistOpen && "rotate-180")} aria-hidden="true" />+ </span>+ {checklistOpen ? (+ <span className="flex basis-full flex-wrap items-center gap-x-3 gap-y-1" data-testid="good-session-checks">+ {checklist.checks.map((check) => <CheckMark key={check.id} check={check} />)}+ </span>+ ) : null}+ </button><Popover><PopoverTriggerrender={(<buttontype="button"data-testid="good-session-guide-link"- className="shrink-0 whitespace-nowrap text-[11px] text-muted-foreground underline-offset-2 transition hover:text-foreground hover:underline"+ className="shrink-0 whitespace-nowrap ps-1 text-[11px] text-muted-foreground underline-offset-2 transition hover:text-foreground hover:underline"/>)}>diff --git a/apps/app/src/react-app/domains/session/chat/permission-approval-modal.tsx b/apps/app/src/react-app/domains/session/chat/permission-approval-modal.tsxindex 2e4622e0..af97635e 100644--- a/apps/app/src/react-app/domains/session/chat/permission-approval-modal.tsx+++ b/apps/app/src/react-app/domains/session/chat/permission-approval-modal.tsx@@ -512,8 +512,8 @@ export function PermissionApprovalPanel(props: PermissionApprovalModalProps) {const Icon = presentation.isDoomLoop ? RefreshCcw : ShieldCheck;return (- <div ref={rootRef} data-permission-panel={permissionId} className="overflow-hidden border-b border-dls-border bg-transparent">- <div className="flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between">+ <div ref={rootRef} data-permission-panel={permissionId} className="@container/approval overflow-hidden border-b border-dls-border bg-transparent">+ <div className="flex flex-col gap-3 px-4 py-3 @min-[36rem]/approval:flex-row @min-[36rem]/approval:items-center @min-[36rem]/approval:justify-between"><div className="flex min-w-0 items-start gap-3"><div className="mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-xl border border-dls-border bg-dls-hover text-dls-secondary"><Icon size={16} strokeWidth={1.9} />@@ -540,7 +540,7 @@ export function PermissionApprovalPanel(props: PermissionApprovalModalProps) {</div></div>- <div className="flex shrink-0 flex-wrap items-center gap-2 sm:justify-end">+ <div className="flex shrink-0 flex-wrap items-center gap-2 @min-[36rem]/approval:justify-end"><Buttontype="button"variant="outline"@@ -584,7 +584,7 @@ export function PermissionApprovalPanel(props: PermissionApprovalModalProps) {</div><div className="border-t border-dls-border px-4 py-3">- <div className="grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,2fr)]">+ <div className="grid gap-3 @min-[36rem]/approval:grid-cols-[minmax(0,1fr)_minmax(0,2fr)]"><div><div className="text-[10px] font-semibold uppercase tracking-[0.16em] text-dls-secondary">{t("session.permission_label")}diff --git a/apps/app/src/react-app/domains/session/chat/session-page.tsx b/apps/app/src/react-app/domains/session/chat/session-page.tsxindex 77e9c81a..907a74a2 100644--- a/apps/app/src/react-app/domains/session/chat/session-page.tsx+++ b/apps/app/src/react-app/domains/session/chat/session-page.tsx@@ -4,7 +4,7 @@ import { useCallback, useEffect, useEffectEvent, useMemo, useRef, useState } froimport { usePanelRef } from "react-resizable-panels";import { DesktopUpdateButton } from "../../settings/state/desktop-updater-provider";import { BuildathonChip } from "../../buildathon/buildathon";-import { ArrowLeft, Cloud, Code2, FileDiff, FileText, Gauge, Redo2, Undo2, Globe, ListChecks, Maximize2, MoreHorizontal, PanelRight, TextSearch, X, Zap } from "lucide-react";+import { ArrowLeft, Cloud, Code2, FileDiff, Layers, MessageSquare, LayoutGrid, Library, MessageSquareOff, PanelLeft, FileText, Gauge, Redo2, Undo2, Globe, ListChecks, Maximize2, MoreHorizontal, PanelRight, TextSearch, X, Zap } from "lucide-react";import { SessionCommandControls } from "../commands/session-command-controls";import { useSessionCommandBridge, useSessionCommandsStore } from "../commands/session-commands-store";@@ -90,7 +90,8 @@ import { getSidePanelSessionKey } from "../panel/side-panel-session";import { useCreateTab } from "../panel/use-side-panel-tabs";import { TerminalDock } from "../terminal/terminal-dock";import { LazyEditorPanel } from "../editor/editor-entry";-import { useEditorStore } from "../editor/editor-store";+import { DEFAULT_IDE_CHAT_WIDTH, useEditorStore, type LayoutMode } from "../editor/editor-store";+import { ChatPanelButton, ChatSwitcher, LayoutModeToggle, RailDestinations, shortcutLabel, WorkspaceSwitcher, type RailDestination } from "../editor/ide-chrome";import { useActivePanelTab, usePanelTabStore, useSessionPanelState } from "../panel/panel-tab-store";import { useWorkspaceShellLayout } from "../../../shell/workspace-shell-layout";import { useControlAction, type OmniRushControlAction } from "../../../shell/control/control-provider";@@ -193,6 +194,7 @@ export type SessionPageSidebarProps = {onOpenDashboard?: () => void;tasksActive?: boolean;tasksRunningCount?: number;+ onOpenTasksForWorkspace?: (workspaceId: string) => void;onOpenTasks?: () => void;/** Opens the cross-session message search dialog (Cmd/Ctrl+Shift+F). */onOpenSessionSearch?: () => void;@@ -495,11 +497,19 @@ export function SessionPage(props: SessionPageProps) {const activeSidePanel = sessionSidePanel;const sidePanelOpen = activeSidePanel !== null;const panelRailActive = activeSidePanel === "panel";- const editorOpen = activeSidePanel === "editor";// The editor needs the local server's file routes: desktop, local workspaces.const editorAvailable = isElectronRuntime()&& Boolean(props.omnirushServerClient && props.runtimeWorkspaceId)&& props.selectedWorkspaceDisplay.workspaceType !== "remote";+ // The layout: Chat (sessions sidebar + chat) or IDE (files, editor, terminal; chat docked right), per workspace.+ const storedLayoutMode = useEditorStore((state) => state.modeByWorkspace[props.selectedWorkspaceId] ?? "chat");+ const ideMode = editorAvailable && !isMobile && storedLayoutMode === "ide";+ const layoutMode: LayoutMode = ideMode ? "ide" : "chat";+ const ideChatCollapsed = useEditorStore((state) => state.ideChatCollapsed);+ const setLayoutMode = useCallback((mode: LayoutMode) => {+ if (mode === "ide" && !editorAvailable) return;+ useEditorStore.getState().setMode(props.selectedWorkspaceId, mode);+ }, [editorAvailable, props.selectedWorkspaceId]);const denControlPlaneConfigured = useDenControlPlaneConfigured();const showCloudSignIn =shellConfig.cloudSignin && denControlPlaneConfigured && !denAuth.isSignedIn && denAuth.status !== "checking";@@ -562,6 +572,7 @@ export function SessionPage(props: SessionPageProps) {const [createGroupLabel, setCreateGroupLabel] = useState("");const [createGroupWorkspaceId, setCreateGroupWorkspaceId] = useState<string | null>(null);const browserPanelRef = usePanelRef();+ const ideChatPanelRef = usePanelRef();const selectNarrowPane = useCallback((pane: NarrowSessionPane) => {setNarrowPane(pane);@@ -797,32 +808,40 @@ export function SessionPage(props: SessionPageProps) {const closeRightPane = useCallback(() => {setCurrentSidePanel(null);}, [setCurrentSidePanel]);- // The editor stays open when the chat changes (a new chat starting, another chat picked):- // a chat that never had a side panel of its own gets the editor the last one had.- const lastSidePanel = useRef<{ key: string; panel: SidePanelItem | null }>({ key: sidePanelSessionKey, panel: sessionSidePanel });- useEffect(() => {- const last = lastSidePanel.current;- if (last.key !== sidePanelSessionKey && last.panel === "editor") {- const own = useUiStateStore.getState().sidePanelState[sidePanelSessionKey];- if (own === undefined) setSidePanelState(sidePanelSessionKey, "editor");- }- lastSidePanel.current = { key: sidePanelSessionKey, panel: useUiStateStore.getState().sidePanelState[sidePanelSessionKey] ?? (last.key !== sidePanelSessionKey && last.panel === "editor" ? "editor" : null) };- }, [sessionSidePanel, setSidePanelState, sidePanelSessionKey]);-- // Cmd/Ctrl+Shift+E toggles the editor; Cmd/Ctrl+P opens it with quick open (use-shell-shortcuts.ts).+ // Shortcuts (use-shell-shortcuts.ts): Cmd/Ctrl+Shift+E and Cmd/Ctrl+P open IDE mode (P with quick open),+ // Cmd/Ctrl+Shift+Y switches Chat/IDE, Cmd/Ctrl+Shift+H shows or hides the chat in IDE mode.const editorShowRequest = useEditorStore((state) => state.showRequest);const editorToggleRequest = useEditorStore((state) => state.toggleRequest);- const lastEditorRequests = useRef({ show: editorShowRequest, toggle: editorToggleRequest });+ const modeToggleRequest = useEditorStore((state) => state.modeToggleRequest);+ const chatToggleRequest = useEditorStore((state) => state.chatToggleRequest);+ const lastEditorRequests = useRef({ show: editorShowRequest, toggle: editorToggleRequest, mode: modeToggleRequest, chat: chatToggleRequest });useEffect(() => {const last = lastEditorRequests.current;- lastEditorRequests.current = { show: editorShowRequest, toggle: editorToggleRequest };+ lastEditorRequests.current = { show: editorShowRequest, toggle: editorToggleRequest, mode: modeToggleRequest, chat: chatToggleRequest };if (!editorAvailable) {if (editorShowRequest !== last.show) useEditorStore.getState().setQuickOpen(false);return;}- if (editorShowRequest !== last.show) setCurrentSidePanel("editor");- else if (editorToggleRequest !== last.toggle) toggleCurrentSidePanel("editor");- }, [editorAvailable, editorShowRequest, editorToggleRequest, setCurrentSidePanel, toggleCurrentSidePanel]);+ if (editorShowRequest !== last.show || editorToggleRequest !== last.toggle) {+ setLayoutMode("ide");+ if (editorToggleRequest !== last.toggle) useEditorStore.getState().setView(props.runtimeWorkspaceId ?? "", "files");+ } else if (modeToggleRequest !== last.mode) {+ setLayoutMode(ideMode ? "chat" : "ide");+ } else if (chatToggleRequest !== last.chat && ideMode) {+ useEditorStore.getState().setIdeChatCollapsed(!useEditorStore.getState().ideChatCollapsed);+ }+ }, [chatToggleRequest, editorAvailable, editorShowRequest, editorToggleRequest, ideMode, modeToggleRequest, props.runtimeWorkspaceId, setLayoutMode]);+ // The editor used to open as a side panel; a chat that still has it set opens IDE mode instead.+ useEffect(() => {+ if (activeSidePanel !== "editor") return;+ setCurrentSidePanel(null);+ if (editorAvailable) setLayoutMode("ide");+ }, [activeSidePanel, editorAvailable, setCurrentSidePanel, setLayoutMode]);+ // An approval must never wait in a hidden chat: it brings the chat panel back.+ useEffect(() => {+ if (ideMode && props.activePermission && useEditorStore.getState().ideChatCollapsed) useEditorStore.getState().setIdeChatCollapsed(false);+ }, [ideMode, props.activePermission]);+const openGeneralSidePanel = useCallback(() => {setCurrentSidePanel("panel");}, [setCurrentSidePanel]);@@ -1451,26 +1470,6 @@ export function SessionPage(props: SessionPageProps) {<div className="flex h-full min-h-0 flex-col overflow-y-auto bg-background">{props.settingsSlot}</div>- ) : activeSidePanel === "editor" && editorAvailable && props.omnirushServerClient && props.runtimeWorkspaceId ? (- <LazyEditorPanel- client={props.omnirushServerClient}- workspaceId={props.runtimeWorkspaceId}- workspaceRoot={props.selectedWorkspaceRoot}- sessionId={props.selectedSessionId}- sessionBusy={sessionTurnRunning(props.selectedSessionId)}- opencodeClient={props.opencodeClient ?? null}- terminalOpen={Boolean(props.terminalOpen)}- onToggleTerminal={() => props.onTerminalOpenChange?.(!props.terminalOpen)}- terminal={props.terminalOpen ? (- <TerminalDock- workspaceId={props.selectedWorkspaceId}- workspaceRoot={props.selectedWorkspaceRoot}- isRemoteWorkspace={props.selectedWorkspaceDisplay.workspaceType === "remote"}- onClose={() => props.onTerminalOpenChange?.(false)}- />- ) : null}- onClose={closeRightPane}- />) : activeSidePanel === "panel" ? (<SidePanelsessionId={sidePanelSessionKey}@@ -1483,112 +1482,31 @@ export function SessionPage(props: SessionPageProps) {/>) : null;- return (- <div className="flex h-full min-h-0 flex-col bg-[radial-gradient(circle_at_top,rgba(74,111,255,0.12),transparent_42%),var(--app-bg,#0b1020)] text-dls-text max-lg:pt-[env(safe-area-inset-top)] mac:bg-transparent">- <SidebarProvider- open={sidebarOpen}- onOpenChange={setSidebarOpen}- className={cn(- "relative min-h-0 flex-1 mac:bg-transparent",- leftSidebarResizing &&- "**:data-[slot=sidebar-container]:transition-none **:data-[slot=sidebar-gap]:transition-none",- !shellConfig.sidebar && "**:data-[slot=sidebar-container]:hidden **:data-[slot=sidebar-gap]:hidden",- )}- style={sidebarProviderStyle}- >- <AppSidebar- sessionNumberShortcuts={props.sessionNumberShortcuts}- workspaceSessionGroups={props.sidebar.workspaceSessionGroups}- selectedWorkspaceId={props.sidebar.selectedWorkspaceId}- developerMode={props.sidebar.developerMode}- selectedSessionId={props.sidebar.selectedSessionId}- showSessionActions={Boolean(props.onRenameSession || props.onDeleteSession || props.onArchiveSession)}- sessionStatusById={props.sidebar.sessionStatusById}- connectingWorkspaceId={props.sidebar.connectingWorkspaceId}- workspaceConnectionStateById={props.sidebar.workspaceConnectionStateById}- newTaskDisabled={props.sidebar.newTaskDisabled}- onSelectWorkspace={props.sidebar.onSelectWorkspace}- onOpenSession={openSessionTab}- onPrefetchSession={props.sidebar.onPrefetchSession}- onCreateTaskInWorkspace={props.sidebar.onCreateTaskInWorkspace}- onCreateSplitTaskInWorkspace={props.sidebar.onCreateSplitTaskInWorkspace}- onOpenRenameSession={props.onRenameSession ? openRenameModal : undefined}- onOpenDeleteSession={props.onDeleteSession ? (sessionId) => {- const openDelete = () => {- setSessionActionId(sessionId);- setDeleteOpen(true);- };- guardLeave(leavingRunningTurn({ action: "delete", turnRunning: sessionTurnRunning(sessionId) }), openDelete, sessionId);- } : undefined}- onArchiveSession={props.onArchiveSession ? (sessionId, archived) => {- void props.onArchiveSession?.(sessionId, archived);- } : undefined}- archiveDisabledReason={props.archiveDisabledReason}- onOpenCreateGroupModal={(workspaceId) => {- setCreateGroupWorkspaceId(workspaceId);- setCreateGroupLabel("");- setCreateGroupOpen(true);- }}- onOpenRenameWorkspace={props.sidebar.onOpenRenameWorkspace}- onShareWorkspace={props.sidebar.onShareWorkspace}- onRevealWorkspace={props.sidebar.onRevealWorkspace}- onRecoverWorkspace={props.sidebar.onRecoverWorkspace}- onTestWorkspaceConnection={props.sidebar.onTestWorkspaceConnection}- onRetryWorkspaceTasks={props.sidebar.onRetryWorkspaceTasks}- onEditWorkspaceConnection={props.sidebar.onEditWorkspaceConnection}- onForgetWorkspace={props.sidebar.onForgetWorkspace}- onOpenCreateWorkspace={props.sidebar.onOpenCreateWorkspace}- onOpenSessionSearch={props.sidebar.onOpenSessionSearch}- auditClient={props.omnirushServerClient}- automationsActive={props.sidebar.automationsActive}- automationsNeedAttention={props.sidebar.automationsNeedAttention}- onOpenAutomations={props.sidebar.onOpenAutomations}- dashboardActive={props.sidebar.dashboardActive}- onOpenDashboard={props.sidebar.onOpenDashboard}- tasksActive={props.sidebar.tasksActive}- tasksRunningCount={props.sidebar.tasksRunningCount}- onOpenTasks={props.sidebar.onOpenTasks}- conversationHistory={{- canGoBack: canGoBackInConversationHistory,- canGoForward: canGoForwardInConversationHistory,- onNavigate: navigateConversationHistory,- }}- onReorderWorkspaces={props.sidebar.onReorderWorkspaces}- onStartResize={startLeftSidebarResize}- onOpenAccountSettings={props.onOpenSettings}- onOpenExtensions={props.onOpenExtensions}- extensionsActive={props.extensionsActive}- status={{- clientConnected: props.clientConnected,- omnirushServerStatus: props.omnirushServerStatus,- developerMode: props.developerMode,- showConnectionStatus: Boolean(props.selectedWorkspaceId),- providerConnectedIds: props.providerConnectedIds,- mcpConnectedCount: props.mcpConnectedCount,- showSettingsButton: props.statusBar?.showSettingsButton,- reloadBusy: props.statusBar?.reloadBusy,- reloadError: props.statusBar?.reloadError,- omniRushConnectState: props.statusBar?.omniRushConnectState,- onSendFeedback: props.onSendFeedback,- }}- />- <SidebarInset- className={cn(- "min-h-0 overflow-hidden bg-sidebar mac:bg-transparent mac:[&_header]:transition-[padding-left] mac:[&_header]:duration-200 mac:[&_header]:ease-linear mac:peer-data-[state=collapsed]:[&_header]:pl-34 mac:max-md:[&_header]:pl-34",- !shellConfig.sidebar && "mac:[&_header]:pl-34",- )}- >- <div className={cn(- "flex min-h-0 flex-1 max-lg:p-0 lg:py-2 lg:pl-2",- !sidebarOpen && "mac:lg:pt-0 mac:lg:pl-0",- )}>- <ResizablePanelGroup- orientation="horizontal"- onLayoutChanged={sidePanelOpen ? commitBrowserPanelWidth : undefined}- className="min-h-0 flex-1 max-lg:rounded-none lg:rounded-[14px]"- >- <ResizablePanel minSize={isMobile ? "0px" : "360px"} className="min-w-0">- <main data-session-pane className="flex h-full min-w-0 flex-col overflow-hidden bg-dls-surface max-lg:rounded-none max-lg:border-0 max-lg:shadow-none lg:rounded-[14px] lg:border lg:border-border lg:shadow-[0_8px_24px_rgba(15,23,42,0.06)] dark:lg:shadow-[0_10px_30px_rgba(0,0,0,0.45)] mac:bg-dls-surface/85 mac:backdrop-blur-2xl mac:backdrop-saturate-150">+ // This project's chats for the IDE chat switcher, newest first as the sidebar lists them.+ const ideChats = (props.sidebar.workspaceSessionGroups.find((group) => group.workspace.id === props.selectedWorkspaceId)?.sessions ?? [])+ .filter((session) => !session.parentID)+ .map((session) => {+ const status = props.sidebar.sessionStatusById[session.id];+ return {+ id: session.id,+ title: getDisplaySessionTitle(session.title) || t("session.default_title"),+ status: status === "waiting" ? "approval" as const : status === "thinking" || status === "responding" || status === "compacting" ? "running" as const : "idle" as const,+ };+ });++ // IDE mode hides the sessions sidebar: its destinations move to the foot of the activity rail.+ const railDestinations: RailDestination[] = [+ ...(props.sidebar.onOpenTasks ? [{ id: "tasks", label: "Parallel tasks", icon: <Layers className="size-4" />, badge: props.sidebar.tasksRunningCount || undefined, onSelect: props.sidebar.onOpenTasks }] : []),+ ...(props.sidebar.onOpenSessionSearch ? [{ id: "search", label: "Search sessions", icon: <TextSearch className="size-4" />, onSelect: props.sidebar.onOpenSessionSearch }] : []),+ ...(props.sidebar.onOpenAutomations ? [{ id: "automations", label: "Automations", icon: <Zap className="size-4" />, badge: props.sidebar.automationsNeedAttention ? 1 : undefined, onSelect: props.sidebar.onOpenAutomations }] : []),+ ...(props.sidebar.onOpenDashboard ? [{ id: "dashboard", label: "Dashboard", icon: <LayoutGrid className="size-4" />, onSelect: props.sidebar.onOpenDashboard }] : []),+ { id: "library", label: "Library", icon: <Library className="size-4" />, onSelect: props.onOpenExtensions },+ { id: "chat-layout", label: "Audit trail, workflows: Chat layout", icon: <PanelLeft className="size-4" />, onSelect: () => setLayoutMode("chat") },+ ];++ // The chat itself: beside the sessions sidebar in Chat mode, docked on the right in IDE mode.+ const chatPane = (+ <main data-session-pane className="@container/chatpane flex h-full min-w-0 flex-col overflow-hidden bg-dls-surface max-lg:rounded-none max-lg:border-0 max-lg:shadow-none lg:rounded-[14px] lg:border lg:border-border lg:shadow-[0_8px_24px_rgba(15,23,42,0.06)] dark:lg:shadow-[0_10px_30px_rgba(0,0,0,0.45)] mac:bg-dls-surface/85 mac:backdrop-blur-2xl mac:backdrop-saturate-150">{/* The pane `<main>` above already carries the macOS vibrancy blur. Asecond backdrop filter on the header (or on the transcript surfacebelow) is invisible — nothing scrolls beneath either — but each@@ -1596,7 +1514,18 @@ export function SessionPage(props: SessionPageProps) {repaints. Keep the pane as the only backdrop surface. */}<header className="z-10 flex h-9 shrink-0 items-center justify-between border-b border-border px-3 max-lg:h-12 lg:px-6 mac:titlebar-drag @container/titlebar"><div className="flex min-w-0 items-center gap-3">- {shellConfig.sidebar ? <SidebarTrigger className="mac:hidden" /> : null}+ {ideMode ? (+ <ChatSwitcher+ chats={ideChats}+ selectedId={props.selectedSessionId}+ title={selectedSessionTitle || t("session.default_title")}+ onOpen={(sessionId) => openSessionTab(props.selectedWorkspaceId, sessionId)}+ onNew={() => void props.sidebar.onCreateTaskInWorkspace(props.selectedWorkspaceId)}+ newDisabled={props.sidebar.newTaskDisabled}+ />+ ) : null}+ {shellConfig.sidebar && !ideMode ? <SidebarTrigger className="mac:hidden" /> : null}+ {editorAvailable && !ideMode && !isMobile && !props.primarySlot && !hasMainContentTakeover ? <LayoutModeToggle mode={layoutMode} onChange={setLayoutMode} /> : null}{parentSessionLink && !props.primarySlot && !hasMainContentTakeover ? (<Tooltip><TooltipTrigger@@ -1619,7 +1548,7 @@ export function SessionPage(props: SessionPageProps) {<TooltipContent>Back to parent chat</TooltipContent></Tooltip>) : null}- <h1 className="truncate text-[13px] font-medium text-dls-text">+ <h1 className={cn("truncate text-[13px] font-medium text-dls-text", ideMode && "sr-only")}>{props.primaryTitle? props.primaryTitle: props.mainContentTitle@@ -1628,7 +1557,7 @@ export function SessionPage(props: SessionPageProps) {? t("session.create_or_connect_workspace"): selectedSessionTitle || t("session.default_title")}</h1>- {!props.primaryTitle && !props.mainContentTitle && !showWorkspaceSetupEmptyState ? (+ {!props.primaryTitle && !props.mainContentTitle && !showWorkspaceSetupEmptyState && !ideMode ? (// Pinned and archived sessions are listed across workspaces, so// the header names the workspace the open session belongs to.<span@@ -1636,7 +1565,7 @@ export function SessionPage(props: SessionPageProps) {data-session-header-workspace={workspaceName}><span aria-hidden="true">·</span>- <span className="max-w-40 truncate">{workspaceName}</span>+ <span className="max-w-40 truncate @max-[30rem]/titlebar:max-w-20">{workspaceName}</span></span>) : null}{props.developerMode ? (@@ -1655,6 +1584,8 @@ export function SessionPage(props: SessionPageProps) {<BuildathonChip /><DesktopUpdateButton />{commandSessionId && props.runtimeWorkspaceId ? (+ // Undo, redo, status: in the "More actions" menu when the chat is narrow.+ <div className="hidden items-center gap-1.5 @min-[40rem]/titlebar:flex" data-session-command-controls><SessionCommandControlsworkspaceId={props.runtimeWorkspaceId}sessionId={commandSessionId}@@ -1672,6 +1603,7 @@ export function SessionPage(props: SessionPageProps) {onModelVariantChange: props.surface.onModelVariantChange,} : null}/>+ </div>) : null}{!props.primarySlot && findButtonSessionId && !hasMainContentTakeover ? (<Tooltip>@@ -1680,7 +1612,7 @@ export function SessionPage(props: SessionPageProps) {<Buttonvariant="ghost"size="icon-sm"- className="hidden rounded-xl text-gray-10 transition-colors hover:bg-muted hover:text-foreground lg:inline-flex"+ className="hidden rounded-xl text-gray-10 transition-colors hover:bg-muted hover:text-foreground @min-[40rem]/titlebar:inline-flex"aria-label="Find in conversation"onClick={() => useSessionFindStore.getState().openFind({ sessionId: findButtonSessionId })}>@@ -1698,7 +1630,7 @@ export function SessionPage(props: SessionPageProps) {variant="ghost"size="icon-sm"className={cn(- "hidden rounded-xl text-gray-10 transition-colors hover:bg-muted hover:text-foreground lg:inline-flex",+ "hidden rounded-xl text-gray-10 transition-colors hover:bg-muted hover:text-foreground @min-[40rem]/titlebar:inline-flex",sidePanelOpen && "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary",)}aria-label={sidePanelOpen ? "Close side panel" : "Open side panel"}@@ -1721,7 +1653,7 @@ export function SessionPage(props: SessionPageProps) {<Buttonvariant="secondary"size="sm"- className="hidden lg:inline-flex"+ className="hidden @min-[40rem]/titlebar:inline-flex"onClick={openCloudSignIn}title={t("den.signin_title")}aria-label={t("den.signin_title")}@@ -1736,14 +1668,28 @@ export function SessionPage(props: SessionPageProps) {<Buttonvariant="ghost"size="icon-sm"- className="rounded-xl text-gray-10 transition-colors hover:bg-muted hover:text-foreground lg:hidden"+ className={cn("rounded-xl text-gray-10 transition-colors hover:bg-muted hover:text-foreground", !ideMode && "@min-[40rem]/titlebar:hidden")}aria-label="More actions"><MoreHorizontal size={18} /></Button>}/>- <DropdownMenuContent align="end" className="w-56">+ <DropdownMenuContent align="end" className="w-60">+ {editorAvailable && !isMobile ? (+ <DropdownMenuItem onClick={() => setLayoutMode(ideMode ? "chat" : "ide")} data-menu-layout-toggle>+ {ideMode ? <MessageSquare className="size-4" /> : <Code2 className="size-4" />}+ <span className="flex-1">{ideMode ? "Switch to Chat layout" : "Switch to IDE layout"}</span>+ <span className="text-[11px] text-muted-foreground">{shortcutLabel("Y")}</span>+ </DropdownMenuItem>+ ) : null}+ {ideMode ? (+ <DropdownMenuItem onClick={() => useEditorStore.getState().setIdeChatCollapsed(true)}>+ <MessageSquareOff className="size-4" />+ <span className="flex-1">Hide chat</span>+ <span className="text-[11px] text-muted-foreground">{shortcutLabel("H")}</span>+ </DropdownMenuItem>+ ) : null}{!props.primarySlot && findButtonSessionId && !hasMainContentTakeover ? (<DropdownMenuItemonClick={() => useSessionFindStore.getState().openFind({ sessionId: findButtonSessionId })}@@ -1797,6 +1743,9 @@ export function SessionPage(props: SessionPageProps) {) : null}</DropdownMenuContent></DropdownMenu>+ {ideMode ? (+ <ChatPanelButton open attention={null} onToggle={() => useEditorStore.getState().setIdeChatCollapsed(true)} />+ ) : null}{props.developerMode ? (<Buttonvariant="ghost"@@ -2124,7 +2073,7 @@ export function SessionPage(props: SessionPageProps) {) : null}</div></ResizablePanel>- {props.terminalOpen && !isMobile && !(editorOpen && editorAvailable) ? (+ {props.terminalOpen && !isMobile && !ideMode ? (<><ResizableHandle /><ResizablePanel defaultSize="280px" minSize="160px" maxSize="55%" className="min-h-0">@@ -2141,6 +2090,206 @@ export function SessionPage(props: SessionPageProps) {)}</main>+ );++ return (+ <div className="flex h-full min-h-0 flex-col bg-[radial-gradient(circle_at_top,rgba(74,111,255,0.12),transparent_42%),var(--app-bg,#0b1020)] text-dls-text max-lg:pt-[env(safe-area-inset-top)] mac:bg-transparent">+ <SidebarProvider+ open={sidebarOpen}+ onOpenChange={setSidebarOpen}+ className={cn(+ "relative min-h-0 flex-1 mac:bg-transparent",+ leftSidebarResizing &&+ "**:data-[slot=sidebar-container]:transition-none **:data-[slot=sidebar-gap]:transition-none",+ (!shellConfig.sidebar || ideMode) && "**:data-[slot=sidebar-container]:hidden **:data-[slot=sidebar-gap]:hidden",+ )}+ style={sidebarProviderStyle}+ >+ <AppSidebar+ sessionNumberShortcuts={props.sessionNumberShortcuts}+ workspaceSessionGroups={props.sidebar.workspaceSessionGroups}+ selectedWorkspaceId={props.sidebar.selectedWorkspaceId}+ developerMode={props.sidebar.developerMode}+ selectedSessionId={props.sidebar.selectedSessionId}+ showSessionActions={Boolean(props.onRenameSession || props.onDeleteSession || props.onArchiveSession)}+ sessionStatusById={props.sidebar.sessionStatusById}+ connectingWorkspaceId={props.sidebar.connectingWorkspaceId}+ workspaceConnectionStateById={props.sidebar.workspaceConnectionStateById}+ newTaskDisabled={props.sidebar.newTaskDisabled}+ onSelectWorkspace={props.sidebar.onSelectWorkspace}+ onOpenSession={openSessionTab}+ onPrefetchSession={props.sidebar.onPrefetchSession}+ onCreateTaskInWorkspace={props.sidebar.onCreateTaskInWorkspace}+ onCreateSplitTaskInWorkspace={props.sidebar.onCreateSplitTaskInWorkspace}+ onOpenRenameSession={props.onRenameSession ? openRenameModal : undefined}+ onOpenDeleteSession={props.onDeleteSession ? (sessionId) => {+ const openDelete = () => {+ setSessionActionId(sessionId);+ setDeleteOpen(true);+ };+ guardLeave(leavingRunningTurn({ action: "delete", turnRunning: sessionTurnRunning(sessionId) }), openDelete, sessionId);+ } : undefined}+ onArchiveSession={props.onArchiveSession ? (sessionId, archived) => {+ void props.onArchiveSession?.(sessionId, archived);+ } : undefined}+ archiveDisabledReason={props.archiveDisabledReason}+ onOpenCreateGroupModal={(workspaceId) => {+ setCreateGroupWorkspaceId(workspaceId);+ setCreateGroupLabel("");+ setCreateGroupOpen(true);+ }}+ onOpenRenameWorkspace={props.sidebar.onOpenRenameWorkspace}+ onShareWorkspace={props.sidebar.onShareWorkspace}+ onRevealWorkspace={props.sidebar.onRevealWorkspace}+ onRecoverWorkspace={props.sidebar.onRecoverWorkspace}+ onTestWorkspaceConnection={props.sidebar.onTestWorkspaceConnection}+ onRetryWorkspaceTasks={props.sidebar.onRetryWorkspaceTasks}+ onEditWorkspaceConnection={props.sidebar.onEditWorkspaceConnection}+ onForgetWorkspace={props.sidebar.onForgetWorkspace}+ onOpenCreateWorkspace={props.sidebar.onOpenCreateWorkspace}+ onOpenSessionSearch={props.sidebar.onOpenSessionSearch}+ auditClient={props.omnirushServerClient}+ automationsActive={props.sidebar.automationsActive}+ automationsNeedAttention={props.sidebar.automationsNeedAttention}+ onOpenAutomations={props.sidebar.onOpenAutomations}+ dashboardActive={props.sidebar.dashboardActive}+ onOpenDashboard={props.sidebar.onOpenDashboard}+ tasksActive={props.sidebar.tasksActive}+ tasksRunningCount={props.sidebar.tasksRunningCount}+ onOpenTasksForWorkspace={props.sidebar.onOpenTasksForWorkspace}+ onOpenTasks={props.sidebar.onOpenTasks}+ conversationHistory={{+ canGoBack: canGoBackInConversationHistory,+ canGoForward: canGoForwardInConversationHistory,+ onNavigate: navigateConversationHistory,+ }}+ onReorderWorkspaces={props.sidebar.onReorderWorkspaces}+ onStartResize={startLeftSidebarResize}+ onOpenAccountSettings={props.onOpenSettings}+ onOpenExtensions={props.onOpenExtensions}+ extensionsActive={props.extensionsActive}+ status={{+ clientConnected: props.clientConnected,+ omnirushServerStatus: props.omnirushServerStatus,+ developerMode: props.developerMode,+ showConnectionStatus: Boolean(props.selectedWorkspaceId),+ providerConnectedIds: props.providerConnectedIds,+ mcpConnectedCount: props.mcpConnectedCount,+ showSettingsButton: props.statusBar?.showSettingsButton,+ reloadBusy: props.statusBar?.reloadBusy,+ reloadError: props.statusBar?.reloadError,+ omniRushConnectState: props.statusBar?.omniRushConnectState,+ onSendFeedback: props.onSendFeedback,+ }}+ />+ <SidebarInset+ className={cn(+ "min-h-0 overflow-hidden bg-sidebar mac:bg-transparent mac:[&_header]:transition-[padding-left] mac:[&_header]:duration-200 mac:[&_header]:ease-linear mac:peer-data-[state=collapsed]:[&_header]:pl-34 mac:max-md:[&_header]:pl-34",+ !shellConfig.sidebar && "mac:[&_header]:pl-34",+ )}+ >+ <div className={cn(+ "flex min-h-0 flex-1 max-lg:p-0 lg:py-2 lg:pl-2",+ !sidebarOpen && "mac:lg:pt-0 mac:lg:pl-0",+ ideMode && "lg:pr-2",+ )}>+ {ideMode && props.omnirushServerClient && props.runtimeWorkspaceId ? (+ // IDE mode: the editor (rail, files, tabs, terminal) on the left, the chat docked on the right.+ <ResizablePanelGroup+ key="ide-layout"+ orientation="horizontal"+ onLayoutChanged={() => {+ // Remembered, never fed back into the panel while it is open (that loops on sub-pixel sizes).+ if (useEditorStore.getState().ideChatCollapsed) return;+ const size = ideChatPanelRef.current?.getSize();+ if (size?.inPixels && size.inPixels >= 320 && Math.abs(size.inPixels - useEditorStore.getState().ideChatWidth) >= 2) {+ useEditorStore.getState().setIdeChatWidth(size.inPixels);+ }+ }}+ className="min-h-0 flex-1 overflow-hidden lg:rounded-[14px] lg:border lg:border-border lg:shadow-[0_8px_24px_rgba(15,23,42,0.06)] dark:lg:shadow-[0_10px_30px_rgba(0,0,0,0.45)]"+ data-layout="ide"+ >+ <ResizablePanel minSize="420px" className="min-h-0 min-w-0">+ <LazyEditorPanel+ client={props.omnirushServerClient}+ workspaceId={props.runtimeWorkspaceId}+ workspaceRoot={props.selectedWorkspaceRoot}+ sessionId={props.selectedSessionId}+ sessionBusy={sessionTurnRunning(props.selectedSessionId)}+ opencodeClient={props.opencodeClient ?? null}+ terminalOpen={Boolean(props.terminalOpen)}+ onToggleTerminal={() => props.onTerminalOpenChange?.(!props.terminalOpen)}+ terminal={props.terminalOpen ? (+ <TerminalDock+ workspaceId={props.selectedWorkspaceId}+ workspaceRoot={props.selectedWorkspaceRoot}+ isRemoteWorkspace={false}+ onClose={() => props.onTerminalOpenChange?.(false)}+ />+ ) : null}+ headerStart={(+ <>+ <LayoutModeToggle mode={layoutMode} onChange={setLayoutMode} />+ <WorkspaceSwitcher+ workspaces={props.sidebar.workspaceSessionGroups+ .filter((group) => !group.workspace.task)+ .map((group) => ({ id: group.workspace.id, name: workspaceTitleForId(props.sidebar.workspaceSessionGroups, group.workspace.id) }))}+ selectedId={props.selectedWorkspaceId}+ onSelect={(id) => void props.sidebar.onSelectWorkspace(id)}+ />+ </>+ )}+ headerEnd={ideChatCollapsed ? (+ <ChatPanelButton+ open={!ideChatCollapsed}+ attention={props.activePermission ? "approval" : sessionTurnRunning(props.selectedSessionId) ? "running" : null}+ onToggle={() => useEditorStore.getState().setIdeChatCollapsed(false)}+ />+ ) : null}+ railFoot={<RailDestinations destinations={railDestinations} onOpenSettings={props.onOpenSettings} />}+ />+ </ResizablePanel>+ {ideChatCollapsed ? (+ // The folded chat: a thin strip on the right edge brings it back.+ <button+ type="button"+ aria-label="Show chat"+ title={`Show chat (${shortcutLabel("H")})`}+ data-chat-strip+ onClick={() => useEditorStore.getState().setIdeChatCollapsed(false)}+ className="w-2 shrink-0 cursor-pointer border-s border-border bg-muted/40 transition-colors hover:bg-primary/20"+ />+ ) : (+ <>+ <ResizableHandle+ onDoubleClick={() => {+ ideChatPanelRef.current?.resize(`${DEFAULT_IDE_CHAT_WIDTH}px`);+ useEditorStore.getState().setIdeChatWidth(DEFAULT_IDE_CHAT_WIDTH);+ }}+ title="Drag to resize; double-click to reset"+ />+ <ResizablePanel+ panelRef={ideChatPanelRef}+ defaultSize={`${useEditorStore.getState().ideChatWidth}px`}+ minSize="340px"+ maxSize="65%"+ className="min-h-0 min-w-0"+ data-ide-chat+ >+ {chatPane}+ </ResizablePanel>+ </>+ )}+ </ResizablePanelGroup>+ ) : (+ <>+ <ResizablePanelGroup+ orientation="horizontal"+ onLayoutChanged={sidePanelOpen ? commitBrowserPanelWidth : undefined}+ className="min-h-0 flex-1 max-lg:rounded-none lg:rounded-[14px]"+ >+ <ResizablePanel minSize={isMobile ? "0px" : "360px"} className="min-w-0">+ {chatPane}</ResizablePanel>{sidePanelOpen && !isMobile ? (<>@@ -2164,14 +2313,10 @@ export function SessionPage(props: SessionPageProps) {<Buttonvariant="ghost"size="icon-sm"- className={cn(- "rounded-xl transition-colors hover:bg-muted hover:text-foreground",- editorOpen && "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary",- )}- onClick={() => toggleCurrentSidePanel("editor")}- title={`Editor (${/Mac/i.test(navigator.platform) ? "⌘⇧E" : "Ctrl+Shift+E"})`}- aria-label="Editor"- aria-pressed={editorOpen}+ className="rounded-xl transition-colors hover:bg-muted hover:text-foreground"+ onClick={() => setLayoutMode("ide")}+ title={`Open the IDE layout (${shortcutLabel("Y")})`}+ aria-label="Open the IDE layout"data-editor-rail><Code2 size={15} />@@ -2214,6 +2359,8 @@ export function SessionPage(props: SessionPageProps) {) : null}</Button></aside>+ </>+ )}</div></SidebarInset>{shellConfig.sidebar ? <SidebarTrigger className="hidden mac:absolute mac:left-[88px] mac:size-8! top-[3px] z-50 mac:flex titlebar-no-drag" /> : null}diff --git a/apps/app/src/react-app/domains/session/commands/review-fix-bar.tsx b/apps/app/src/react-app/domains/session/commands/review-fix-bar.tsxindex 54c0d3d3..e3392df3 100644--- a/apps/app/src/react-app/domains/session/commands/review-fix-bar.tsx+++ b/apps/app/src/react-app/domains/session/commands/review-fix-bar.tsx@@ -19,7 +19,7 @@ export function ReviewFixBar(props: { review: ReviewSummary; disabled?: boolean;// One click sends one fix command; the bar goes away once its turn starts.const [sent, setSent] = useState(false);return (- <div className="mx-auto flex w-full max-w-3xl flex-wrap items-center gap-2 px-2 md:px-10" data-testid="review-fix-bar">+ <div className="mx-auto flex w-full max-w-3xl flex-wrap items-center gap-2 px-2 @min-[40rem]/chatpane:px-10" data-testid="review-fix-bar">{REVIEW_SEVERITIES.filter((severity) => props.review.counts[severity] > 0).map((severity) => (<spankey={severity}diff --git a/apps/app/src/react-app/domains/session/editor/editor-panel.tsx b/apps/app/src/react-app/domains/session/editor/editor-panel.tsxindex ade926c5..9bd2e85a 100644--- a/apps/app/src/react-app/domains/session/editor/editor-panel.tsx+++ b/apps/app/src/react-app/domains/session/editor/editor-panel.tsx@@ -14,6 +14,8 @@ import {ChevronUp,CircleDot,FileCode2,+ FileDiff,+ Files,GitBranch,GitCommitHorizontal,Minus,@@ -56,7 +58,10 @@ export type EditorPanelProps = {terminal: ReactNode | null;terminalOpen: boolean;onToggleTerminal: () => void;- onClose: () => void;+ /** IDE layout slots: the header's left (mode toggle, workspace switch) and right (chat panel button), and the rail's foot (app destinations). */+ headerStart?: ReactNode;+ headerEnd?: ReactNode;+ railFoot?: ReactNode;};const MAX_REVIEW_FILES = 60;@@ -768,7 +773,7 @@ export default function EditorPanel(props: EditorPanelProps) {setSurface(null);return;}- const key = `${activeTab.id}`;+ const key = `${workspaceId}|${activeTab.id}`;void (async () => {if (activeTab.kind === "file") {const opened = await docs.open(activeTab.path);@@ -1054,48 +1059,76 @@ export default function EditorPanel(props: EditorPanelProps) {</div>);- const segment = (view: EditorSideView, label: string, badge?: number) => (- <button- type="button"- onClick={() => setView(view)}- data-editor-view={view}- aria-pressed={state.view === view && sideOpen}- className={cn(- "flex items-center gap-1 rounded-lg px-2.5 py-1 text-xs transition-colors",- state.view === view && sideOpen ? "bg-muted text-foreground" : "text-muted-foreground hover:text-foreground",- )}- >- {label}- {badge ? <span className="rounded-full bg-primary px-1.5 text-[10px] leading-4 text-primary-foreground">{badge}</span> : null}- </button>- );+ const mac = /Mac/i.test(navigator.platform);+ const railItem = (view: EditorSideView, label: string, icon: ReactNode, shortcut: string | null, badge?: number) => {+ const active = state.view === view && sideOpen;+ return (+ <Tooltip>+ <TooltipTrigger+ render={(+ <button+ type="button"+ onClick={() => setView(view)}+ data-editor-view={view}+ aria-label={label}+ aria-pressed={active}+ className={cn(+ "relative flex size-9 items-center justify-center rounded-lg transition-colors [&_svg]:size-[18px]",+ active ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-muted hover:text-foreground",+ )}+ >+ {icon}+ {badge ? (+ <span className="absolute right-0.5 top-0.5 min-w-3.5 rounded-full bg-primary px-1 text-center text-[9px] font-semibold leading-3.5 text-primary-foreground">+ {badge > 99 ? "99+" : badge}+ </span>+ ) : null}+ </button>+ )}+ />+ <TooltipContent side="right">{label}{shortcut ? ` (${shortcut})` : ""}</TooltipContent>+ </Tooltip>+ );+ };return (- <div ref={panelRef} className="relative flex h-full min-h-0 flex-col bg-background" data-editor-panel>- <div className="flex h-10 shrink-0 items-center gap-0.5 border-b border-border px-1.5">+ <div ref={panelRef} className="relative flex h-full min-h-0 bg-background" data-editor-panel data-editor-layout="ide">+ {/* The activity rail: the side views, quick open, and the app's own destinations at its foot. */}+ <nav aria-label="Editor views" className="flex w-12 shrink-0 flex-col items-center gap-1 border-e border-border py-2 mac:pt-10" data-editor-rail-views>+ {railItem("files", "Files", <Files />, mac ? "⌘⇧E" : "Ctrl+Shift+E")}+ {railItem("changes", "Agent changes", <FileDiff />, null, pendingCount)}+ {railItem("git", "Git", <GitBranch />, null, gitQuery.data?.repo ? gitQuery.data.files.length : undefined)}<Tooltip><TooltipTriggerrender={(- <Button variant="ghost" size="icon-sm" aria-label={sideOpen ? "Hide side bar" : "Show side bar"} onClick={() => useEditorStore.getState().setSideOpen(!sideOpen)}>- {sideOpen ? <PanelLeftClose /> : <PanelLeftOpen />}- </Button>+ <button+ type="button"+ aria-label="Go to file"+ onClick={() => useEditorStore.getState().setQuickOpen(true)}+ className="flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground [&_svg]:size-[18px]"+ >+ <Search />+ </button>)}/>- <TooltipContent>{sideOpen ? "Hide side bar" : "Show side bar"}</TooltipContent>+ <TooltipContent side="right">Go to file ({mac ? "⌘P" : "Ctrl+P"})</TooltipContent></Tooltip>- {segment("files", "Files")}- {segment("changes", "Changes", pendingCount)}- {segment("git", "Git", gitQuery.data?.repo ? gitQuery.data.files.length : undefined)}+ <span className="flex-1" />+ {props.railFoot}+ </nav>+ <div className="flex min-w-0 flex-1 flex-col">+ <div className="flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-2 mac:titlebar-drag mac:ps-6 [&_button]:mac:titlebar-no-drag" data-editor-header>+ {props.headerStart}<span className="flex-1" /><Tooltip><TooltipTriggerrender={(- <Button variant="ghost" size="icon-sm" aria-label="Go to file" onClick={() => useEditorStore.getState().setQuickOpen(true)}>- <Search />+ <Button variant="ghost" size="icon-sm" aria-label={sideOpen ? "Hide side bar" : "Show side bar"} onClick={() => useEditorStore.getState().setSideOpen(!sideOpen)}>+ {sideOpen ? <PanelLeftClose /> : <PanelLeftOpen />}</Button>)}/>- <TooltipContent>Go to file ({/Mac/i.test(navigator.platform) ? "⌘P" : "Ctrl+P"})</TooltipContent>+ <TooltipContent>{sideOpen ? "Hide side bar" : "Show side bar"}</TooltipContent></Tooltip><Tooltip><TooltipTrigger@@ -1112,18 +1145,9 @@ export default function EditorPanel(props: EditorPanelProps) {</Button>)}/>- <TooltipContent>Terminal ({/Mac/i.test(navigator.platform) ? "⌘J" : "Ctrl+J"})</TooltipContent>- </Tooltip>- <Tooltip>- <TooltipTrigger- render={(- <Button variant="ghost" size="icon-sm" aria-label="Close editor" onClick={props.onClose}>- <X />- </Button>- )}- />- <TooltipContent>Close editor</TooltipContent>+ <TooltipContent>Terminal ({mac ? "⌘J" : "Ctrl+J"})</TooltipContent></Tooltip>+ {props.headerEnd}</div><ResizablePanelGroup orientation="vertical" className="min-h-0 flex-1"><ResizablePanel minSize="160px" className="min-h-0">@@ -1150,6 +1174,7 @@ export default function EditorPanel(props: EditorPanelProps) {</>) : null}</ResizablePanelGroup>+ </div>{quickOpen ? (<QuickOpenfiles={files}diff --git a/apps/app/src/react-app/domains/session/editor/editor-store.ts b/apps/app/src/react-app/domains/session/editor/editor-store.tsindex 87339e84..6b468230 100644--- a/apps/app/src/react-app/domains/session/editor/editor-store.ts+++ b/apps/app/src/react-app/domains/session/editor/editor-store.ts@@ -14,6 +14,8 @@ export type EditorTab =| { id: string; kind: "git"; path: string; ref: "HEAD" | "index" };export type EditorSideView = "files" | "changes" | "git";+/** The window layout: Chat (sessions sidebar + chat) or IDE (files, editor and terminal, chat docked right). */+export type LayoutMode = "chat" | "ide";export type ReviewScope = "turn" | "chat";type WorkspaceEditorState = {@@ -33,6 +35,14 @@ type EditorStore = {toggleRequest: number;reviewScope: ReviewScope;sideOpen: boolean;+ /** The layout per workspace (remembered); Chat when never set. */+ modeByWorkspace: Record<string, LayoutMode>;+ /** IDE mode: the chat panel folded away, and its width when open. */+ ideChatCollapsed: boolean;+ ideChatWidth: number;+ /** One-shot requests from shortcuts: switch Chat/IDE (Cmd/Ctrl+Shift+Y), fold the chat (Cmd/Ctrl+Shift+H). */+ modeToggleRequest: number;+ chatToggleRequest: number;openTab: (workspaceId: string, tab: EditorTab, options?: { preview?: boolean }) => void;closeTab: (workspaceId: string, id: string) => void;selectTab: (workspaceId: string, id: string) => void;@@ -43,8 +53,15 @@ type EditorStore = {requestToggle: () => void;setReviewScope: (scope: ReviewScope) => void;setSideOpen: (open: boolean) => void;+ setMode: (workspaceId: string, mode: LayoutMode) => void;+ setIdeChatCollapsed: (collapsed: boolean) => void;+ setIdeChatWidth: (width: number) => void;+ requestModeToggle: () => void;+ requestChatToggle: () => void;};+export const DEFAULT_IDE_CHAT_WIDTH = 420;+const EMPTY: WorkspaceEditorState = { tabs: [], activeId: null, view: "files" };const MAX_TABS = 20;@@ -66,6 +83,11 @@ export const useEditorStore = create<EditorStore>()(toggleRequest: 0,reviewScope: "turn",sideOpen: true,+ modeByWorkspace: {},+ ideChatCollapsed: false,+ ideChatWidth: DEFAULT_IDE_CHAT_WIDTH,+ modeToggleRequest: 0,+ chatToggleRequest: 0,openTab: (workspaceId, tab) =>set((state) => {const current = state.byWorkspace[workspaceId] ?? EMPTY;@@ -113,11 +135,24 @@ export const useEditorStore = create<EditorStore>()(requestToggle: () => set((state) => ({ toggleRequest: state.toggleRequest + 1 })),setReviewScope: (reviewScope) => set({ reviewScope }),setSideOpen: (sideOpen) => set({ sideOpen }),+ setMode: (workspaceId, mode) =>+ set((state) => (state.modeByWorkspace[workspaceId] === mode ? state : { modeByWorkspace: { ...state.modeByWorkspace, [workspaceId]: mode } })),+ setIdeChatCollapsed: (ideChatCollapsed) => set({ ideChatCollapsed }),+ setIdeChatWidth: (width) => set({ ideChatWidth: Math.round(Math.min(Math.max(width, 320), 1200)) }),+ requestModeToggle: () => set((state) => ({ modeToggleRequest: state.modeToggleRequest + 1 })),+ requestChatToggle: () => set((state) => ({ chatToggleRequest: state.chatToggleRequest + 1 })),}),{name: "omnirush:editor:v1",storage: createJSONStorage(() => localStorage),- partialize: (state) => ({ byWorkspace: state.byWorkspace, reviewScope: state.reviewScope, sideOpen: state.sideOpen }),+ partialize: (state) => ({+ byWorkspace: state.byWorkspace,+ reviewScope: state.reviewScope,+ sideOpen: state.sideOpen,+ modeByWorkspace: state.modeByWorkspace,+ ideChatCollapsed: state.ideChatCollapsed,+ ideChatWidth: state.ideChatWidth,+ }),},),);diff --git a/apps/app/src/react-app/domains/session/editor/editor-surface.tsx b/apps/app/src/react-app/domains/session/editor/editor-surface.tsxindex 1ef325ff..a700e3c1 100644--- a/apps/app/src/react-app/domains/session/editor/editor-surface.tsx+++ b/apps/app/src/react-app/domains/session/editor/editor-surface.tsx@@ -89,12 +89,15 @@ function hunkBar(return bar;}+const VIEW_STATES = new Map<string, MonacoApi.editor.ICodeEditorViewState | MonacoApi.editor.IDiffEditorViewState | null>();+export function EditorSurface({ monaco, surface, onSave, onCursor, onHunks, navigate }: EditorSurfaceProps) {const codeHostRef = useRef<HTMLDivElement | null>(null);const diffHostRef = useRef<HTMLDivElement | null>(null);const codeRef = useRef<MonacoApi.editor.IStandaloneCodeEditor | null>(null);const diffRef = useRef<MonacoApi.editor.IStandaloneDiffEditor | null>(null);- const viewStates = useRef(new Map<string, MonacoApi.editor.ICodeEditorViewState | MonacoApi.editor.IDiffEditorViewState | null>());+ // Module-wide: a tab keeps its scroll and cursor when the editor unmounts (switching to Chat and back).+ const viewStates = useRef(VIEW_STATES);const currentKey = useRef<string | null>(null);const zoneIds = useRef<string[]>([]);const overlays = useRef<MonacoApi.editor.IOverlayWidget[]>([]);@@ -106,6 +109,8 @@ export function EditorSurface({ monaco, surface, onSave, onCursor, onHunks, naviconst onHunksRef = useRef(onHunks);onHunksRef.current = onHunks;const [mode, setMode] = useState<"file" | "diff" | null>(null);+ const modeRef = useRef(mode);+ modeRef.current = mode;// The editors, once.useEffect(() => {@@ -141,6 +146,8 @@ export function EditorSurface({ monaco, surface, onSave, onCursor, onHunks, navi});observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class", "data-theme"] });return () => {+ const key = currentKey.current;+ if (key) VIEW_STATES.set(key, modeRef.current === "diff" ? diff.saveViewState() : code.saveViewState());observer.disconnect();for (const disposable of disposables) disposable.dispose();code.dispose();diff --git a/apps/app/src/react-app/domains/session/editor/ide-chrome.tsx b/apps/app/src/react-app/domains/session/editor/ide-chrome.tsxnew file mode 100644index 00000000..34730f83--- /dev/null+++ b/apps/app/src/react-app/domains/session/editor/ide-chrome.tsx@@ -0,0 +1,248 @@+/** @jsxImportSource react */+/**+ * The pieces of the Chat / IDE layouts that sit outside the editor itself:+ * the mode toggle (always top-left of the main pane), the workspace and chat+ * switchers that replace the sessions sidebar in IDE mode, the chat panel+ * button, and the app destinations at the foot of the activity rail.+ */+import type { ReactNode } from "react";+import { Check, ChevronDown, Code2, Folder, MessageSquare, MessageSquareOff, MoreHorizontal, Plus, Settings } from "lucide-react";++import { Button } from "@/components/ui/button";+import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuGroup,+ DropdownMenuItem,+ DropdownMenuLabel,+ DropdownMenuSeparator,+ DropdownMenuTrigger,+} from "@/components/ui/dropdown-menu";+import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";+import { cn } from "@/lib/utils";+import type { LayoutMode } from "./editor-store";++const isMac = () => typeof navigator !== "undefined" && /Mac/i.test(navigator.platform);+export const shortcutLabel = (key: string) => (isMac() ? `⌘⇧${key}` : `Ctrl+Shift+${key}`);++export function LayoutModeToggle(props: { mode: LayoutMode; onChange: (mode: LayoutMode) => void; className?: string }) {+ const option = (mode: LayoutMode, label: string, icon: ReactNode) => {+ const active = props.mode === mode;+ return (+ <button+ type="button"+ role="radio"+ aria-checked={active}+ data-layout-mode-option={mode}+ onClick={() => props.onChange(mode)}+ className={cn(+ "flex h-6 items-center gap-1 rounded-md px-2 text-[12px] transition-colors [&_svg]:size-3.5",+ active+ ? "bg-background font-semibold text-foreground shadow-[0_1px_2px_rgba(0,0,0,0.12)] ring-1 ring-border dark:bg-gray-5"+ : "text-muted-foreground hover:text-foreground",+ )}+ >+ {icon}+ {label}+ </button>+ );+ };+ return (+ <Tooltip>+ <TooltipTrigger+ render={(+ <div+ role="radiogroup"+ aria-label="Layout"+ data-layout-mode={props.mode}+ className={cn("flex shrink-0 items-center gap-0.5 rounded-lg bg-muted p-0.5 mac:titlebar-no-drag", props.className)}+ />+ )}+ >+ {option("chat", "Chat", <MessageSquare />)}+ {option("ide", "IDE", <Code2 />)}+ </TooltipTrigger>+ <TooltipContent>Switch layout ({shortcutLabel("Y")})</TooltipContent>+ </Tooltip>+ );+}++export type SwitcherWorkspace = { id: string; name: string };++/** One click to another workspace (it opens in the layout remembered for it). */+export function WorkspaceSwitcher(props: { workspaces: SwitcherWorkspace[]; selectedId: string; onSelect: (id: string) => void }) {+ const current = props.workspaces.find((workspace) => workspace.id === props.selectedId);+ return (+ <DropdownMenu>+ <DropdownMenuTrigger+ render={(+ <Button variant="ghost" size="sm" className="h-7 min-w-0 max-w-56 gap-1.5 rounded-lg px-2 text-[12.5px] font-medium" data-workspace-switcher aria-label="Switch workspace">+ <Folder className="size-3.5 shrink-0 text-muted-foreground" />+ <span className="truncate">{current?.name ?? "Workspace"}</span>+ <ChevronDown className="size-3.5 shrink-0 text-muted-foreground" />+ </Button>+ )}+ />+ <DropdownMenuContent align="start" className="w-64">+ <DropdownMenuGroup>+ <DropdownMenuLabel>Workspaces</DropdownMenuLabel>+ {props.workspaces.map((workspace) => (+ <DropdownMenuItem key={workspace.id} onClick={() => props.onSelect(workspace.id)} data-workspace-switch-item={workspace.id}>+ <Folder className="size-4" />+ <span className="min-w-0 flex-1 truncate">{workspace.name}</span>+ {workspace.id === props.selectedId ? <Check className="size-4" /> : null}+ </DropdownMenuItem>+ ))}+ </DropdownMenuGroup>+ </DropdownMenuContent>+ </DropdownMenu>+ );+}++export type SwitcherChat = { id: string; title: string; status: "running" | "approval" | "idle" };++function StatusDot(props: { status: SwitcherChat["status"] }) {+ if (props.status === "idle") return null;+ return (+ <span+ aria-label={props.status === "approval" ? "Needs approval" : "Running"}+ className={cn("size-1.5 shrink-0 rounded-full", props.status === "approval" ? "bg-amber-9" : "animate-pulse bg-primary")}+ />+ );+}++/** This project's chats, in place of the sessions sidebar (IDE mode): the open chat, how many there are, which run. */+export function ChatSwitcher(props: {+ chats: SwitcherChat[];+ selectedId: string | null;+ title: string;+ onOpen: (id: string) => void;+ onNew: () => void;+ newDisabled?: boolean;+}) {+ const running = props.chats.some((chat) => chat.id !== props.selectedId && chat.status !== "idle");+ return (+ <div className="flex min-w-0 items-center gap-0.5">+ <DropdownMenu>+ <DropdownMenuTrigger+ render={(+ <Button variant="ghost" size="sm" className="h-7 min-w-0 max-w-64 gap-1.5 rounded-lg px-2 text-[13px] font-medium" data-chat-switcher aria-label="Switch chat">+ <MessageSquare className="size-3.5 shrink-0 text-muted-foreground" />+ <span className="truncate">{props.title}</span>+ {props.chats.length > 1 ? <span className="shrink-0 text-[11px] font-normal text-muted-foreground">{props.chats.length}</span> : null}+ {running ? <span className="size-1.5 shrink-0 animate-pulse rounded-full bg-primary" aria-label="Another chat is running" /> : null}+ <ChevronDown className="size-3.5 shrink-0 text-muted-foreground" />+ </Button>+ )}+ />+ <DropdownMenuContent align="start" className="max-h-[60vh] w-72 overflow-y-auto">+ <DropdownMenuItem onClick={props.onNew} disabled={props.newDisabled} data-chat-switch-new>+ <Plus className="size-4" />+ New chat+ </DropdownMenuItem>+ {props.chats.length ? <DropdownMenuSeparator /> : null}+ {props.chats.map((chat) => (+ <DropdownMenuItem key={chat.id} onClick={() => props.onOpen(chat.id)} data-chat-switch-item={chat.id}>+ <span className="min-w-0 flex-1 truncate">{chat.title}</span>+ <StatusDot status={chat.status} />+ {chat.id === props.selectedId ? <Check className="size-4" /> : null}+ </DropdownMenuItem>+ ))}+ </DropdownMenuContent>+ </DropdownMenu>+ <Tooltip>+ <TooltipTrigger+ render={(+ <Button variant="ghost" size="icon-sm" aria-label="New chat" onClick={props.onNew} disabled={props.newDisabled} className="rounded-lg text-muted-foreground">+ <Plus />+ </Button>+ )}+ />+ <TooltipContent>New chat</TooltipContent>+ </Tooltip>+ </div>+ );+}++/** Shows or hides the chat panel (IDE mode); while hidden it says when the chat needs you. */+export function ChatPanelButton(props: { open: boolean; attention: "approval" | "running" | null; onToggle: () => void }) {+ return (+ <Tooltip>+ <TooltipTrigger+ render={(+ <Button+ variant="ghost"+ size="icon-sm"+ aria-label={props.open ? "Hide chat" : "Show chat"}+ aria-pressed={props.open}+ data-chat-panel-toggle+ onClick={props.onToggle}+ className={cn("relative rounded-lg", props.open ? "bg-muted text-foreground" : "text-muted-foreground")}+ >+ {props.open ? <MessageSquareOff /> : <MessageSquare />}+ {!props.open && props.attention ? (+ <span+ className={cn("absolute right-1 top-1 size-2 rounded-full ring-2 ring-background", props.attention === "approval" ? "bg-amber-9" : "animate-pulse bg-primary")}+ data-chat-attention={props.attention}+ />+ ) : null}+ </Button>+ )}+ />+ <TooltipContent>{props.open ? "Hide chat" : "Show chat"} ({shortcutLabel("H")})</TooltipContent>+ </Tooltip>+ );+}++export type RailDestination = { id: string; label: string; icon: ReactNode; badge?: number; onSelect: () => void };++/** The app's destinations the sessions sidebar holds, at the foot of the IDE rail. */+export function RailDestinations(props: { destinations: RailDestination[]; onOpenSettings: () => void }) {+ const badge = props.destinations.reduce((sum, item) => sum + (item.badge ?? 0), 0);+ return (+ <>+ <DropdownMenu>+ <DropdownMenuTrigger+ render={(+ <button+ type="button"+ aria-label="More: parallel tasks, workflows, library"+ title="Parallel tasks, workflows, library and more"+ data-rail-more+ className="relative flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground [&_svg]:size-[18px]"+ >+ <MoreHorizontal />+ {badge ? (+ <span className="absolute right-0.5 top-0.5 min-w-3.5 rounded-full bg-primary px-1 text-center text-[9px] font-semibold leading-3.5 text-primary-foreground">{badge}</span>+ ) : null}+ </button>+ )}+ />+ <DropdownMenuContent side="right" align="end" className="w-60">+ {props.destinations.map((item) => (+ <DropdownMenuItem key={item.id} onClick={item.onSelect} data-rail-destination={item.id}>+ {item.icon}+ <span className="min-w-0 flex-1 truncate">{item.label}</span>+ {item.badge ? <span className="rounded bg-muted px-1 text-[10px] text-muted-foreground">{item.badge}</span> : null}+ </DropdownMenuItem>+ ))}+ </DropdownMenuContent>+ </DropdownMenu>+ <Tooltip>+ <TooltipTrigger+ render={(+ <button+ type="button"+ aria-label="Settings"+ onClick={props.onOpenSettings}+ className="flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground [&_svg]:size-[18px]"+ >+ <Settings />+ </button>+ )}+ />+ <TooltipContent side="right">Settings</TooltipContent>+ </Tooltip>+ </>+ );+}diff --git a/apps/app/src/react-app/domains/session/sidebar/app-sidebar-provider.tsx b/apps/app/src/react-app/domains/session/sidebar/app-sidebar-provider.tsxindex 9a02f534..4dba30c6 100644--- a/apps/app/src/react-app/domains/session/sidebar/app-sidebar-provider.tsx+++ b/apps/app/src/react-app/domains/session/sidebar/app-sidebar-provider.tsx@@ -1,9 +1,12 @@+import type { WorkspaceTasksClient } from "../../workspace/tasks/workspace-tasks-query";/** @jsxImportSource react */import * as React from "react";import type { WorkspaceConnectionState } from "../../../../app/types";import type { SessionNumberShortcutOs } from "../../../shell/session-number-shortcuts";export type SidebarContextValue = {+ /** Parallel tasks boards: the client that lists a workspace's tasks, and how to open a workspace's board. */+ parallelTasks?: { client: WorkspaceTasksClient; onOpen: (workspaceId: string) => void } | null;selectedWorkspaceId: string;selectedSessionId: string | null;developerMode: boolean;diff --git a/apps/app/src/react-app/domains/session/sidebar/app-sidebar.tsx b/apps/app/src/react-app/domains/session/sidebar/app-sidebar.tsxindex 41f56719..423ba47a 100644--- a/apps/app/src/react-app/domains/session/sidebar/app-sidebar.tsx+++ b/apps/app/src/react-app/domains/session/sidebar/app-sidebar.tsx@@ -136,6 +136,7 @@ import {type SessionNumberShortcutsState,} from "../../../shell/session-number-shortcuts";import type { SidebarContextValue } from "./app-sidebar-provider";+import { runningTaskCount, useWorkspaceTasks } from "../../workspace/tasks/workspace-tasks-query";import {MAX_SESSIONS_PREVIEW,flattenSessionRows,@@ -959,6 +960,8 @@ export type AppSidebarProps = {/** The parallel-task board of the selected repository, with how many of its tasks run. */tasksActive?: boolean;tasksRunningCount?: number;+ /** Opens a workspace's parallel tasks board (any local workspace, not only the selected one). */+ onOpenTasksForWorkspace?: (workspaceId: string) => void;onOpenTasks?: () => void;/** Opens the cross-session message search dialog (Cmd/Ctrl+Shift+F). */onOpenSessionSearch?: () => void;@@ -1275,6 +1278,9 @@ export function AppSidebar(props: AppSidebarProps) {onRecoverWorkspace: props.onRecoverWorkspace,onTestWorkspaceConnection: props.onTestWorkspaceConnection,onRetryWorkspaceTasks: props.onRetryWorkspaceTasks,+ parallelTasks: props.auditClient && props.onOpenTasksForWorkspace+ ? { client: props.auditClient, onOpen: props.onOpenTasksForWorkspace }+ : null,onEditWorkspaceConnection: props.onEditWorkspaceConnection,onForgetWorkspace: props.onForgetWorkspace,expandWorkspace,@@ -2029,6 +2035,13 @@ function WorkspaceSidebarGroup({</span></SidebarMenuSubButton></SidebarMenuSubItem>+ ) : !isRemoteWorkspace && ctx.parallelTasks ? (+ <EmptyWorkspaceRow+ workspaceId={workspace.id}+ parallelTasks={ctx.parallelTasks}+ newTaskDisabled={ctx.newTaskDisabled}+ onCreateTask={() => ctx.onCreateTaskInWorkspace(workspace.id)}+ />) : (<SidebarMenuSubItem><SidebarMenuSubButton@@ -2692,3 +2705,49 @@ function SessionMenuItem({</SidebarReorderItem>);}+++/**+ * A local workspace with no chats: "No tasks yet.", unless its parallel tasks+ * board has tasks (they run in copies of the repository, so their chats are+ * not listed under it); then a row that opens the board.+ */+function EmptyWorkspaceRow(props: {+ workspaceId: string;+ parallelTasks: NonNullable<SidebarContextValue["parallelTasks"]>;+ newTaskDisabled?: boolean;+ onCreateTask: () => void;+}) {+ const tasks = useWorkspaceTasks(props.parallelTasks.client, props.workspaceId);+ const total = tasks.data?.tasks.length ?? 0;+ const running = runningTaskCount(tasks.data);+ if (total > 0) {+ return (+ <SidebarMenuSubItem>+ <SidebarMenuSubButton+ className="text-xs text-foreground"+ onClick={() => props.parallelTasks.onOpen(props.workspaceId)}+ data-testid="sidebar-parallel-tasks-row"+ >+ <Layers className="size-3.5 shrink-0 text-muted-foreground" />+ <span className="truncate">+ {total === 1 ? "1 parallel task" : `${total} parallel tasks`}+ {running ? <span className="text-muted-foreground"> · {running} running</span> : null}+ </span>+ <span aria-hidden="true" className="ml-auto text-muted-foreground">→</span>+ </SidebarMenuSubButton>+ </SidebarMenuSubItem>+ );+ }+ return (+ <SidebarMenuSubItem>+ <SidebarMenuSubButton+ className="text-muted-foreground text-xs"+ onClick={props.onCreateTask}+ aria-disabled={props.newTaskDisabled}+ >+ <span className="truncate">{t("workspace.no_tasks")}</span>+ </SidebarMenuSubButton>+ </SidebarMenuSubItem>+ );+}diff --git a/apps/app/src/react-app/domains/session/surface/scroll-overlay.tsx b/apps/app/src/react-app/domains/session/surface/scroll-overlay.tsxindex 9e50d1bb..475e85b6 100644--- a/apps/app/src/react-app/domains/session/surface/scroll-overlay.tsx+++ b/apps/app/src/react-app/domains/session/surface/scroll-overlay.tsx@@ -1,4 +1,5 @@import { memo, useCallback } from "react";+import { ArrowDown, ArrowUp } from "lucide-react";import {selectSessionIsStickyBottom,@@ -27,10 +28,13 @@ const JumpToStartButton = memo(function JumpToStartButton({return (<buttontype="button"- className="rounded-full px-3 py-1.5 text-xs text-dls-text transition-colors hover:bg-dls-hover"+ className="flex items-center gap-1 rounded-full px-3 py-1.5 text-xs text-dls-text transition-colors hover:bg-dls-hover @max-[34rem]/chatpane:p-1.5"onClick={handleClick}+ aria-label="Jump to start"+ title="Jump to start">- Jump to start+ <ArrowUp className="hidden size-4 @max-[34rem]/chatpane:block" aria-hidden="true" />+ <span className="@max-[34rem]/chatpane:hidden">Jump to start</span></button>);});@@ -49,10 +53,13 @@ const JumpToLatestButton = memo(function JumpToLatestButton({return (<buttontype="button"- className="rounded-full px-3 py-1.5 text-xs text-dls-text transition-colors hover:bg-dls-hover"+ className="flex items-center gap-1 rounded-full px-3 py-1.5 text-xs text-dls-text transition-colors hover:bg-dls-hover @max-[34rem]/chatpane:p-1.5"onClick={handleClick}+ aria-label="Jump to latest"+ title="Jump to latest">- Jump to latest+ <ArrowDown className="hidden size-4 @max-[34rem]/chatpane:block" aria-hidden="true" />+ <span className="@max-[34rem]/chatpane:hidden">Jump to latest</span></button>);});@@ -79,8 +86,9 @@ export const SessionScrollOverlay = memo(function SessionScrollOverlay({}return (- <div className="pointer-events-none absolute bottom-2 left-1/2 z-30 flex -translate-x-1/2 justify-center">- <div className="pointer-events-auto flex items-center gap-2 rounded-full border border-dls-border bg-dls-surface/95 p-1 shadow-(--dls-card-shadow) backdrop-blur-md">+ // Narrow chat (under 34rem): small round buttons at the bottom right, clear of the text column.+ <div className="pointer-events-none absolute bottom-2 left-1/2 z-30 flex -translate-x-1/2 justify-center @max-[34rem]/chatpane:left-auto @max-[34rem]/chatpane:right-3 @max-[34rem]/chatpane:translate-x-0">+ <div className="pointer-events-auto flex items-center gap-2 rounded-full border border-dls-border bg-dls-surface p-1 shadow-(--dls-card-shadow) @max-[34rem]/chatpane:gap-1">{showJumpToStart ? (<JumpToStartButton onJumpToStartOfMessage={onJumpToStartOfMessage} />) : null}diff --git a/apps/app/src/react-app/domains/session/surface/session-surface.tsx b/apps/app/src/react-app/domains/session/surface/session-surface.tsxindex 4d2ba1f9..597891b8 100644--- a/apps/app/src/react-app/domains/session/surface/session-surface.tsx+++ b/apps/app/src/react-app/domains/session/surface/session-surface.tsx@@ -912,7 +912,7 @@ function AdmissionOutcomeUnknownCard(props: { resuming: boolean; onResume: () =><divdata-testid="admission-outcome-unknown"role="status"- className="not-prose mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 md:px-10"+ className="not-prose mx-auto flex w-full max-w-3xl flex-col items-start gap-2 px-2 @min-[40rem]/chatpane:px-10"><div className="flex min-w-0 items-center gap-2 py-1 text-sm text-dls-secondary"><CirclePause aria-hidden="true" className="size-4 shrink-0" />diff --git a/apps/app/src/react-app/shell/session-route.tsx b/apps/app/src/react-app/shell/session-route.tsxindex fce86f3e..2c0f4339 100644--- a/apps/app/src/react-app/shell/session-route.tsx+++ b/apps/app/src/react-app/shell/session-route.tsx@@ -1,4 +1,6 @@/** @jsxImportSource react */+import { useEditorStore } from "../domains/session/editor/editor-store";+import { isElectronRuntime } from "../../app/utils";import {useCallback,useEffect,@@ -2920,6 +2922,32 @@ export function SessionRoute() {};}, [selectedSessionId]);+ const layoutModeName = useEditorStore((state) => (selectedWorkspaceId ? state.modeByWorkspace[selectedWorkspaceId] : undefined) ?? "chat");+ const layoutPaletteItems = useMemo<PaletteItem[]>(() => isElectronRuntime() ? [+ {+ id: "layout.toggle",+ title: layoutModeName === "ide" ? "Switch to Chat layout" : "Switch to IDE layout",+ detail: "Chat: sessions and the conversation. IDE: files, editor and terminal, with the chat on the right",+ meta: "Cmd/Ctrl+Shift+Y",+ searchText: "layout ide editor chat mode code files switch toggle",+ action: () => {+ setCommandPaletteOpen(false);+ useEditorStore.getState().requestModeToggle();+ },+ },+ ...(layoutModeName === "ide" ? [{+ id: "layout.chat-panel",+ title: "Show or hide the chat",+ detail: "Fold the chat panel of the IDE layout away, or bring it back",+ meta: "Cmd/Ctrl+Shift+H",+ searchText: "chat panel hide show collapse ide",+ action: () => {+ setCommandPaletteOpen(false);+ useEditorStore.getState().requestChatToggle();+ },+ }] : []),+ ] : [], [layoutModeName]);+const terminalPaletteItems = useMemo<PaletteItem[]>(() => platform.capabilities.terminal ? [{id: "terminal.toggle",@@ -3642,6 +3670,7 @@ export function SessionRoute() {dashboardActive: dashboardRouteActive || appsRouteActive,tasksActive: tasksRouteActive,tasksRunningCount,+ onOpenTasksForWorkspace: (workspaceId: string) => navigate(workspaceTasksRoute(workspaceId)),onOpenTasks: tasksAvailable ? () => navigate(workspaceTasksRoute(tasksBoardWorkspaceId)) : undefined,onOpenDashboard: mcpAppsDashboardEnabled? () => {@@ -4011,7 +4040,7 @@ export function SessionRoute() {currentSessionForGroupMove={currentSessionForGroupMove}currentSessionGroupId={currentSessionGroupId}onMoveCurrentSessionToGroup={handleMoveCurrentSessionToGroup}- extraItems={[...currentSessionActionPaletteItems, ...(sessionFindPaletteItem ? [sessionFindPaletteItem] : []), sessionSearchPaletteItem, ...tasksPaletteItems, ...terminalPaletteItems, ...(checkDesktopRestriction({ restriction: "allowControlSettings" }) ? [] : [developerModePaletteItem]), ...(copySessionIdPaletteItem ? [copySessionIdPaletteItem] : []), diagnosticsCopyPaletteItem, diagnosticsExportPaletteItem, nextSessionTabPaletteItem, prevSessionTabPaletteItem, reloadConfigPaletteItem]}+ extraItems={[...currentSessionActionPaletteItems, ...(sessionFindPaletteItem ? [sessionFindPaletteItem] : []), sessionSearchPaletteItem, ...tasksPaletteItems, ...layoutPaletteItems, ...terminalPaletteItems, ...(checkDesktopRestriction({ restriction: "allowControlSettings" }) ? [] : [developerModePaletteItem]), ...(copySessionIdPaletteItem ? [copySessionIdPaletteItem] : []), diagnosticsCopyPaletteItem, diagnosticsExportPaletteItem, nextSessionTabPaletteItem, prevSessionTabPaletteItem, reloadConfigPaletteItem]}listAgents={listAgents}selectedAgent={selectedAgent}onSelectAgent={setSelectedAgent}diff --git a/apps/app/src/react-app/shell/use-shell-shortcuts.ts b/apps/app/src/react-app/shell/use-shell-shortcuts.tsindex f32c38a6..a99f4aa0 100644--- a/apps/app/src/react-app/shell/use-shell-shortcuts.ts+++ b/apps/app/src/react-app/shell/use-shell-shortcuts.ts@@ -118,7 +118,9 @@ export function useShellShortcuts(input: UseShellShortcutsInput) {// Cmd/Ctrl+K -> toggle command palette// Cmd/Ctrl+J -> toggle terminal panel (matches VS Code)// Cmd/Ctrl+P -> editor: go to file (opens the editor)- // Cmd/Ctrl+Shift+E -> show / hide the editor+ // Cmd/Ctrl+Shift+E -> open the IDE layout (files view)+ // Cmd/Ctrl+Shift+Y -> switch layout: Chat / IDE+ // Cmd/Ctrl+Shift+H -> IDE layout: show / hide the chat// Ctrl+Shift+` -> new terminal tab (matches VS Code; Ctrl on macOS too)// Cmd/Ctrl+F -> find in current conversation (handled by session surface)// Cmd/Ctrl+Shift+F -> search every session (titles + messages)@@ -160,6 +162,16 @@ export function useShellShortcuts(input: UseShellShortcutsInput) {if (!event.repeat) useEditorStore.getState().requestToggle();return;}+ if (event.shiftKey && !event.altKey && event.key?.toLowerCase() === "y" && isElectronRuntime()) {+ event.preventDefault();+ if (!event.repeat) useEditorStore.getState().requestModeToggle();+ return;+ }+ if (event.shiftKey && !event.altKey && event.key?.toLowerCase() === "h" && isElectronRuntime()) {+ event.preventDefault();+ if (!event.repeat) useEditorStore.getState().requestChatToggle();+ return;+ }if (event.shiftKey && !event.altKey && event.key?.toLowerCase() === "t") {event.preventDefault();onPrevSessionTab?.();